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.
- How start the project
- API Routes
- Methodologies and Designs
- Principles
- Design Patterns
- Libraries and Tools
- Docker Compose
- TODO
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 |
|||
---|---|---|---|
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 |
- TDD
- Clean Architecture
- Conventional Commits
- SOLID
- Small Commits
- Adapter
- Composite
- Dependency Injection
- Factory Method
- 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
-
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