MyFlix

The objective of this project is to build the server-side component of a "movies" web application. The web application will provide users with access to information about different movies, directors, and genres. Users will be able to sign up, update their personal information, and create a list of their favorite movies.

End Points

Business Logic URL HTTP Method Request body data format Response body data format
Return a list of all movies /movies GET:
app.get('/movies', (req, res) => {
None A JSON object holding data about all the movies:
[ { Title: "The Shawshank Redemption", Description: "Two imprisoned men bond over a number of years, finding solace and eventual redemption through acts of common decency.", Genre: { Name: "Drama", Description: "Drama Films are serious presentations or stories with settings or life situations that portray realistic characters in conflict with either themselves, others, or forces of nature. A dramatic film shows us human beings at their best, their worst, and everything in-between." }, Director: { Name: "Frank Darabont", Bio: "Frank Árpád Darabont is an American film director, screenwriter and producer. He has been nominated for three Academy Awards and a Golden Globe Award. In his early career, he was primarily a screenwriter for such horror films as A Nightmare on Elm Street 3: Dream Warriors, The Blob and The Fly II.", Birth: "1959-01-28", Death: null }, ImagePath: "https://m.media-amazon.com/images/M/MV5BMDFkYTc0MGEtZmNhMC00ZDIzLWFmNTEtODM1ZmRlYWMwMWFmXkEyXkFqcGdeQXVyMTMxODk2OTU@._V1_UX67_CR0,0,67,98_AL_.jpg", Featured: true },...
Return data (description, genre, director, image URL, whether it's featured or not) about a single movie by title /movies/:Title GET:
app.get('/movies/:Title', (req, res) => {
None A JSON object holding data about the particular movie requested:
{ Title: "The Shawshank Redemption", Description: "Two imprisoned men bond over a number of years, finding solace and eventual redemption through acts of common decency.", Genre: { Name: "Drama", Description: "Drama Films are serious presentations or stories with settings or life situations that portray realistic characters in conflict with either themselves, others, or forces of nature. A dramatic film shows us human beings at their best, their worst, and everything in-between." }, Director: { Name: "Frank Darabont", Bio: "Frank Árpád Darabont is an American film director, screenwriter and producer. He has been nominated for three Academy Awards and a Golden Globe Award. In his early career, he was primarily a screenwriter for such horror films as A Nightmare on Elm Street 3: Dream Warriors, The Blob and The Fly II.", Birth: "1959-01-28", Death: null }, ImagePath: "https://m.media-amazon.com/images/M/MV5BMDFkYTc0MGEtZmNhMC00ZDIzLWFmNTEtODM1ZmRlYWMwMWFmXkEyXkFqcGdeQXVyMTMxODk2OTU@._V1_UX67_CR0,0,67,98_AL_.jpg", Featured: true }
Return data about a genre (description) by name/title /movies/genre/:GenreName GET:
app.get('/movies/genre/:GenreName', (req, res) => {
None A JSON object holding data about the genre (description):
"Drama Films are serious presentations or stories with settings or life situations that portray realistic characters in conflict with either themselves, others, or forces of nature. A dramatic film shows us human beings at their best, their worst, and everything in-between."
Return data about a director (bio, birth year, death year) by name /movies/director/:DirectorName GET:
app.get('/movies/director/:DirectorName', (req, res) => {
None A JSON object holding data about the director (name, bio, birth year, death year):
{ Name: "Frank Darabont", Bio: "Frank Árpád Darabont is an American film director, screenwriter and producer. He has been nominated for three Academy Awards and a Golden Globe Award. In his early career, he was primarily a screenwriter for such horror films as A Nightmare on Elm Street 3: Dream Warriors, The Blob and The Fly II.", Birth: "1959-01-28", Death: null }
Allow new users to register /users PUT:
app.post('/users', (req, res) => {
A JSON object holding data about the user (name, favorite movies) A JSON object holding data about the user who was added (username, password, email, birthday):
{ Username: "julian", Password: "password1", Email: "julian@gmail.com", Birthday: new Date("1985-05-30"), },
Allow users to update their user info (username) /users/:Username PUT:
app.put('/users/:Username', (req, res) => {
A JSON object holding the user ID and new username A JSON object holding data about the updated user (id, username, password, emai, birthday, favorite movies):
{ " id": "6245028bdeb5a370920dea27", "Username": "testuser", "Password": "testpassword", "Email": "test@gmail.com", "Birthday": "1985-05-3007:00:00.000z", "FavoriteMovies": [] }
Allow users to add a movie to their list of favorites /users/:Username/movies/:MovieID POST:
app.post('/users/:Username/movies/:MovieID', (req, res) => {
None A JSON object holding data about the updated user (id, username, password, emai, birthday, favorite movies):
{ " id": "6241fda73ea9009a0a87739f", "Username": "julian", "Password": "password1", "Email": "julian@gmail.com", "Birthday": "1985-05-30T00:00:00.000Z", "FavoriteMovies" ["6241£42f3ea9009a0a877395"] }
Allow users to remove a movie from their list of favorites /users/:Username/movies/:MovieID DELETE:
app.delete('/users/:Username/movies/:MovieID', (req, res) => {
None A JSON object holding data about the updated user (id, username, password, emai, birthday, favorite movies):
{ " id": "6241fda73ea9009a0a87739f", "Username": "julian", "Password": "password1", "Email": "julian@gmail.com", "Birthday": "1985-05-30T00:00:00.000Z", "FavoriteMovies" ["6241£42f3ea9009a0a877395"] }
Allow existing users to deregister /users/:Username DELETE:
app.delete('/users/:Username', (req, res) => {
None Returns a message saying that the user was deleted:
avi was deleted