Skip to content

Latest commit

 

History

History
22 lines (16 loc) · 1.95 KB

README.md

File metadata and controls

22 lines (16 loc) · 1.95 KB

Backend

As we mentioned, the backend consists of four microservices. One of them is an NGINX reverse proxy server. The other three are Express.js servers that contain the main logic of the app.

The three Express.js servers share the following features:

  • They use MongoDB as a DBMS.
  • They use Mongoose as an ODM.
  • They use JWT for authentication and authorization.
  • They use morgan as a logger.

We will discuss these microservices in detail.

products-microservice

This microservice contains an Express.js server that handles /products/ requests. Admins can create, update, delete and get products using this server. Admins can also upload images of the products into an AWS S3 bucket using signed URLs. Some of the endpoints of this server is protected using JWT.

users-microservice

This microservice contains an Express.js server that handles /users/ requests. Users can create users and login using this server. The passwords of the users are hashed using bcrypt. Some of the endpoints of this server is protected using JWT.

orders-microservice

This microservice contains an Express.js server that handles /orders/ requests. Users can create and get orders using this server. The endpoints of this server is protected using JWT.

reverseproxy-microservice

This microservice contains an NGINX server that works as a reverse proxy. The frontend microservice interacts with this server, and the server forwards the request to the microservice that can fulfill it.