This app Performs API CRUD operations on mongodb movies database.
- Authorization/Generate access token - CRUD on movies/theater - CRUD on movie's comment
To get the Node server running:
Download Node.js
herenpm install
to install all required dependencies- Install MongoDB instructions
app.js
- The entry point to the application. This file defines our express server, requires the routers and some middlewares.db.js
- This file connects the app to MongoDB using MongoDB node.js driverrouters/
- Folder contains the route definitions for the app.middlewares/
- Folder contains our middlewares to handle some requests (jwt, error handler).controllers/
- This folder contains main controllers.models/
- This folder contains the data models.models/modelname/schema
- This file contain JOI's data validation schema for every data model.
[
"dotenv", "express", "express-jwt", "joi", "jsonwebtoken", "md5", "mongodb", "morgan", "swagger-ui-express"
]
- express - The server for handling and routing requests
- mongodb - The official MongoDB driver for Node.js.
- jsonwebtoken - For generating JWTs used by authentication
- express-jwt - Middleware for validating JWTs for authentication
- Joi - A schema description language and data validator for JS.
- dotenv - A module to load environment variables from a .env file into process.env
- morgan - Request logger middleware
- swagger-ui-express - Swagger package for API documentation
- JWT Handbook - To understand how JWT works
- Express middlewares - To use middlewares as documented
- Joi
Documentation
- Using MongoDB Driver with Node
- Swagger editor