Skip to content

DenisSlapelis/order-production-service

Repository files navigation

order-production-service

Microservice to handle Order Productions, using Clean Architecture, TDD and BDD concepts and SonarCloud Integration.


Static Badge

Static Badge Static Badge Static Badge


Static Badge

Static Badge Static Badge


Static Badge

Static Badge


Static Badge

Static Badge Static Badge


Table of contents


OWASP ZAP Report

Our first report can be found here, and the latest with the corrections is here.

(Back to Table of contents ⬆️)


SAGA Pattern

We chose the choreography saga pattern because our business rule is not very complex and doesn't depend on a large number of microservices to be executed, we concluded that the choreography pattern would fit better for this situation. Another point is that since our group consists of only 3 people and we have exactly 3 microservices, it became easier to divide the work as well.

saga

(Back to Table of contents ⬆️)


RIPD

You can find our RIPD (Relatório de Impacto dos Dados Pessoais) here.

(Back to Table of contents ⬆️)


Usage Video

You can find an explanatory video playlist about how the entire application works here.

(Back to Table of contents ⬆️)


Customer Notification

We send SMS to customers as soon as the order starts to be prepared and also when the order is ready.

sms_1 sms_2

(Back to Table of contents ⬆️)


Envs

You must configure .env file following the .env.example template. Some envs come directly from the AWS Parameter Store, so it is very important to have configured the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY values ​​so that all application envs are loaded correctly.

(Back to Table of contents ⬆️)


Docker Prerequisites

To run this project with docker, ensure that you have the following items:

(Back to Table of contents ⬆️)


Docker Usage

Start the node server with the following commands:

docker compose build
docker compose up -d

(Back to Table of contents ⬆️)


Node Prerequisites

To run this project, ensure that you have the following items:

(Back to Table of contents ⬆️)


Node Installation

  1. Clone this repository to your local machine or download the source code.

  2. Open a terminal and navigate to the project's root directory.

  3. Run the following command to install the project dependencies:

    npm install

(Back to Table of contents ⬆️)


Node Usage

Start the node server in developer mode with the following command:

npm run start:dev

This will start the server and watch for any file changes, automatically restarting the server when necessary.

Or start in production mode with the following command:

npm run start

(Back to Table of contents ⬆️)


Tests

  • Run the following command to execute the project tests:

    npm run test

(Back to Table of contents ⬆️)


Endpoints rules

  • All endpoints can be found here.
  • Except healthcheck, all endpoints have the prefix /api followed by the route version, for example /api/v1/.
  • All endpoints require authorization, which can be passed through the Authorization header with a valid JWT token (this can be obtained by making a POST request on the login route with username and password).
  • The Authorization header is an Bearer Token.

(Back to Table of contents ⬆️)


Postman

(Back to Table of contents ⬆️)


Database

database

(Back to Table of contents ⬆️)


Integrations

integrations

(Back to Table of contents ⬆️)


Sonar

sonar sonar_2

(Back to Table of contents ⬆️)


Folder Structure

  • .github: github actions.
  • .vscode: vscode configs.
  • docs: all project documentations, like scripts, diagrams, texts.
  • src
    • config: generic project configurations, like database configs, commit configs.
      • database: database configs.
        • models: database models.
        • migrations: database migrations.
      • envs: local and async envs configs.
    • controllers: application controllers.
    • dtos: application dtos.
    • entities: application domain entities.
    • factories: application factories to be used on routes.
    • interfaces: application interfaces.
    • middlewares: application middlewares.
    • repositories: application repositories.
    • routes: application routes.
      • v1: v1 endpoints.
    • services: application services.
    • use-cases: application use cases that contain the entire business rule.
    • utils: common utils functions, constants, and application dependencies.
      • logger: logger module.
  • tests: project tests
    • bdd: bdd tests

(Back to Table of contents ⬆️)

About

Microservice to handle Order Productions.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published