Achievement 2 - Project: myFlix

Goal: 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

API Endpoints

Request URL Method Request body data format Response body data format
Get a list of ALL movies /movies GET none A JSON object holding an array with all movies.
Get data about a single movie by title /movies/[movieTitle] GET none A JSON object holding data about a single movie, containing description, genre, director, image URL, whether it's featured or not.
{
"Genre": "652d7f3efd2bee0e91cb39a0",
"Director": "652d5b37c1c10235974385b4",
"Actors": [],
"_id": "652d83e4fd2bee0e91cb39a8",
"Title": "The French Dispatch",
"Description": "A love letter to journalists set in an outpost of an American newspaper in a fictional twentieth-century French city that brings to life a collection of stories published in 'The French Dispatch Magazine'.",
"ImageURL": "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcSHZ28VU-SMkaUGIGAT_RsKRFI1sd3wSEftFmPxE0nEA_ex5dzM",
"Featured": false
}

Get a list of all users /users GET none A JSON object holding an array with all users.
Get data about genre /movies/genre/[genreName] GET none A JSON array holding objects with all the movies that belong to the searched genre:
[
{
"Genre": {
"Name": "Thriller",
"Description": "Thriller film, also known as suspense film or suspense thriller, is a broad film genre that involves excitement and suspense in the audience."
},
"Director": {
"Name": "Jonathan Demme",
"Bio": "Robert Jonathan Demme was an American director, producer, and screenwriter.",
"Birth": "1944",
"Death": "2017"
}, "Actors": [],
"_id": "652d9c59fd2bee0e91cb39b8",
"Title": "Silence of the Lambs",
"Description": "A young FBI cadet must receive the help of an incarcerated and manipulative cannibal killer to help catch another serial killer.",
"ImagePath": "silenceofthelambs.png",
"Featured": true
}
]
Get data about a director by name /movies/directors/[directorName] GET none A JSON object holding data with all the movies that belong to the searched director:
{
"Genre": {
"Name": "Thriller",
"Description": "Thriller film, also known as suspense film or suspense thriller, is a broad film genre that involves excitement and suspense in the audience."
},
"Director": {
"Name": "Jonathan Demme",
"Bio": "Robert Jonathan Demme was an American director, producer, and screenwriter.",
"Birth": "1944",
"Death": "2017"
}, "Actors": [],
"_id": "652d9c59fd2bee0e91cb39b8",
"Title": "Silence of the Lambs",
"Description": "A young FBI cadet must receive the help of an incarcerated and manipulative cannibal killer to help catch another serial killer.",
"ImagePath": "silenceofthelambs.png",
"Featured": true
}
Add a new user /users POST A JSON object holding user data with 3 requierd fields [Username] [Password] [Email] and last optional field [Birthday]:
{
"Username": "User2",
"Password": "test100000",
"Email": "bobby1@hotmail.com",
"Birthday": "1983-01-02"
}
A JSON object holding all the user data including the generated ID:
{
"Username": "User2",
"Password": "test100000",
"Email": "bobby1@hotmail.com",
"Birthday": "1983-01-02T23:00:00.000Z",
"FavoriteMovies": [],
"_id": "652fc200c7198aac5f951692",
"__v": 0
}
Update user username /users/[currentUsername] PUT A JSON object holding user data with 3 required fields [Username] [Password] [Email].
{
"Username": "User3",
"Password": "test100000",
"Email": "bobby1@hotmail.com"
}
An updated JSON object with all user data and the updated username:
{
"_id": "652fc200c7198aac5f951692",
"Username": "User3",
"Password": "test100000",
"Email": "bobby1@hotmail.com",
"Birthday": "1983-01-02T00:00:00.000Z",
"FavoriteMovies": [ "652d83e4fd2bee0e91cb39ac" ],
"__v": 0
}
Add a movie to user favorite list users/[username]/movies/[movieID] POST None An updated JSON object that includes user data with the addition of the movie to the user's favoriteMovies array:
{
"_id": "652fc200c7198aac5f951692",
"Username": "User2",
"Password": "test100000",
"Email": "bobby1@hotmail.com",
"Birthday": "1983-01-02T23:00:00.000Z",
"FavoriteMovies": [ "652d83e4fd2bee0e91cb39ac" ],
"__v": 0
}
Remove a movie from user favorite list users/[username]/movies/[movieID] DELETE None A text message indicating whether a movie was successfully removed from the favorite list.
Delete user registration /users/[username] DELETE None A text message indicating whether [username] was successfully deleted.