This repository contains a demonstration API designed to showcase various backend engineering skills and practices. It highlights key aspects of Clean Architecture and SOLID principles, RESTful API design, and integration with modern tools and technologies.
- Domain Driven Design: The application is divided by domain independent modules, isolatig logic between them and allowing migrating to a microservice structure if required. User modules is already implemented, while account and transaction modules are in progress.
- Clean Architecture: The project adheres to Clean Architecture principles with a well-organized file structure.
- SOLID Principles: Classes and functions adhere to the Single Responsibility Principle. Dependency injection facilitates decoupling and enhances testability by injecting dependencies rather than importing them.
- Data Validation: Utilizes Data Transfer Objects (DTOs) and comprehensive error handling to validate and manage user input.
- Principles: The API design follows RESTful principles, ensuring clear and consistent endpoints.
- ORM: TypeORM is configured for MySQL for both production and development environments.
- Testing: A temporary SQLite instance is used for testing, populated with fixtures to allow real database interactions without mocking.
- Entities: Defines entities for User, Account, Transaction, and their relationships.
- Local Development: The application uses Docker to run the database locally.
- Cloud Deployment: Deploy the repository image in Render.com.
- Future Plans: Future plans include containerizing the application with Docker, using Docker Compose for deployment, and configuring separate setups for production and development.
- CI/CD: Scripts for system deployment and CI/CD processes will be added.
- AuthService: Implements user validation and JWT token generation.
- Role-based permissions: Protects routes in the controllers with user roles (Admin, Client) determining access permissions.
- End-to-End (E2E): Full E2E integration tests are implemented for every controller interface.
- Unit Testing: Comprehensive unit tests verify the functionality of individual services.
- Swagger: Swagger integration is planned to document API endpoints, including required and returned data.
- Real-Time Notifications: WebSockets will be added for real-time transaction notifications.
- Profile Pictures: Implementation of profile picture uploads for users.
- Transaction PDFs: Ability to download PDFs of transaction information.
- Logging Service: Planned addition of a logging service to track transactions and user activities.
- Redis: Use Redis for caching frequently accessed data, such as user information and account balances.
- Daily Jobs: Implementation of scheduled tasks to calculate interest on accounts.
- Request Throttling: Throttling of requests for sensitive operations, such as money transfers, to enhance performance and security.
- Transaction Logging: Development of a custom decorator for logging transactions.
$ npm install
Copy the .env.dist file to .env and modify it as needed.
$ docker compose up -d
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov