Create an API to manage a collection of movies, series, and/or anime.
Objective : Create a simple API to add, read, update and delete movies/anime from a virtual collection.
Technologies to be used :
- Node.js
- Express.js
- Base de données de votre choix (par exemple MongoDB avec Mongoose, firebase, supabase, ou autre)
- Add a movie/anime:
- Route: POST
/movies
- Request body:
{title: String, director: String, year: Number, genre: String}
- Response: The movie/anime added with a unique ID.
- Route: POST
- Read all movies/anime:
- Route: GET
/movies
- Response: A list of all movies/animes.
- Route: GET
- Lire un film/animé par ID :
- Route: GET
/movies/:id
- Response: Details of the given ID movie/anime.
- Route: GET
- Explicit variable names : Make sure the names of variables, functions, etc. are clear, consize and explicit. For instance, use
movie
oranime
instead ofmov
oranim
. - Modularity : Make sure to separate your software in distinct modules. For instance, put the routes in a folder, the controllers in another one, the database in a third one, etc.
- Errors handling : Handle all possible errors and return approriate responses. For instance, if a movie with a given ID is not found, return a response with status code 404.
- Smart comments : Do not overload yoru code with comments, but add them only when necessary to clarify parts of the code that might lead to confusion.
- Tests : If possible, write unit tests for all main features of your software to ensure their proper functioning.
- Implement an authentification to protect/restrict access to the API.
- Add a feature to sort and filter movies/anime by title, director, year of release or genre.