Authentication.API is an API based on SOLID, built using Domain Driven Design (DDD), and Clean Architecture. The purpose of this API is to provide functionalities for user registration, login, and authentication, as well as authentication for requests between applications.
- User registration: Allows the registration of new users in the application.
- User login: Enables authenticated users to log in to the application.
- User authentication and permissioning: Provides mechanisms to authenticate and authorize users.
- Authentication for requests between applications: Allows authentication and validation of the integrity of requests sent by other applications.
- Programming language: Typescript
- Node.js
- Test Driven Development (TDD): Development approach that prioritizes creating tests before implementing the code (for more details, read https://tddmanifesto.com).
- SOLID: Object-oriented programming principles for building clean and maintainable code.
- Domain Driven Design (DDD): Software development methodology that aligns code with the business domain.
- Clean Architecture: Software architecture that separates concerns into layers, facilitating code maintenance and testing.
- Database: MongoDB was used due to the need for storing records that will not be frequently modified.
- Have Node.js in your development environment.
- Use the package manager npm to install project dependencies.
npm install
In the project directory, you can run the following scripts:
Starts the API in production mode.
Open http://localhost:3000 to view it in the browser.
Builds the project.
Removes the dist
directory and compiles the Typescript code.
Starts the API in Debug mode using nodemon.
Watches the dist
folder for any changes and enables debug on port 9222.
Builds the project and starts the API using docker-compose.
Runs the containers in detach mode.
Stops the API containers using docker-compose.
Runs all unit tests.
The tests are executed silently without detailed output. The tests run sequentially.
If there are no tests, it exits with a success message.
Runs unit tests with detailed output.
The tests are executed sequentially.
Runs unit tests in watch mode.
The tests are executed interactively, watching for any changes in files to rerun the tests.
Runs integration tests in watch mode.
The tests are executed interactively, watching for any changes in files to rerun the tests.
Runs tests related to modified files staged for commit.
The tests are executed in watch mode.
Runs CI tests.
The tests are executed with code coverage.