How tqthy/furniture-store-management-be works
Main Components
• Express.js Server: Represent the REST API server that coordinates all incoming requests.
• Middleware & Authentication: Include JWT-based authentication and any other middleware (as seen from JwtService.js).
• Controllers & Routes: List all controllers (e.g., ProductController.js, InvoiceController.js, etc.) and map them to their corresponding routes under the src/routes directory. This layer handles request parsing and delegates to services.
• Service Layer: Represent services (in the src/services folder) that implement business logic for products, inventory, customers, and orders.
• External Integrations: Highlight AWS S3 integration (as indicated in s3config.js) for file storage, and any integrations for payment processing (e.g., order-momo.js, order-vnpay.js).
• Testing: Note the inclusion of unit tests (Jest configuration and tests in src/__tests__) for quality control.
• From Routes, show directional calls to Controllers.
• Controllers should then indicate delegation to the Services layer.
• Services interact with the Models which in turn access the PostgreSQL database. Include directional flows (e.g., “create”, “read”, “update”, “delete” operations).
• External links:
– Payment routes (momo, vnpay) interacting with external payment services.
• Additionally, include the configuration folder for DB connections, S3 setup, and other initializations.
Architectural Patterns and Design Principles
• MVC/MVCS Pattern: The clear separation into routes, controllers, and services indicates an MVC-like architecture.
• Layered Architecture: Demonstrate how the application is divided into presentation (routes), business logic (controllers/services), and data access (models/migrations) layers.
• Modular Design: Notice the separation of concerns throughout the different directories.
Relevant Technologies
• Express.js as the backend framework.
• Sequelize as the ORM for PostgreSQL.
• JWT for authentication.
• Docker (via Dockerfile and docker-compose.yml) for containerization and deployment.
• AWS S3 for storage.
• GitHub Actions for CI/CD and Jest for unit testing.