How minsoeaung/nexus-pos works
Project Type and Purpose
• Nexus POS is a full-stack, monolithic Point-of-Sale system.
• Frontend: ReactJS SPA (Ant Design, React Query, React Router).
• Backend: ASP.NET Core 8.0 Web API with Entity Framework Core and Microsoft Identity.
• Database: PostgreSQL.
• External service: SMTP (Gmail) for email.
Top-Level Components
a. Client/User Interface Container
• Browser running React app (served via npm run dev or Nginx in Docker).
b. API Server Container
• ASP.NET Core Web API (Controllers → Services → EF Core Data Access).
c. Database Container
• PostgreSQL instance (connection string configured via appsettings.json or user secrets).
d. External Email Service
• SMTP endpoint (Gmail) for password resets, email confirmations.
e. (Optional) Reverse Proxy / Load Balancer
• Nginx (configured in Frontend/nginx.conf) if deployed via Docker.
Relationships and Data Flows
• User → React UI: navigates pages and invokes actions.
• React UI → Web API: HTTP(S) calls via apiClient.ts (authenticated with JWT tokens stored in localStorage).
• Web API → PostgreSQL: CRUD operations through EF Core’s StoreContext.
• Web API → SMTP Server: outgoing email via EmailSender service.
• Database migrations and seeders run on startup (StoreContext, Seeders).
• Identity flows (login, refresh tokens, password resets) via Microsoft Identity endpoints.
Important Architectural Patterns & Layers
• Layered Monolith:
• Presentation Layer (API Controllers)
• Business Layer (Services, Middlewares, Request Helpers)
• Data Layer (EF Core Entities, Migrations, Context)
• DTO/Mapping Layer (Mapster mappings)
• JWT-based stateless authentication with refresh tokens.
• Middleware pipeline (e.g., SuspendCheckMiddleware, global error handling).
• React Query for client-side data caching and synchronization.
Showing Dependencies & Data Flow
• If using Docker Compose: group Frontend, Backend, DB under one “Docker Network.”