Skip to content

eduardofranca1/clean-architecture-ts

Repository files navigation

Clean Architecture API

The objective of this project is to demonstrate how to build a flexible and testable project with a well-defined and decoupled architecture, separating the layers.

This API project is being created using Node.js, Typescript, and the Express Framework, following principles of the Clean Architecture, SOLID principles, TDD (Test-Driven Development), and Design Patterns.

Summary

How start the project

if you want to run the project in a development environment to test and debug, open two different terminals and follow these commands:

In first terminal:

npm run build:watch

In second terminal:

npm run debug

To start the server in production mode:

First run:

npm run build

Second run:

npm run start

Start the server using Docker:

To start the containers

- npm run docker:up

To stop the containers

npm run docker:down

Run tests:

npm run test

API Routes

/api
Method Route Description
POST /users create a new user
GET /users/:id get one user by id
GET /users get all users
PUT /users/:id update one user by id
DELETE /users/:id delete one user by id

Methodologies and Designs

  • TDD
  • Clean Architecture
  • Conventional Commits

Principles

  • SOLID
  • Small Commits

Design Patterns

  • Adapter
  • Composite
  • Dependency Injection
  • Factory Method

Libraries and Tools

Docker Compose

  • docker compose up -d: command to build the docker compose file
  • docker compose stop: command to stop the docker image
  • docker compose rm -fsv: command stop and remove all containers from your project

TODO

  • Create CRUD operations for "user"

    • CREATE
    • READ
      • FIND ALL USERS
      • FIND USER BY ID
    • UPDATE
    • DELETE
  • Request data validation

  • Docker compose

  • Integration Tests

  • Error handling

  • User sign-in with token

About

This project is being created following Clean Architecture principles

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published