How thuanbui2611/motormate-fe works
Main Components
• Client Web Application (React + TypeScript + Redux Toolkit)
• Admin-Panel Web Application (React + TypeScript + Redux Toolkit)
• Backend API (.NET Core 6.0 RESTful API, SignalR Hub)
• Database (PostgreSQL via Entity Framework Core)
• External Services:
– Cloudinary (image storage & CDN)
– Stripe (payment processing)
– Google Maps API (maps & geolocation)
– GeoLocation API (visitor location lookup)
• DevOps and Infrastructure:
– Azure Pipelines (CI/CD via azure-build-deploy.yml)
– Terraform scripts (infrastructure as code—Azure resources)
– GitHub (source repo, version control)
– Azure App Service or Azure Static Web Apps (hosting front-ends)
– Azure Container Registry / App Service (hosting backend)
Relationships & Data-Flows
– User’s browser ↔ HTTPS ↔ Client Web App & Admin Web App
– Web Apps ↔ HTTPS (REST calls) ↔ .NET Core API
– Web Apps ↔ WebSocket ↔ SignalR Hub (for real-time chat)
– API ↔ PostgreSQL (SQL queries via EF Core)
– API ↔ Cloudinary (upload/download images)
– API ↔ Stripe (payment intents, confirmations)
– Client Web App ↔ Google Maps API & GeoLocation API (direct calls from browser)
– DevOps pipelines ↔ GitHub (trigger on push) ↔ Azure infra (build → test → deploy)
Architectural Patterns & Principles
– Front-end: Single-Page Applications (SPA) with Redux for state management
– Back-end: Layered architecture (Controllers → Services → Repositories)
– Real-time: SignalR Hub follows pub/sub pattern for chat
– Infrastructure as Code: Terraform ensures idempotent resource provisioning
– CI/CD: Azure Pipelines for continuous integration and zero-downtime deployments
Diagramming Conventions
– Components: use rectangles with clear labels (e.g., “Client Web App”, “.NET Core API”)
• Blue for front-end components
• Green for back-end components
• Orange for external services
• Grey for DevOps/infrastructure
Essential Details to Capture
– Both front-ends share the same API agent.ts and models for consistency.
– The API uses EF Core migrations for DB schema.
– The real-time chat functionality is powered by SignalR—treat it as a separate sub-component.
– Payment integration includes both client-side (Stripe Elements) and server-side webhooks.
– DevOps: show the azure-build-deploy.yml file triggering builds on push and deploying via Terraform.