Skip to content

Rest server made with NodeJS and MongoDB for a cafeteria

License

Notifications You must be signed in to change notification settings

alesbe/node-restserver

Repository files navigation

REST API: Cafeteria with NodeJS

REST server made with NodeJS and MongoDB.

API documentation and info: Postman docs

example

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.

NPM packages used

Features

  • 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

Install 🐳

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!

Download the source code

Git clone the project or download the last version from releases

Run the containers

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