How bisiolayemi/finpay works
Main System Components
• NestJS Server Setup: Represent the application’s entry point (src/main.ts) that bootstraps the application.
• Modules: Each module in src/modules (accounts, auth, deposits, invoices, payments, transactions, users, virtual-cards, withdrawals) should be depicted as an independent component. This establishes the modular architecture that encapsulates its controllers, services, and data entities.
• Common Infrastructure: Include components for common utilities like authentication (auth strategies, guards), exception handling (HTTP exception filters), logging interceptors, and decorators—all used across modules.
• Configuration: A separate component/block representing configuration settings (JWT, database, environment, Swagger, validation) found in src/config.
• External Services and Gateways: Highlight external integrations like the Stripe payment gateway (located in src/modules/payments/gateways/stripe.gateway.ts) which connects the internal system with external payment processing.
Relationships and Interactions
• Controller-Service Communication: Illustrate that controllers pass client requests to the corresponding service layer within each module.
• Service Persistence: Represent how services interact with data entities and the database (configured via src/config/database.config.ts) to persist or retrieve information.
• Cross-Cutting Concerns: Show that requests can be intercepted by guards (authentication/authorization), filters (global error handling), and interceptors (logging) defined in the “common” directory.
• External API Communications: For modules that rely on external services (like the payments module using a Stripe gateway), indicate the connection to external APIs.
• Configuration Management: Indicate that configuration settings (from src/config) are “injected” into various modules for uniform behavior and environment handling.
Architectural Patterns and Design Principles
• Modularity: Emphasize the modular nature that allows each feature to be developed, maintained, and replaced independently.
Relevant Technologies and Framework-Specific Elements
• NestJS Framework: Clearly state that the application is built on NestJS.
• TypeScript: As this project is written in TypeScript (as evidenced by the tsconfig files), note that this typing system helps maintain code quality.
• Testing Infrastructure: Optionally represent the existence of unit and end-to-end tests (under the test directory) to indicate robust testing practices.
• Tools/Libraries: Mention supporting libraries and configurations such as ESLint, Prettier, Swagger (for API docs), and authentication strategies (JWT & local).