A data-driven application for CS 348. Created in Spring 2024 by Nandan Patel, Emily Wang, Justin Lin, Jessie Zhang, and Zain Salman.
The client web-app for the based-ten application
Install the dependencies by running npm i
in the client directory.
Run the client app using npm run dev
in the client directory. Ensure the server is running.
The API service for the based-ten application
- Make sure you have Rust installed and can use the
cargo
package manager. - Install the sqlx-cli tool
- Run the following command in the terminal at the root of the project directory, with the
Cargo.toml
file.sqlx migrate run
- From the root of the project directory, run the following command to run our script for seeding the database with our production data
cargo run --package seed
- To delete all tables and thus the data stored in the database, run the following command in the terminal at the root of the project directory with the
Cargo.toml
file.
sqlx migrate revert
To run the backend server is quite simply; simply run the following command in the terminal anywhere near the project directory:
cargo run
Doing so, you should have the following message (at least similar to the following message) appear in the terminal:
DEBUG based_ten: Now listening on port 5000
Now, you can make normal HTTP requests to our backend server, with the following endpoints being currently available. Sample objects for POST or UPDATE requests are not shown, as this API is an internal tool.
-
GET /api/anime
-
POST /api/anime
-
GET /api/anime/:id
-
PATCH /api/anime/:id
-
DELETE /api/anime/:id
-
GET /api/movies
-
POST /api/movies
-
GET /api/movies/:id
-
PATCH /api/movies/:id
-
DELETE /api/movies/:id
-
GET /api/songs
-
POST /api/songs
-
GET /api/songs/:id
-
PATCH /api/songs/:id
-
DELETE /api/songs/:id
-
GET /api/videogames
-
POST /api/videogames
-
GET /api/videogames/:id
-
PATCH /api/videogames/:id
-
DELETE /api/videogames/:id
-
GET /api/media
-
GET /api/lists
-
GET /api/lists/top
-
GET /api/lists/likes/:list_type
-
GET /api/users
-
POST /api/users
-
GET /api/users/:user_name
-
GET /api/users/:user_name/info
-
GET /api/users/:user_name/:list_name
-
GET /api/users/:user_name/:list_name/type
-
GET /api/users/:user_name/likes
-
GET /api/likes
-
GET /api/likes/:user_name
-
GET /api/follow
-
GET /api/follow/:user_name/following
-
GET /api/follow/:user_name/mutual
-
GET /api/groups
-
GET /api/groups/all
-
GET /api/groups/:user_name/group_members
-
GET /api/groups/:gid/group
-
GET /api/groups/:gid/members
-
GET /api/groups/:gid/lists
-
GET /api/groups/:gid/circles
-
POST /api/auth/register
-
POST /api/auth/login
GET /api/auth/logout
GET /api/auth/user
GET /api/explore/:user_name
POST /api/lists/:user_name
PATCH /api/lists/:user_name/:list_name
DELETE /api/lists/:user_name/:list_name
GET /api/listitems/:list_name/:item_id
POST /api/listitems/:list_name/:item_id
PATCH /api/listitems/:list_name/:item_id
DELETE /api/listitems/:list_name/:item_id
GET /api/users/:user_name/me
PATCH /api/users/:user_name/me
DELETE /api/users/:user_name/me
POST /api/likes/
DELETE /api/likes/:liking/:list_name
POST /api/follow
DELETE /api/follow/:following
POST /api/groups/:gid/join
DELETE /api/groups/:gid/unjoin
POST /api/groups/:user_name/me
DELETE /api/groups/:user_name/me/:group_name
- Search (Main Page)
- Explore (Recommended Lists) Page
- Create/View a list
- Account page for a user (view all user's lists, groups, followers, etc.)
- Manage Groups page (accept/reject invites?)
- A "Search Users & Groups" page: almost identical to Main Search page, but shows results for users and groups