# esdurgadevi/krrawmaterial architecture

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

- Interactive diagram: https://gitdiagram.com/esdurgadevi/krrawmaterial
- Repository: https://github.com/esdurgadevi/krrawmaterial

## Overview

This is a cotton, waste, process-stock, and spinning-quality management application: browser users work through protected admin screens and backend APIs to maintain masters, record operational transactions, and review reports. The backend is organized around Express route modules, controllers, services, and Sequelize models. The excerpts show the app mounting domain APIs, protected waste-packing and countwise-closing routes, and selected controller-to-service calls. Most page-to-API and unsampled module relationships are not shown, so those links are omitted rather than inferred.

Main entry points: [`backend(Sep2)/app.js`](https://github.com/esdurgadevi/krrawmaterial/blob/main/backend(Sep2)/app.js) (Express API), [`frontend(Sep2)/src/pages`](https://github.com/esdurgadevi/krrawmaterial/tree/main/frontend(Sep2)/src/pages) (Admin screens), [`backend(Sep2)/models/index.js`](https://github.com/esdurgadevi/krrawmaterial/blob/main/backend(Sep2)/models/index.js) (Model registry), [`backend(Sep2)/controllers/admin1/transaction-cotton`](https://github.com/esdurgadevi/krrawmaterial/tree/main/backend(Sep2)/controllers/admin1/transaction-cotton) (Cotton transactions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Admin interface"]
  node_web["Admin screens"]
  node_frontend_routes["Page routing<br/>[routes.jsx]"]
end

subgraph group_cotton["Cotton operations"]
  node_master["Master data"]
  node_cotton_tx["Cotton transactions"]
  node_cotton_reports["Cotton reports"]
end

subgraph group_waste["Waste and stock"]
  node_waste_tx["Waste transactions"]
  node_process_stock["Process stock"]
end

subgraph group_platform["Quality and platform"]
  node_api["Express API<br/>[app.js]"]
  node_qc["Spinning QC"]
  node_qc_reports["QC reports"]
  node_auth["Authentication<br/>[authService.js]"]
  node_controllers["Request controllers"]
  node_services["Domain services"]
  node_models["Model registry<br/>[index.js]"]
  node_database[("SQL database<br/>[db.js]")]
end

node_admin(("Admin user"))

node_admin -->|"uses screens"| node_web
node_frontend_routes -->|"routes pages"| node_web
node_web -.->|"sends requests"| node_api
node_api -->|"mounts APIs"| node_master
node_api -->|"mounts APIs"| node_cotton_tx
node_api -->|"mounts APIs"| node_waste_tx
node_api -->|"mounts APIs"| node_process_stock
node_api -->|"mounts APIs"| node_qc
node_api -->|"mounts auth"| node_auth
node_api -->|"mounts catalog"| node_cotton_reports
node_api -->|"mounts catalog"| node_qc_reports
node_api -->|"routes requests"| node_controllers
node_controllers -->|"delegates work"| node_services
node_auth -->|"queries users"| node_models
node_services -->|"uses models"| node_models
node_models -->|"uses connection"| node_database
node_api -.->|"initializes"| node_database
node_cotton_tx -.->|"supports reporting"| node_cotton_reports
node_qc -.->|"supports reporting"| node_qc_reports

click node_web "https://github.com/esdurgadevi/krrawmaterial/tree/main/frontend(Sep2)/src/pages"
click node_frontend_routes "https://github.com/esdurgadevi/krrawmaterial/blob/main/frontend(Sep2)/src/routes.jsx"
click node_api "https://github.com/esdurgadevi/krrawmaterial/blob/main/backend(Sep2)/app.js"
click node_master "https://github.com/esdurgadevi/krrawmaterial/tree/main/backend(Sep2)/controllers/admin1/master"
click node_cotton_tx "https://github.com/esdurgadevi/krrawmaterial/tree/main/backend(Sep2)/controllers/admin1/transaction-cotton"
click node_cotton_reports "https://github.com/esdurgadevi/krrawmaterial/tree/main/backend(Sep2)/services/reports"
click node_waste_tx "https://github.com/esdurgadevi/krrawmaterial/tree/main/backend(Sep2)/controllers/admin1/transaction-waste"
click node_process_stock "https://github.com/esdurgadevi/krrawmaterial/tree/main/backend(Sep2)/controllers/admin1/transaction-process-stock"
click node_qc "https://github.com/esdurgadevi/krrawmaterial/tree/main/backend(Sep2)/controllers/admin2/transaction-qc"
click node_qc_reports "https://github.com/esdurgadevi/krrawmaterial/tree/main/backend(Sep2)/services/admin2/reports"
click node_auth "https://github.com/esdurgadevi/krrawmaterial/blob/main/backend(Sep2)/services/auth/authService.js"
click node_controllers "https://github.com/esdurgadevi/krrawmaterial/tree/main/backend(Sep2)/controllers"
click node_services "https://github.com/esdurgadevi/krrawmaterial/tree/main/backend(Sep2)/services"
click node_models "https://github.com/esdurgadevi/krrawmaterial/blob/main/backend(Sep2)/models/index.js"
click node_database "https://github.com/esdurgadevi/krrawmaterial/blob/main/backend(Sep2)/config/db.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_web,node_frontend_routes,node_admin toneBlue
class node_master,node_cotton_tx,node_cotton_reports toneAmber
class node_waste_tx,node_process_stock toneMint
class node_api,node_qc,node_qc_reports,node_auth,node_controllers,node_services,node_models,node_database toneRose
```

## Components

### Admin interface

- [Admin screens](https://github.com/esdurgadevi/krrawmaterial/tree/main/frontend(Sep2)/src/pages): `frontend(Sep2)/src/pages`
- [Page routing](https://github.com/esdurgadevi/krrawmaterial/blob/main/frontend(Sep2)/src/routes.jsx): `frontend(Sep2)/src/routes.jsx`

### Cotton operations

- [Master data](https://github.com/esdurgadevi/krrawmaterial/tree/main/backend(Sep2)/controllers/admin1/master): `backend(Sep2)/controllers/admin1/master`
- [Cotton transactions](https://github.com/esdurgadevi/krrawmaterial/tree/main/backend(Sep2)/controllers/admin1/transaction-cotton): `backend(Sep2)/controllers/admin1/transaction-cotton`
- [Cotton reports](https://github.com/esdurgadevi/krrawmaterial/tree/main/backend(Sep2)/services/reports): `backend(Sep2)/services/reports`

### Waste and stock

- [Waste transactions](https://github.com/esdurgadevi/krrawmaterial/tree/main/backend(Sep2)/controllers/admin1/transaction-waste): `backend(Sep2)/controllers/admin1/transaction-waste`
- [Process stock](https://github.com/esdurgadevi/krrawmaterial/tree/main/backend(Sep2)/controllers/admin1/transaction-process-stock): `backend(Sep2)/controllers/admin1/transaction-process-stock`

### Quality and platform

- [Express API](https://github.com/esdurgadevi/krrawmaterial/blob/main/backend(Sep2)/app.js): `backend(Sep2)/app.js`
- [Spinning QC](https://github.com/esdurgadevi/krrawmaterial/tree/main/backend(Sep2)/controllers/admin2/transaction-qc): `backend(Sep2)/controllers/admin2/transaction-qc`
- [QC reports](https://github.com/esdurgadevi/krrawmaterial/tree/main/backend(Sep2)/services/admin2/reports): `backend(Sep2)/services/admin2/reports`
- [Authentication](https://github.com/esdurgadevi/krrawmaterial/blob/main/backend(Sep2)/services/auth/authService.js): `backend(Sep2)/services/auth/authService.js`
- [Request controllers](https://github.com/esdurgadevi/krrawmaterial/tree/main/backend(Sep2)/controllers): `backend(Sep2)/controllers`
- [Domain services](https://github.com/esdurgadevi/krrawmaterial/tree/main/backend(Sep2)/services): `backend(Sep2)/services`
- [Model registry](https://github.com/esdurgadevi/krrawmaterial/blob/main/backend(Sep2)/models/index.js): `backend(Sep2)/models/index.js`
- [SQL database](https://github.com/esdurgadevi/krrawmaterial/blob/main/backend(Sep2)/config/db.js): `backend(Sep2)/config/db.js`

### Other components

- **Admin user**

## Connections

- Admin user → Admin screens: uses screens
- Page routing → Admin screens: routes pages (evidence: `frontend(Sep2)/src/routes.jsx`)
- Admin screens → Express API: sends requests
- Express API → Master data: mounts APIs (evidence: `backend(Sep2)/app.js`)
- Express API → Cotton transactions: mounts APIs (evidence: `backend(Sep2)/app.js`)
- Express API → Waste transactions: mounts APIs (evidence: `backend(Sep2)/app.js`)
- Express API → Process stock: mounts APIs (evidence: `backend(Sep2)/app.js`)
- Express API → Spinning QC: mounts APIs (evidence: `backend(Sep2)/app.js`)
- Express API → Authentication: mounts auth (evidence: `backend(Sep2)/app.js`)
- Express API → Cotton reports: mounts catalog (evidence: `backend(Sep2)/app.js`)
- Express API → QC reports: mounts catalog (evidence: `backend(Sep2)/app.js`)
- Express API → Request controllers: routes requests (evidence: `backend(Sep2)/app.js`)
- Request controllers → Domain services: delegates work (evidence: `backend(Sep2)/controllers/admin1/transaction-waste/wastePackingController.js`)
- Authentication → Model registry: queries users (evidence: `backend(Sep2)/services/auth/authService.js`)
- Domain services → Model registry: uses models (evidence: `backend(Sep2)/services/admin1/transaction-cotton/inwardLotService.js`)
- Model registry → SQL database: uses connection (evidence: `backend(Sep2)/models/index.js`)
- Express API → SQL database: initializes
- Cotton transactions → Cotton reports: supports reporting
- Spinning QC → QC reports: supports reporting
