How quanghiep03198/be-wms works
Project Type and Purpose
• This is a RESTful API project built with NestJS.
• It is designed to manage warehouse operations such as product and inventory management, order processing, warehouse zones, and reporting.
• It uses SQL Server (via TypeORM) as the primary database and Redis for caching. Authentication (e.g., JWT-based) and third-party integrations further extend its functionality.
• Internationalization (i18n) support and modular design for various warehouse-related operations are evident.
Main Components
• API Gateway/Entry Point:
– Represented by NestJS components such as controllers, modules, and main.ts.
• Modules (Domain-Specific):
– Authentication Module: Handles user login, JWT strategies, and guards.
– Order Module: Manages order processing with both current and legacy (deprecated) components.
– Inventory/Database Module: Contains migration, seeds, and data-source management.
– Warehousing Module: Deals with warehouses, storage locations, and zone management.
– RFID Module: Processes RFID interactions and custom SQL queries.
– Report Module: Manages reporting services including inventory, outbound/inbound, and packing reports.
– Additional modules for third-party API integration, packing, user management, and tenancy.
• Cross-Cutting Concerns:
– Common utilities (helpers, filters, interceptors, pipes, decorators) that cover logging, error-handling, authentication, and data transformation.
– Internationalization (i18n) directories and generated files.
• Infrastructure Components:
– Database (SQL Server) and TypeORM for ORM/transactions.
– Redis for caching and fast data retrieval.
– Docker and Docker Compose for containerized deployment.
– CI/CD configuration through GitHub workflows.
– Monitoring tools such as SonarQube and Sentry.
Mapping Relationships and Interactions
• Client Interaction:
– Clients send HTTP requests to the REST API endpoints (exposed via controllers).
• Application Services:
– Controllers call service classes within each module. Services use dependency injection to interact with databases, caching, and external APIs.
• Database and Caching Layers:
– Services interact with the SQL Server database through TypeORM (database.module.ts, migrations, seeders).
• External Dependencies & Interceptors:
– Show external integrations such as third-party APIs used by the Third-Party API module.
– Include auxiliary components such as logging services, job schedulers (jobs directory), and internationalization files.
Highlighting Architectural Patterns and Technologies
• Modular & Layered Architecture:
• Dependency Injection & Separation of Concerns:
– Emphasize how modules keep responsibilities separated (e.g., authentication, order processing, RFID).
• Use of Cross-Cutting Concerns:
– Indicate where interceptors, filters, and pipes help in processing requests/responses.
• Technologies to Include:
– NestJS, TypeScript for the code base.
– SQL Server with TypeORM for the database layer.
– Redis for caching.
– Docker for containerization.
– CI/CD pipelines via GitHub Actions.