# urrana1512/maruti-denim-erp architecture

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

- Interactive diagram: https://gitdiagram.com/urrana1512/maruti-denim-erp
- Repository: https://github.com/urrana1512/maruti-denim-erp

## Overview

Maruti Denim Gate Pass is an operations ERP for managing outgoing gate passes, recording material returns/inward receipts, maintaining item and vendor masters, and providing administration, dashboards, and reports. Staff enter and manage transactions through the routed client; its API client communicates with the Express API, which dispatches requests to domain controllers and persistence. The graph preserves those domain branches and reporting/export capabilities. Several client pages and backend subsystems are unsampled, so their internal calls are omitted; dashed links mark only unverified client-to-API usage.

Main entry points: [`client/src/App.jsx`](https://github.com/urrana1512/maruti-denim-erp/blob/main/client/src/App.jsx) (Client routes), [`client/src/services/api.js`](https://github.com/urrana1512/maruti-denim-erp/blob/main/client/src/services/api.js) (HTTP client), [`server/app.js`](https://github.com/urrana1512/maruti-denim-erp/blob/main/server/app.js) (Express API), [`server/controllers/masterDataController.js`](https://github.com/urrana1512/maruti-denim-erp/blob/main/server/controllers/masterDataController.js) (Master-data handling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Staff application"]
  node_app["Client routes<br/>[App.jsx]"]
  node_gateui["Gate-pass screens<br/>[ManageGatePass.jsx]"]
  node_inwardui["Inward screens<br/>[MaterialInward.jsx]"]
  node_dashui["Dashboard<br/>[DashboardPage.jsx]"]
  node_reportui["Reports<br/>[Reports.jsx]"]
  node_masterui["Master screens<br/>[ItemMasterPage.jsx]"]
  node_apiclient["HTTP client<br/>[api.js]"]
end

subgraph group_workflow["Gate-pass operations"]
  node_gateapi["Gate-pass API<br/>[gatePassRoutes.js]"]
  node_gatecontroller["Gate-pass handling"]
  node_gateops["Gate-pass rules<br/>[gatePassService.js]"]
  node_inwardapi["Inward API"]
  node_inwardcontroller["Inward handling"]
  node_inwardops["Inward rules"]
end

subgraph group_catalog["Masters and reporting"]
  node_masterapi["Master-data API"]
  node_mastercontroller["Master-data handling"]
  node_dashboard["Dashboard analytics"]
  node_reports["Report generation<br/>[reportService.js]"]
  node_excel["Excel export<br/>[excelService.js]"]
  node_pdf["PDF documents<br/>[pdfService.js]"]
end

subgraph group_server["API and authorization"]
  node_auth["Authentication<br/>[authMiddleware.js]"]
  node_api["Express API<br/>[app.js]"]
end

subgraph group_data["Operational data"]
  node_gatepasses[("Gate-pass records<br/>[GatePass.js]")]
  node_inwards[("Inward records<br/>[MaterialInward.js]")]
  node_masters[("Item and vendor masters<br/>[ItemMaster.js]")]
end

node_staff(("Staff"))

node_staff -->|"uses"| node_app
node_app -->|"routes to"| node_gateui
node_app -->|"routes to"| node_inwardui
node_app -->|"routes to"| node_dashui
node_app -->|"routes to"| node_masterui
node_app -->|"routes to"| node_reportui
node_gateui -.->|"requests data"| node_apiclient
node_inwardui -.->|"requests data"| node_apiclient
node_dashui -.->|"requests data"| node_apiclient
node_reportui -.->|"requests data"| node_apiclient
node_masterui -.->|"requests data"| node_apiclient
node_apiclient -.->|"sends requests"| node_api
node_api -->|"mounts"| node_gateapi
node_api -->|"mounts"| node_inwardapi
node_api -->|"mounts"| node_masterapi
node_gateapi -->|"dispatches"| node_gatecontroller
node_inwardapi -->|"dispatches"| node_inwardcontroller
node_masterapi -->|"dispatches"| node_mastercontroller
node_gatecontroller -->|"delegates to"| node_gateops
node_gatecontroller -->|"reads and updates"| node_gatepasses
node_inwardcontroller -->|"delegates to"| node_inwardops
node_inwardops -->|"reads"| node_gatepasses
node_inwardops -->|"reads and writes"| node_inwards
node_mastercontroller -->|"reads and writes"| node_masters
node_mastercontroller -->|"checks usage"| node_inwards
node_mastercontroller -->|"checks usage"| node_gatepasses
node_gateapi -->|"authenticates"| node_auth
node_inwardapi -->|"authenticates"| node_auth
node_masterapi -->|"optional auth"| node_auth
node_api -->|"serves analytics"| node_dashboard
node_reports -->|"generates workbook"| node_excel

click node_app "https://github.com/urrana1512/maruti-denim-erp/blob/main/client/src/App.jsx"
click node_gateui "https://github.com/urrana1512/maruti-denim-erp/blob/main/client/src/pages/GatePass/ManageGatePass.jsx"
click node_inwardui "https://github.com/urrana1512/maruti-denim-erp/blob/main/client/src/pages/MaterialInward/MaterialInward.jsx"
click node_dashui "https://github.com/urrana1512/maruti-denim-erp/blob/main/client/src/pages/Dashboard/DashboardPage.jsx"
click node_reportui "https://github.com/urrana1512/maruti-denim-erp/blob/main/client/src/pages/Reports/Reports.jsx"
click node_masterui "https://github.com/urrana1512/maruti-denim-erp/blob/main/client/src/pages/MasterData/ItemMasterPage.jsx"
click node_apiclient "https://github.com/urrana1512/maruti-denim-erp/blob/main/client/src/services/api.js"
click node_gateapi "https://github.com/urrana1512/maruti-denim-erp/blob/main/server/routes/gatePassRoutes.js"
click node_gatecontroller "https://github.com/urrana1512/maruti-denim-erp/blob/main/server/controllers/gatePassController.js"
click node_gateops "https://github.com/urrana1512/maruti-denim-erp/blob/main/server/services/gatePassService.js"
click node_inwardapi "https://github.com/urrana1512/maruti-denim-erp/blob/main/server/routes/materialInwardRoutes.js"
click node_inwardcontroller "https://github.com/urrana1512/maruti-denim-erp/blob/main/server/controllers/materialInwardController.js"
click node_inwardops "https://github.com/urrana1512/maruti-denim-erp/blob/main/server/services/materialInwardService.js"
click node_masterapi "https://github.com/urrana1512/maruti-denim-erp/blob/main/server/routes/masterDataRoutes.js"
click node_mastercontroller "https://github.com/urrana1512/maruti-denim-erp/blob/main/server/controllers/masterDataController.js"
click node_dashboard "https://github.com/urrana1512/maruti-denim-erp/blob/main/server/services/dashboardService.js"
click node_reports "https://github.com/urrana1512/maruti-denim-erp/blob/main/server/services/reportService.js"
click node_excel "https://github.com/urrana1512/maruti-denim-erp/blob/main/server/services/excelService.js"
click node_pdf "https://github.com/urrana1512/maruti-denim-erp/blob/main/server/services/pdfService.js"
click node_auth "https://github.com/urrana1512/maruti-denim-erp/blob/main/server/middleware/authMiddleware.js"
click node_api "https://github.com/urrana1512/maruti-denim-erp/blob/main/server/app.js"
click node_gatepasses "https://github.com/urrana1512/maruti-denim-erp/blob/main/server/models/GatePass.js"
click node_inwards "https://github.com/urrana1512/maruti-denim-erp/blob/main/server/models/MaterialInward.js"
click node_masters "https://github.com/urrana1512/maruti-denim-erp/blob/main/server/models/ItemMaster.js"

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_gateui,node_inwardui,node_dashui,node_reportui,node_masterui,node_apiclient toneBlue
class node_gateapi,node_gatecontroller,node_gateops,node_inwardapi,node_inwardcontroller,node_inwardops toneAmber
class node_masterapi,node_mastercontroller,node_dashboard,node_reports,node_excel,node_pdf toneMint
class node_auth,node_api toneRose
class node_gatepasses,node_inwards,node_masters,node_staff toneIndigo
```

## Components

### Staff application

- [Client routes](https://github.com/urrana1512/maruti-denim-erp/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Gate-pass screens](https://github.com/urrana1512/maruti-denim-erp/blob/main/client/src/pages/GatePass/ManageGatePass.jsx): `client/src/pages/GatePass/ManageGatePass.jsx`
- [Inward screens](https://github.com/urrana1512/maruti-denim-erp/blob/main/client/src/pages/MaterialInward/MaterialInward.jsx): `client/src/pages/MaterialInward/MaterialInward.jsx`
- [Dashboard](https://github.com/urrana1512/maruti-denim-erp/blob/main/client/src/pages/Dashboard/DashboardPage.jsx): `client/src/pages/Dashboard/DashboardPage.jsx`
- [Reports](https://github.com/urrana1512/maruti-denim-erp/blob/main/client/src/pages/Reports/Reports.jsx): `client/src/pages/Reports/Reports.jsx`
- [Master screens](https://github.com/urrana1512/maruti-denim-erp/blob/main/client/src/pages/MasterData/ItemMasterPage.jsx): `client/src/pages/MasterData/ItemMasterPage.jsx`
- [HTTP client](https://github.com/urrana1512/maruti-denim-erp/blob/main/client/src/services/api.js): `client/src/services/api.js`

### Gate-pass operations

- [Gate-pass API](https://github.com/urrana1512/maruti-denim-erp/blob/main/server/routes/gatePassRoutes.js): `server/routes/gatePassRoutes.js`
- [Gate-pass handling](https://github.com/urrana1512/maruti-denim-erp/blob/main/server/controllers/gatePassController.js): `server/controllers/gatePassController.js`
- [Gate-pass rules](https://github.com/urrana1512/maruti-denim-erp/blob/main/server/services/gatePassService.js): `server/services/gatePassService.js`
- [Inward API](https://github.com/urrana1512/maruti-denim-erp/blob/main/server/routes/materialInwardRoutes.js): `server/routes/materialInwardRoutes.js`
- [Inward handling](https://github.com/urrana1512/maruti-denim-erp/blob/main/server/controllers/materialInwardController.js): `server/controllers/materialInwardController.js`
- [Inward rules](https://github.com/urrana1512/maruti-denim-erp/blob/main/server/services/materialInwardService.js): `server/services/materialInwardService.js`

### Masters and reporting

- [Master-data API](https://github.com/urrana1512/maruti-denim-erp/blob/main/server/routes/masterDataRoutes.js): `server/routes/masterDataRoutes.js`
- [Master-data handling](https://github.com/urrana1512/maruti-denim-erp/blob/main/server/controllers/masterDataController.js): `server/controllers/masterDataController.js`
- [Dashboard analytics](https://github.com/urrana1512/maruti-denim-erp/blob/main/server/services/dashboardService.js): `server/services/dashboardService.js`
- [Report generation](https://github.com/urrana1512/maruti-denim-erp/blob/main/server/services/reportService.js): `server/services/reportService.js`
- [Excel export](https://github.com/urrana1512/maruti-denim-erp/blob/main/server/services/excelService.js): `server/services/excelService.js`
- [PDF documents](https://github.com/urrana1512/maruti-denim-erp/blob/main/server/services/pdfService.js): `server/services/pdfService.js`

### API and authorization

- [Authentication](https://github.com/urrana1512/maruti-denim-erp/blob/main/server/middleware/authMiddleware.js): `server/middleware/authMiddleware.js`
- [Express API](https://github.com/urrana1512/maruti-denim-erp/blob/main/server/app.js): `server/app.js`

### Operational data

- [Gate-pass records](https://github.com/urrana1512/maruti-denim-erp/blob/main/server/models/GatePass.js): `server/models/GatePass.js`
- [Inward records](https://github.com/urrana1512/maruti-denim-erp/blob/main/server/models/MaterialInward.js): `server/models/MaterialInward.js`
- [Item and vendor masters](https://github.com/urrana1512/maruti-denim-erp/blob/main/server/models/ItemMaster.js): `server/models/ItemMaster.js`

### Other components

- **Staff**

## Connections

- Staff → Client routes: uses (evidence: `client/src/App.jsx`)
- Client routes → Gate-pass screens: routes to (evidence: `client/src/App.jsx`)
- Client routes → Inward screens: routes to (evidence: `client/src/App.jsx`)
- Client routes → Dashboard: routes to (evidence: `client/src/App.jsx`)
- Client routes → Master screens: routes to (evidence: `client/src/App.jsx`)
- Client routes → Reports: routes to (evidence: `client/src/App.jsx`)
- Gate-pass screens → HTTP client: requests data
- Inward screens → HTTP client: requests data
- Dashboard → HTTP client: requests data
- Reports → HTTP client: requests data
- Master screens → HTTP client: requests data
- HTTP client → Express API: sends requests
- Express API → Gate-pass API: mounts (evidence: `server/app.js`)
- Express API → Inward API: mounts (evidence: `server/app.js`)
- Express API → Master-data API: mounts (evidence: `server/app.js`)
- Gate-pass API → Gate-pass handling: dispatches (evidence: `server/routes/gatePassRoutes.js`)
- Inward API → Inward handling: dispatches (evidence: `server/routes/materialInwardRoutes.js`)
- Master-data API → Master-data handling: dispatches (evidence: `server/routes/masterDataRoutes.js`)
- Gate-pass handling → Gate-pass rules: delegates to (evidence: `server/controllers/gatePassController.js`)
- Gate-pass handling → Gate-pass records: reads and updates
- Inward handling → Inward rules: delegates to (evidence: `server/services/materialInwardService.js`)
- Inward rules → Gate-pass records: reads (evidence: `server/services/materialInwardService.js`)
- Inward rules → Inward records: reads and writes (evidence: `server/services/materialInwardService.js`)
- Master-data handling → Item and vendor masters: reads and writes (evidence: `server/controllers/masterDataController.js`)
- Master-data handling → Inward records: checks usage (evidence: `server/controllers/masterDataController.js`)
- Master-data handling → Gate-pass records: checks usage (evidence: `server/controllers/masterDataController.js`)
- Gate-pass API → Authentication: authenticates (evidence: `server/routes/gatePassRoutes.js`)
- Inward API → Authentication: authenticates (evidence: `server/routes/materialInwardRoutes.js`)
- Master-data API → Authentication: optional auth (evidence: `server/routes/masterDataRoutes.js`)
- Express API → Dashboard analytics: serves analytics
- Report generation → Excel export: generates workbook (evidence: `server/controllers/reportController.js`)
