|
10 | 10 |
|
11 | 11 | ## Stack |
12 | 12 | - **Node.js** (Express.js) for the REST API |
13 | | -- **MongoDB** (native driver) for persistence |
| 13 | +- **MongoDB** (MongoClient) for persistence |
14 | 14 | - **Jest** & **Supertest** for unit and integration testing |
15 | 15 | - **ESLint** & **Prettier** for linting and formatting |
16 | 16 | - **Docker** & **Docker Compose** for containerization |
|
22 | 22 | - **Testability:** Business logic can be tested in isolation by injecting dependencies (e.g., mock DB handlers) from above. No real database is needed for unit tests. |
23 | 23 | - **Security & Flexibility:** Infrastructure (DB, frameworks) can be swapped without touching business logic. |
24 | 24 |
|
| 25 | +> **✨ Ultimate Flexibility:** |
| 26 | +> This project demonstrates that your core business logic is never tied to any specific framework, ORM, or database. You can switch from Express to Fastify, MongoDB to PostgreSQL, or even move to a serverless environment—without rewriting your business rules. The architecture ensures your codebase adapts easily to new technologies, making future migrations and upgrades painless. This is true Clean Architecture in action: your app’s heart beats independently of any tool or vendor. |
| 27 | +
|
25 | 28 | ## How Testing Works |
26 | 29 | - **Unit tests** inject mocks for all dependencies (DB, loggers, etc.) into use cases and controllers. This means you can test all business logic without a real database or server. |
27 | 30 | - **Integration tests** can use a real or in-memory database, but the architecture allows you to swap these easily. |
@@ -91,6 +94,9 @@ See the `routes/` directory for all endpoints. Example: |
91 | 94 | - **Output Model** (e.g., `User`, `Product`, `Blog`): What the API returns. Includes all fields, including those generated by the server (e.g., `_id`, `role`, etc.). |
92 | 95 | - This separation improves security, clarity, and validation. |
93 | 96 | - You can view and try all models in the "Schemas" section of Swagger UI. |
| 97 | +- check at http://localhost:5000/api-docs. /* (:5000 depend on you chosen port) */ |
| 98 | + |
| 99 | + |
94 | 100 |
|
95 | 101 | ## Testing |
96 | 102 | - **Unit tests** (Jest): Test business logic in isolation by injecting mocks for all dependencies. No real DB required. |
|
0 commit comments