A NodeJS Rest Api utilizing a MongoDB Cloud Atlas database with ~ 23.5k documents. Live demo here.
- Final project of my JavaScript Developer Course (8w fulltime) with alfatraining GmbH
- My inspiration was to explore backend development, to explore the world of apis
- The goal was to build a robust and comprehensive api with clean code and modular architecture
- NodeJS
- Express
- Mogoose
- MongoDb
List the ready features here:
- crud operations
- filtering, sorting, limiting, pagination, search
- mongodb equality operators
- GET all movies: https://moviedb-rest-api.herokuapp.com/api/v1/movies
- GET movie by id: https://moviedb-rest-api.herokuapp.com/api/v1/movies/573a139ff29313caabd015b9
- POST (create) movie: https://moviedb-rest-api.herokuapp.com/api/v1/movies
- PATCH (update) movie: https://moviedb-rest-api.herokuapp.com/api/v1/movies/573a13eff29313caabdd7db8
- DELETE movie: https://moviedb-rest-api.herokuapp.com/api/v1/movies/573a13eff29313caabdd7db8
Search for title, plot, cast, directors (all indexed). (OR) searches for either keyword, (AND) searches for both or all keywords.
- GET search (OR): https://moviedb-rest-api.herokuapp.com/api/v1/movies?search=dark+knight
- GET searchall (AND): https://moviedb-rest-api.herokuapp.com/api/v1/movies?searchall=dark+knight
Basically all movie properties can be filtered, like e.g. year, rating, cast, type, genres. The results can be sorted, it's possible to use equality operators and show only results with e.g. a rating greater or equal than (gte) a rating of 5, to only show results where the genres equals (eq) drama or to only project certain fields of the indiviual results, e.g. to show only title, rating, year, genres of each movie instead of all properties.
- GET filter by year and rating: https://moviedb-rest-api.herokuapp.com/api/v1/movies?year=2009&rating=7
- GET all drama movies with a rating greater or equal than 5, limit to 25 results, sorted descneding by rating, show only title, rating, year of each result: http://moviedb-rest-api.herokuapp.com/api/v1/movies?rating[gte]=5&limit=25&sort=-rating&genres[eq]=drama&fields=title,rating,year,genres
- GET movies between 1999 and 2003 with a rating greater of equal than 8.5: http://moviedb-rest-api.herokuapp.com/api/v1/movies?year[gte]=1999&year[lte]=2003&rating[gte]=8.5
- GET: https://moviedb-rest-api.herokuapp.com/api/v1/movies?page=5&limit=25&fields=title,rating,year,awards&year[gt]=1983&year[lt]=2012&sort=-rating&genre=drama&rating[gte]=8
- GET Top 100 All-time: https://moviedb-rest-api.herokuapp.com/api/v1/movies/top-100-alltime
- GET Top Movies by year (2012): https://moviedb-rest-api.herokuapp.com/api/v1/movies/top-100-yearly/2012
- GET 3 random movies: https://moviedb-rest-api.herokuapp.com/api/v1/movies/random
- GET Database Stats: https://moviedb-rest-api.herokuapp.com/api/v1/movies/stats
Project is: complete. Unless inspiration strikes ;)
Room for improvement:
- Authentication for delete operations
