REST server made with NodeJS and MongoDB.
API documentation and info: Postman docs
REST API created as a project to simulate a cafeteria or restaurant. User management, categories, requests GET, POST, PUT, DELETE and PATCH and token user autentication.
- bcrypt: Password encryptation
- body-parser: Take request parameters
- express: HTTP server
- express-fileupload: Files upload
- google-auth-library: Google authentication
- jsonwebtoken: Token authentication
- mongoose: MongoDB connection
- mongoose-unique-validator: MongoDB validation
- underscore: Additional JS functionality
-
General features
- CRUD for users, categories and products
- Role system for users
- JWT token authentication and Google OAuth
- Categories for each product
- Image upload
-
Security
- Password encryptation with bcrypt
- URL protection with tokens
- Images saved in non-public folders
- Admin and users role system
- Validation system with mongoose-unique-validator
- Token seeds saved in server side
- Password protection to prevent being showed in clear text on JSON
- Category or product linked to the user that created it
- File extension validation
- Error capture returning an HTTP code
- Image URL protected with token
I bundled the project in 2 docker containers, however this project was made with learning purposes and is not maintained, do not use it in a real enviorment!
Git clone the project or download the last version from releases
Cd into the project root folder, and do docker-compose up
, this will pull the docker images and start them.
By default, the backend server is running on port 8000
, and mongodb in port 27017