How fjyktec/modernwms works
Main System Components
• Frontend Application: This is the Vue 3 app under the “frontend” directory. It handles user interactions, communicates via API calls to the backend, and renders views for various modules (e.g., customer, stock, warehouse, delivery management, etc.).
• Backend API Server: Located in the “backend” directory, there are two major projects:
– The “ModernWMS.Core” project appears to implement the core services, controllers, models, middleware (global exception handling, CORS, request/response modification, etc.), JWT authentication, dependency injection, and multi‑tenancy.
– The “ModernWMS.WMS” project contains further detailed implementations (controllers, service implementations, entity and view model classes, and interface definitions) for the business logic related to warehouse management.
– A separate “ModernWMS” project functions as the application entry point where the Startup class, Program.cs, and configuration files reside.
• Database: Although not explicitly detailed (wms.db appears in the file tree, likely an SQLite or similar file for demo purposes), the DBContext components indicate that the project works with one or more relational databases (MySQL, SQL Server, PostgreSQL).
• Infrastructure Components: Docker configurations, Nginx reverse proxy (files in the “docker” folder), and configuration files (such as nlog.config) that handle cross‑cutting concerns like logging.
• Third‑Party and External Services: Authentication (JWT related components using custom TokenManager and caching), API response handling, and support for QR code functionalities. The README badges also indicate support for multiple databases and i18n.
Relationships and Communication Flow
• Within the Backend, the Controllers (in both ModernWMS.Core/Controller and ModernWMS.WMS/Controllers directories) receive HTTP requests, forward them to the corresponding Services, and leverage the Dependency Injection container to resolve required dependencies.
• The Services implement business logic and interact with the Data Access Layer (DBContext classes) to perform CRUD operations on the Database.
• Middleware components (error handling, logging, CORS, and JWT handling) are applied globally to modify or secure incoming requests and outgoing responses.
• The Frontend also handles build tasks and static asset production using Vite and runs through NodeJS/yarn.
Architectural Patterns and Design Principles
• Layered Architecture: The separation into Controllers, Services, and Data Access Layers for the backend.
• Dependency Injection: Evidenced by the DI folder and interfaces.
• Micro‑service or Modular Monolith: Although this project is monolithic, the clear separation between “Core” and “WMS” portions suggests a modular architecture that could be eventually split into microservices.
• RESTful API design: Controllers serve resources to the front-end via standardized endpoints.
• Separation of Concerns: Clear separation between presentation logic (frontend components), business logic (backend services), and data access (DBContexts).
• Cross‑cutting concerns: Authentication (JWT), logging (nlog), and exception handling (middleware).