Business Logic | URL | HTTP Method | Query Parameters | Request body data format | Response body data format |
---|---|---|---|---|---|
Return a list of ALL movies to the user | /movies | GET | None | None | A JSON object holding data about all the movies { "title: "movie title", "description": "movie description", "genre": { "name": "movie genre", "description": "genre description" }, "director": { "name": "director name", "bio": "director bio", "birthYear": "director birth year" "deathYear": "director death year" (if applicable) }, "imageUrl": "Image link for movie art", "featured": "true or false" }, {etc.}, {etc.}, {etc.} |
Return data (description, genre, director, image URL, whether it’s featured or not) about a single movie by title to the user | /movies/:title | GET | :title | None | A JSON object holding data about a single movie, containing a title, description, genre, director,
and imageURL. { "title: "movie title", "description": "movie description", "genre": { "name": "movie genre", "description": "genre description" }, "director": { "name": "director name", "bio": "director bio", "birthYear": "director birth year" "deathYear": "director death year" (if applicable) }, "imageUrl": "Image link for movie art", "featured": "true or false" } |
Return data about a genre (description) by name/title (e.g., “Thriller”) | /movies/genre/:genreName | GET | :genreName | None | A JSON object holding data about all movies in the database that share the specified genre. { "title: "movie title", "description": "movie description", "genre": { "name": "movie genre", "description": "genre description" }, "director": { "name": "director name", "bio": "director bio", "birthYear": "director birth year" "deathYear": "director death year" (if applicable) }, "imageUrl": "Image link for movie art", "featured": "true or false" }, { Next movie with the specified genre}, { Next movie with the specified genre}, {etc.} |
Return data about a director (name, bio, birth year, death year) by name | /movies/director/:directorName | GET | :directorName | none | A JSON object holding data about all movies directed by the specified director. { "title: "movie title", "description": "movie description", "genre": { "name": "movie genre", "description": "genre description" }, "director": { "name": "director name", "bio": "director bio", "birthYear": "director birth year" "deathYear": "director death year" (if applicable) }, "imageUrl": "Image link for movie art", "featured": "true or false" }, { Next movie with the specified director}, { Next movie with the specified director}, {etc.} |
Allow new users to register | /users | POST | None | A JSON object holding data about a single user to add. { "username": "example username", REQUIRED "password": "exampe password", REQUIRED "email": "example@email.com", REQUIRED "birthDate": "example format: 2023-06-25" } |
A JSON object holding data about the single user that was added, including a genrerated id. { "_id": "1", "username": "example username", "password": "example password", "email": "example@email.com", "birthDate": "specified date" "favoriteMovies": [] } |
Allow users to update their user info (username, password, email, date of birth) | /users/:username | PUT | :Name | A JSON object holding the needed data field about a single user to update. { "username": "updated username", "password": "updated password", "email": "updated@email.com", "birthDate": "new date" } |
A JSON object holding all data about the single user that was updated { "_id": "1", "username": "updated username", "password": "updated password", "email": "updated@email.com", "birthDate": "new date" "favoriteMovies": [] } |
Allow users to add a movie to their list of favorites | /users/:username/movies/:MovieID | POST | :Name, :MovieID |
None | A JSON object holding all data about the single user that added to their favorite movies. { "_id": "1", "username": "example username", "password": "example password", "email": "example@email.com", "birthDate": "specified date" "favoriteMovies": ["added MovieID"] } |
Allow users to remove a movie from their list of favorites | /users/:username/movies/:MovieID | DELETE | :Name, :MovieID |
None | A JSON object holding all data about the single user that removed a movie from their favorite
movies. { "_id": "1", "username": "example username", "password": "example password", "email": "example@email.com", "birthDate": "specified date" "favoriteMovies": [] } |
Allow existing users to deregister | /users/:username | DELETE | :Name | None | A text message indicating the user has been removed from the database "(the username) has been successfully removed from the database." |