The MyFlix RESTful API lets users explore movies, directors, and genres. Registered users can sign up, update their profiles, and manage a list of favorite movies. Responses are returned in JSON format.
The API is hosted on Heroku and uses MongoDB Atlas for secure and scalable data storage.
Description: Returns a list of all movies.
Method: GET
Example URL: /movies
Response Example:
{
"_id": "60f1c...",
"Title": "Inception",
"Description": "A thief enters dreams to implant ideas, navigating complex subconscious worlds.",
"Genre": { "Name": "Sci-Fi", "Description": "Futuristic and scientific concepts." },
"Director": { "Name": "Christopher Nolan", "BirthYear": 1970 },
"Actors": ["Leonardo DiCaprio", "Joseph Gordon-Levitt", "Elliot Page"],
"ImagePath": "/images/inception.jpg",
"ReleaseYear": 2010,
"Featured": true,
"Rating": 8.8
}
Description: Returns details about a single movie by title.
Method: GET
Example URL: /movies/Inception
Response Example:
{
"Title": "Inception",
"Description": "A thief enters dreams to implant ideas, navigating complex subconscious worlds.",
"Genre": { "Name": "Sci-Fi", "Description": "Futuristic and scientific concepts." },
"Director": { "Name": "Christopher Nolan", "BirthYear": 1970 },
"Actors": ["Leonardo DiCaprio", "Joseph Gordon-Levitt", "Elliot Page"],
"ImagePath": "/images/inception.jpg",
"ReleaseYear": 2010,
"Featured": true,
"Rating": 8.8
}
Description: Returns genre details by name.
Method: GET
Example URL: /genres/Thriller
Response Example:
{
"Name": "Thriller",
"Description": "Suspenseful and intense"
}
Description: Returns director details by name.
Method: GET
Example URL:
/directors/Christopher%20Nolan
Response Example:
{
"Name": "Christopher Nolan",
"BirthYear": "1970-07-30T00:00:00.000Z"
}
Description: Registers a new user.
Method: POST
Example URL: /users
Request Body:
{
"username": "kevinM",
"password": "KevPass321#",
"email": "kevin@example.com",
"birthday": "1989-05-25T00:00:00Z",
"favoriteMovies": ["64f24a8cf82e4a5b3c12345b"]
}
Response: Created user object.
Description: Updates user information.
Method: PUT
Example URL: /users/kevinM
Request Body:
{
"username": "kevinM",
"password": "KevPass321#"
}
Response: Updated user object.
Description: Adds a movie to the user's list of favorites.
Method: POST
Example URL:
/users/kevinM/movies/64f24a8cf82e4a5b3c12345b
Response: Updated user object with favoriteMovies.
Description: Removes a movie from the user's list of favorites.
Method: DELETE
Example URL:
/users/kevinM/movies/64f24a8cf82e4a5b3c12345b
Response: Updated user object without the removed movie.
Description: Deregisters a user.
Method: DELETE
Example URL: /users/kevinM
Response Example:
{
"message": "User deleted",
"user": { /* user object */ }
}