System Architecture
System Architecture
Interactive diagram of the Primentra three-tier architecture. Hover any layer for details, simulate a request to trace the full data flow.
Every create/update/delete/import writes an AuditLog row with user, action, entity, and timestamp. Append-only. Viewable in Admin panel.
All server errors written simultaneously to errorlog.txt and the ErrorLog table. Queryable in Admin → Error Log.
Users → Roles → per-entity permissions (None/Read/Write/Moderator). Checked by the API layer before every write operation.
All request bodies validated at the API layer before touching the database. Invalid input returns HTTP 400 immediately.
Architecture Documentation
Expand any section for full technical details.
Primentra is a Master Data Service built on a classic three-tier architecture: a React/Vite frontend running in the browser, an Express API server running in Node.js, and a SQL Server database storing all master data.
The architecture follows a strict separation of concerns. The frontend handles user interaction and state. The API handles routing, authentication, and input validation. The database handles all business logic, data integrity, and transactions. Nothing leaks into the wrong tier.
This design makes each tier independently testable, deployable, and replaceable. It also means that business rules are enforced at the database level — not in the browser or the API — making them impossible to bypass through direct API calls.
| Layer | Technology | Port | Primary Responsibility |
|---|---|---|---|
| Frontend | React 18 + Vite 5 | 443 (prod) / 5173 (dev) | UI rendering, state management, API calls |
| Reverse Proxy | IIS 10 + ARR + URL Rewrite | 443 | TLS termination, /api routing, SPA fallback |
| API Server | Express 4 + Node.js 18+ | 3001 | Input validation, stored procedure dispatch |
| Database | SQL Server 2016+ | 1433 | Business logic, data integrity, auditing |
Key architectural constraint: All business logic lives exclusively in SQL Server stored procedures. The Express API is a thin validation and routing layer — it contains zero raw SQL and no business rules. This makes the system easier to audit, test, and secure.