This is a Node.js application built using the NestJS framework, following clean architecture principles, SOLID principles, and the design pattern "Dependency Injection (DI)" to ensure maintainability and scalability.
Before running the application, ensure you have the following installed:
- Node.js (version 20.16.0)
- npm (version 10.8.1)
- MongoDB (Ensure MongoDB is running locally or use a remote connection)
1. Clone the repository:
git clone [email protected]:gardnor/singuTest.git
cd <repository-directory>
2. Install the dependencies:
npm install
3. Set up environment variables:
- Copy the .env.example file and rename it to .env.
- Update the MONGO_URI variable in the .env file with your MongoDB connection string (you can use mine, it is in .env.example).
1. Run in terminal
npm run start:dev
a. The application will run by default on http://localhost:3000.
After running the application, you can access the API documentation generated by Swagger at:
This documentation provides details on all available endpoints, request parameters, and response formats.
1. To run the tests, use the following commands:
npm run test
npm run test:e2e
npm run test:cov
- Controllers: Verify that the API endpoints respond correctly and handle requests as expected.
- Services: Test business logic to ensure that rules and processes are applied correctly.
- Repositories: Validate interactions with the database and confirm that data is persisted and retrieved correctly.
- Objective: Test the complete application flow to ensure that functionalities work correctly from start to finish, including interaction with the database and endpoint responses.
- Framework: Jest
- Test Environment: Node.js
- e2e Testing Tool: Supertest
- Author - Eduardo
Nest is MIT licensed.