A curated collection of real-world enterprise architecture designs from 11+ years of experience as a Solution Architect and Tech Lead. These diagrams represent patterns used in production systems serving 145+ branches, thousands of users, and multiple industries.
- Retail Platform Architecture
- AI/ML Data Pipeline Architecture
- ERP + Hardware Integration Architecture
- Microservices Architecture Pattern
- Clean Architecture (.NET Core)
- TMS Geospatial Mobile Architecture
Stack: .NET Core ยท Angular ยท MariaDB ยท REST APIs ยท ZKTeco Biometrics
A real-time retail management platform serving 145+ branches across Pakistan. The architecture is built for high availability, offline resilience, and centralized reporting.
graph TB
subgraph HQ["๐ข Headquarters โ Central Hub"]
API["โ๏ธ .NET Core API Gateway"]
Auth["๐ Auth Service (JWT)"]
CentralDB[("๐๏ธ MariaDB โ Central DB")]
ReportEngine["๐ Reporting Engine"]
AdminPortal["๐ฅ๏ธ Angular Admin Portal"]
end
subgraph Branch["๐ช Branch Node (ร145)"]
BranchApp["๐ฅ๏ธ Branch POS App (.NET Core)"]
LocalDB[("๐พ Local SQLite/MariaDB")]
Biometric["๐๏ธ ZKTeco Biometric Gate"]
Printer["๐จ๏ธ Receipt Printer"]
end
subgraph Mobile["๐ฑ Mobile Layer"]
AndroidApp["๐ฑ Android App"]
iOSApp["๐ iOS App"]
end
AdminPortal --> LoadBalancer
LoadBalancer --> API
API --> Auth
API --> CentralDB
API --> ReportEngine
BranchApp -->|"Sync (scheduled)"| API
BranchApp --> LocalDB
BranchApp --> Biometric
AndroidApp --> API
iOSApp --> API
Key Design Decisions:
- ๐ Offline-first: Branch apps work without internet; sync when connection restored
- ๐ JWT Auth: Centralized authentication with branch-level role control
- ๐ Real-time reporting: HQ sees live data across all 145 branches
- ๐ก๏ธ Hardware integration: Biometric gates enforce attendance at branch level
Stack: Python ยท YOLO ยท LangChain ยท Ollama ยท VAPI ยท AWS Rekognition ยท FastAPI
flowchart TB
subgraph Input["๐ฅ Input Sources"]
CCTV["๐น CCTV Cameras"]
VoiceCall["๐ Voice Calls (VAPI)"]
DocUpload["๐ Documents / PDFs"]
APIReq["๐ REST API Requests"]
end
subgraph CV["๐๏ธ Computer Vision Layer"]
YOLOModel["๐ฏ YOLO v8 Model"]
FaceLiveness["๐ญ Face Liveness API"]
FrameProc["๐ Frame Processor (OpenCV)"]
end
subgraph LLM["๐ง LLM Layer"]
LangChain["โ๏ธ LangChain Orchestration"]
Ollama["๐ฆ Ollama (On-Premise LLM)"]
VAPIAssist["๐๏ธ VAPI AI Call Assistant"]
RAG["๐ RAG Pipeline"]
end
CCTV --> FrameProc --> YOLOModel
APIReq --> FaceLiveness
DocUpload --> RAG --> LangChain --> Ollama
VoiceCall --> VAPIAssist --> LangChain
| Component | Role |
|---|---|
| YOLO v8 | Uniform compliance detection, employee counting via CCTV |
| LangChain + Ollama | On-premise LLM for privacy-compliant document Q&A |
| VAPI | AI-powered voice call assistant for customer service |
| AWS Rekognition | Face liveness & identity verification |
Stack: ERPNext (Frappe) ยท Python ยท ZKTeco SDK ยท RS232/Modbus ยท Weighbridge ยท Geospatial PDF
graph LR
subgraph Hardware["๐ญ Hardware Layer"]
Biometric["๐๏ธ ZKTeco Biometric Gates"]
PlantGauge["๐ก๏ธ Plant Gauges (RS232)"]
Weighbridge["โ๏ธ Weighbridge (Modbus)"]
GPS["๐ GPS Trackers"]
end
subgraph Integration["๐ Integration Layer"]
ZKLib["๐ ZKTeco Python SDK"]
SerialReader["๐ก Serial Port Reader"]
ModbusClient["๐ง Modbus Client"]
GPSParser["๐บ๏ธ Geospatial PDF Parser"]
end
subgraph ERPNext["๐ฆ ERPNext / Frappe"]
CustomApps["๐งฉ Custom Frappe Apps"]
DocTypes["๐ Custom DocTypes"]
Hooks["๐ฃ Frappe Hooks"]
Scheduler["โฑ๏ธ Background Scheduler"]
end
Biometric --> ZKLib --> Hooks
PlantGauge --> SerialReader --> Scheduler
Weighbridge --> ModbusClient --> Scheduler
GPS --> GPSParser --> CustomApps
Scheduler --> DocTypes
Hooks --> DocTypes
Stack: .NET Core ยท Docker ยท REST/gRPC ยท API Gateway ยท Event Bus
graph TB
Client["๐ค Client Apps"] --> APIGW["โ๏ธ API Gateway"]
APIGW --> AuthSvc["๐ Auth Service (.NET Core)"]
APIGW --> UserSvc["๐ค User Service (.NET Core)"]
APIGW --> OrderSvc["๐ฆ Order Service (.NET Core)"]
AuthSvc --> AuthDB[("Auth DB")]
UserSvc --> UserDB[("User DB")]
OrderSvc --> OrderDB[("Order DB")]
OrderSvc -->|"OrderCreated event"| EventBus["๐ Event Bus"]
EventBus --> NotifSvc["๐ Notification Service"]
EventBus --> ReportSvc["๐ Report Service"]
graph TD
subgraph Domain["โญ Domain Layer"]
Entities["๐ Entities"]
IRepos["๐ Repository Interfaces"]
end
subgraph Application["๐ท Application Layer"]
Commands["๐ Commands (CQRS)"]
Queries["๐ Queries (CQRS)"]
Handlers["โ๏ธ MediatR Handlers"]
end
subgraph Infrastructure["๐ถ Infrastructure Layer"]
Repos["๐๏ธ Repository Impl."]
EFCore["๐พ EF Core DbContext"]
end
subgraph API["๐ API Layer"]
Controllers["๐ฎ Controllers"]
Middleware["๐ก๏ธ Middleware"]
end
API --> Application
Infrastructure --> Domain
Application --> Domain
API -.-> Infrastructure
| Layer | Responsibility | Key Libraries |
|---|---|---|
| Domain | Business rules, entities | Pure C# |
| Application | Use cases, CQRS | MediatR, FluentValidation |
| Infrastructure | DB, external services | EF Core, Dapper |
| API | HTTP, routing, auth | ASP.NET Core, JWT |
Stack: Python ยท Android/iOS ยท Geospatial PDF parsing ยท FastAPI
sequenceDiagram
participant PM as ๐ PDF Maps
participant Parser as ๐ PDF Parser
participant API as โ๏ธ FastAPI Server
participant DB as ๐๏ธ Spatial DB
participant App as ๐ฑ Mobile App
PM->>Parser: Upload geospatial PDF
Parser->>API: POST /maps/process
API->>DB: Store spatial data (GeoJSON)
App->>API: GET /routes/{id}
API->>App: Route + Map overlay
| Domain | Systems Built |
|---|---|
| ๐ Retail & Distribution | 145-branch POS platform (.NET Core + Angular + MariaDB) |
| ๐ญ Industrial/ERP | ERPNext with gauge, weighbridge & biometric hardware |
| ๐ค AI/ML | YOLO detection, LLM assistants, face liveness |
| ๐ก Telecom | Contractor at Huawei/Alkan CIT (PHP systems) |
| ๐ผ Finance/Leasing | Enterprise NetSol leasing platform (Oracle + SQL Server) |
๐ก Open to discussing architecture decisions, trade-offs, and enterprise system design.
Asad Mushtaq ยท Solution Architect & Tech Lead ยท Lahore, Pakistan