# gaudzispriyanshu/rmc-erp architecture

> Architecture diagram of the GitHub repository gaudzispriyanshu/rmc-erp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gaudzispriyanshu/rmc-erp
- Repository: https://github.com/gaudzispriyanshu/rmc-erp

## Overview

RMC ERP supports ready-mix concrete operations from order capture and mix recipes through production inventory consumption, dispatch, delivery, and quality control, with fleet and administration capabilities. Users work through a React application; the Express API routes requests to domain handlers and PostgreSQL-backed services. The graph combines README capability descriptions with shown calls and indexed references; several domain implementations and route-to-controller links were not excerpted, so those connections are omitted rather than inferred.

Main entry points: [`backend/src/server.ts`](https://github.com/gaudzispriyanshu/rmc-erp/blob/main/backend/src/server.ts) (Express API), [`frontend/src/App.tsx`](https://github.com/gaudzispriyanshu/rmc-erp/blob/main/frontend/src/App.tsx) (Application routing), [`backend/src/services/workflowService.ts`](https://github.com/gaudzispriyanshu/rmc-erp/blob/main/backend/src/services/workflowService.ts) (Workflow engine), [`backend/src/config/db.ts`](https://github.com/gaudzispriyanshu/rmc-erp/blob/main/backend/src/config/db.ts) (PostgreSQL)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["User application"]
  node_app["Application routing<br/>[App.tsx]"]
  node_authui["Authentication state<br/>[AuthContext.tsx]"]
  node_ordersui["Order management<br/>[Orders.tsx]"]
  node_createorder["Order capture<br/>[CreateOrder.tsx]"]
  node_dashboard["Operations dashboard<br/>[Dashboard.tsx]"]
  node_dispatchui["Dispatch board<br/>[Dispatch.tsx]"]
  node_tripsui["Trip tracking<br/>[Trips.tsx]"]
  node_mastersui["Operational masters"]
  node_qualityui["Quality testing<br/>[Quality.tsx]"]
  node_adminui["Workflow and roles"]
end

subgraph group_api["Backend API"]
  node_api["Express API<br/>[server.ts]"]
end

subgraph group_domain["Operations services"]
  node_authservice["Identity service<br/>[authService.ts]"]
  node_orderservice["Order service<br/>[orderService.ts]"]
  node_workflow["Workflow engine<br/>[workflowService.ts]"]
  node_tripservice["Trip service<br/>[tripService.ts]"]
  node_inventory["Inventory management"]
  node_quality["Quality control<br/>[qcService.ts]"]
  node_otherdomains["Master data and challans"]
end

subgraph group_data["Persistence"]
  node_postgres[("PostgreSQL<br/>[db.ts]")]
end

node_operator(("Operator"))

node_operator -->|"uses"| node_app
node_app -->|"provides auth"| node_authui
node_app -->|"routes to"| node_ordersui
node_app -->|"routes to"| node_createorder
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_tripsui
node_ordersui -->|"requests orders"| node_api
node_authui -->|"authenticates via"| node_api
node_api -->|"routes auth"| node_authservice
node_api -.->|"serves orders"| node_orderservice
node_api -.->|"serves trips"| node_tripservice
node_api -.->|"serves inventory"| node_inventory
node_api -.->|"serves quality"| node_quality
node_api -.->|"serves workflows"| node_workflow
node_api -.->|"serves other domains"| node_otherdomains
node_orderservice -->|"checks transitions"| node_workflow
node_tripservice -->|"checks transitions"| node_workflow
node_authservice -->|"queries"| node_postgres
node_orderservice -->|"queries"| node_postgres
node_tripservice -->|"queries"| node_postgres
node_workflow -->|"queries"| node_postgres

click node_app "https://github.com/gaudzispriyanshu/rmc-erp/blob/main/frontend/src/App.tsx"
click node_authui "https://github.com/gaudzispriyanshu/rmc-erp/blob/main/frontend/src/context/AuthContext.tsx"
click node_ordersui "https://github.com/gaudzispriyanshu/rmc-erp/blob/main/frontend/src/pages/operations/orders/Orders.tsx"
click node_createorder "https://github.com/gaudzispriyanshu/rmc-erp/blob/main/frontend/src/pages/operations/orders/CreateOrder.tsx"
click node_dashboard "https://github.com/gaudzispriyanshu/rmc-erp/blob/main/frontend/src/pages/operations/dashboard/Dashboard.tsx"
click node_dispatchui "https://github.com/gaudzispriyanshu/rmc-erp/blob/main/frontend/src/pages/operations/dispatch/Dispatch.tsx"
click node_tripsui "https://github.com/gaudzispriyanshu/rmc-erp/blob/main/frontend/src/pages/operations/trips/Trips.tsx"
click node_mastersui "https://github.com/gaudzispriyanshu/rmc-erp/tree/main/frontend/src/pages/masters"
click node_qualityui "https://github.com/gaudzispriyanshu/rmc-erp/blob/main/frontend/src/pages/quality/Quality.tsx"
click node_adminui "https://github.com/gaudzispriyanshu/rmc-erp/tree/main/frontend/src/pages/system/administartion"
click node_api "https://github.com/gaudzispriyanshu/rmc-erp/blob/main/backend/src/server.ts"
click node_authservice "https://github.com/gaudzispriyanshu/rmc-erp/blob/main/backend/src/services/authService.ts"
click node_orderservice "https://github.com/gaudzispriyanshu/rmc-erp/blob/main/backend/src/services/orderService.ts"
click node_workflow "https://github.com/gaudzispriyanshu/rmc-erp/blob/main/backend/src/services/workflowService.ts"
click node_tripservice "https://github.com/gaudzispriyanshu/rmc-erp/blob/main/backend/src/services/tripService.ts"
click node_inventory "https://github.com/gaudzispriyanshu/rmc-erp/blob/main/backend/src/services/inventoryService.ts"
click node_quality "https://github.com/gaudzispriyanshu/rmc-erp/blob/main/backend/src/services/qcService.ts"
click node_otherdomains "https://github.com/gaudzispriyanshu/rmc-erp/tree/main/backend/src/services"
click node_postgres "https://github.com/gaudzispriyanshu/rmc-erp/blob/main/backend/src/config/db.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_authui,node_ordersui,node_createorder,node_dashboard,node_dispatchui,node_tripsui,node_mastersui,node_qualityui,node_adminui toneBlue
class node_api toneAmber
class node_authservice,node_orderservice,node_workflow,node_tripservice,node_inventory,node_quality,node_otherdomains toneMint
class node_postgres toneRose
class node_operator toneIndigo
```

## Components

### User application

- [Application routing](https://github.com/gaudzispriyanshu/rmc-erp/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Authentication state](https://github.com/gaudzispriyanshu/rmc-erp/blob/main/frontend/src/context/AuthContext.tsx): `frontend/src/context/AuthContext.tsx`
- [Order management](https://github.com/gaudzispriyanshu/rmc-erp/blob/main/frontend/src/pages/operations/orders/Orders.tsx): `frontend/src/pages/operations/orders/Orders.tsx`
- [Order capture](https://github.com/gaudzispriyanshu/rmc-erp/blob/main/frontend/src/pages/operations/orders/CreateOrder.tsx): `frontend/src/pages/operations/orders/CreateOrder.tsx`
- [Operations dashboard](https://github.com/gaudzispriyanshu/rmc-erp/blob/main/frontend/src/pages/operations/dashboard/Dashboard.tsx): `frontend/src/pages/operations/dashboard/Dashboard.tsx`
- [Dispatch board](https://github.com/gaudzispriyanshu/rmc-erp/blob/main/frontend/src/pages/operations/dispatch/Dispatch.tsx): `frontend/src/pages/operations/dispatch/Dispatch.tsx`
- [Trip tracking](https://github.com/gaudzispriyanshu/rmc-erp/blob/main/frontend/src/pages/operations/trips/Trips.tsx): `frontend/src/pages/operations/trips/Trips.tsx`
- [Operational masters](https://github.com/gaudzispriyanshu/rmc-erp/tree/main/frontend/src/pages/masters): `frontend/src/pages/masters`
- [Quality testing](https://github.com/gaudzispriyanshu/rmc-erp/blob/main/frontend/src/pages/quality/Quality.tsx): `frontend/src/pages/quality/Quality.tsx`
- [Workflow and roles](https://github.com/gaudzispriyanshu/rmc-erp/tree/main/frontend/src/pages/system/administartion): `frontend/src/pages/system/administartion`

### Backend API

- [Express API](https://github.com/gaudzispriyanshu/rmc-erp/blob/main/backend/src/server.ts): `backend/src/server.ts`

### Operations services

- [Identity service](https://github.com/gaudzispriyanshu/rmc-erp/blob/main/backend/src/services/authService.ts): `backend/src/services/authService.ts`
- [Order service](https://github.com/gaudzispriyanshu/rmc-erp/blob/main/backend/src/services/orderService.ts): `backend/src/services/orderService.ts`
- [Workflow engine](https://github.com/gaudzispriyanshu/rmc-erp/blob/main/backend/src/services/workflowService.ts): `backend/src/services/workflowService.ts`
- [Trip service](https://github.com/gaudzispriyanshu/rmc-erp/blob/main/backend/src/services/tripService.ts): `backend/src/services/tripService.ts`
- [Inventory management](https://github.com/gaudzispriyanshu/rmc-erp/blob/main/backend/src/services/inventoryService.ts): `backend/src/services/inventoryService.ts`
- [Quality control](https://github.com/gaudzispriyanshu/rmc-erp/blob/main/backend/src/services/qcService.ts): `backend/src/services/qcService.ts`
- [Master data and challans](https://github.com/gaudzispriyanshu/rmc-erp/tree/main/backend/src/services): `backend/src/services`

### Persistence

- [PostgreSQL](https://github.com/gaudzispriyanshu/rmc-erp/blob/main/backend/src/config/db.ts): `backend/src/config/db.ts`

### Other components

- **Operator**

## Connections

- Operator → Application routing: uses (evidence: `frontend/src/App.tsx`)
- Application routing → Authentication state: provides auth (evidence: `frontend/src/App.tsx`)
- Application routing → Order management: routes to (evidence: `frontend/src/App.tsx`)
- Application routing → Order capture: routes to (evidence: `frontend/src/App.tsx`)
- Application routing → Operations dashboard: routes to (evidence: `frontend/src/App.tsx`)
- Application routing → Trip tracking: routes to (evidence: `frontend/src/App.tsx`)
- Order management → Express API: requests orders (evidence: `frontend/src/pages/operations/orders/Orders.tsx`)
- Authentication state → Express API: authenticates via (evidence: `frontend/src/context/AuthContext.tsx`)
- Express API → Identity service: routes auth
- Express API → Order service: serves orders
- Express API → Trip service: serves trips
- Express API → Inventory management: serves inventory
- Express API → Quality control: serves quality
- Express API → Workflow engine: serves workflows
- Express API → Master data and challans: serves other domains
- Order service → Workflow engine: checks transitions (evidence: `backend/src/services/orderService.ts`)
- Trip service → Workflow engine: checks transitions (evidence: `backend/src/services/tripService.ts`)
- Identity service → PostgreSQL: queries (evidence: `backend/src/services/authService.ts`)
- Order service → PostgreSQL: queries (evidence: `backend/src/services/orderService.ts`)
- Trip service → PostgreSQL: queries (evidence: `backend/src/services/tripService.ts`)
- Workflow engine → PostgreSQL: queries (evidence: `backend/src/services/workflowService.ts`)
