# sharmipit/buksupply architecture

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

- Interactive diagram: https://gitdiagram.com/sharmipit/buksupply
- Repository: https://github.com/sharmipit/buksupply

## Overview

BukSUPPLY is a university supply-office platform. Requesters browse stock, submit requisitions, and track decisions; moderators review requests, adjust inventory, and issue slips; administrators manage users, settings, and audit activity. The React portals call an Express API backed by MongoDB, with reporting, notifications, feedback, and external-service integrations as supporting capabilities. The map uses README-described behavior and the supplied excerpts/index; some subsystem links are documented rather than verified in unsampled implementation files.

Main entry points: [`frontend/src/App.jsx`](https://github.com/sharmipit/buksupply/blob/main/frontend/src/App.jsx) (Role-based portals), [`backend/controllers/reportController.js`](https://github.com/sharmipit/buksupply/blob/main/backend/controllers/reportController.js) (Reports and issuance documents), [`backend/controllers/requisitionController.js`](https://github.com/sharmipit/buksupply/blob/main/backend/controllers/requisitionController.js) (Requisition workflow), [`frontend/src/api/client.js`](https://github.com/sharmipit/buksupply/blob/main/frontend/src/api/client.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_spa["Role-based portals<br/>[App.jsx]"]
  node_auth_ui["Sign-in and signup<br/>[Signin.jsx]"]
  node_client["API client<br/>[client.js]"]
  node_user_ui["Requester pages<br/>[ItemRequest.jsx]"]
  node_inventory_ui["Inventory views<br/>[Inventory.jsx]"]
  node_request_ui["Request review<br/>[Requests.jsx]"]
  node_moderator_ui["Moderator dashboard<br/>[Dashboard.jsx]"]
  node_admin_ui["Admin portal<br/>[Dashboard.jsx]"]
end

subgraph group_api["API and identity"]
  node_server["Express API<br/>[server.js]"]
  node_auth_routes["Authentication routes<br/>[authRoutes.js]"]
  node_auth["Authentication and RBAC<br/>[authController.js]"]
  node_auth_guard["Request authorization<br/>[auth.js]"]
end

subgraph group_operations["Supply operations"]
  node_requisitions["Requisition workflow"]
  node_inventory["Inventory management"]
  node_stock["Stock calculations<br/>[stock.js]"]
  node_models[("Supply and user records")]
end

subgraph group_support["Administration and integrations"]
  node_reports["Reports and issuance documents"]
  node_report_files["Document generation<br/>[reportFiles.js]"]
  node_audit["Activity auditing<br/>[activityLog.js]"]
  node_admin_users["Account administration"]
  node_settings[("System settings<br/>[settings.js]")]
  node_feedback["Feedback and forms<br/>[feedback.js]"]
end

node_requester(("Requester"))
node_staff(("Moderator and admin"))
node_drive["Google Drive"]
node_email["Email service"]
node_mongo[("MongoDB")]

node_requester -->|"uses"| node_spa
node_staff -->|"uses"| node_spa
node_spa -->|"routes to"| node_auth_ui
node_spa -->|"routes to"| node_user_ui
node_spa -->|"routes to"| node_inventory_ui
node_spa -->|"routes to"| node_request_ui
node_spa -->|"routes to"| node_moderator_ui
node_spa -->|"routes to"| node_admin_ui
node_auth_ui -.->|"calls"| node_client
node_user_ui -.->|"calls"| node_client
node_inventory_ui -.->|"calls"| node_client
node_request_ui -.->|"calls"| node_client
node_client -->|"calls API"| node_server
node_server -->|"mounts"| node_auth_routes
node_auth_routes -->|"dispatches"| node_auth
node_auth_routes -->|"uses"| node_auth_guard
node_server -->|"connects"| node_mongo
node_staff -->|"reviews"| node_requisitions
node_requester -->|"submits requests"| node_requisitions
node_requisitions -->|"adjusts stock"| node_stock
node_inventory -->|"uses calculations"| node_stock
node_requisitions -->|"reads and writes"| node_models
node_inventory -->|"reads and writes"| node_models
node_auth -->|"reads and writes"| node_models
node_reports -->|"generates exports"| node_report_files
node_reports -->|"archives reports"| node_drive
node_reports -->|"reads report data"| node_models
node_staff -->|"requests reports"| node_reports
node_requisitions -->|"records activity"| node_audit
node_admin_users -->|"records activity"| node_audit
node_admin_users -->|"manages accounts"| node_models
node_staff -->|"manages users"| node_admin_users
node_auth -->|"sends codes"| node_email
node_auth -->|"reads configuration"| node_settings
node_reports -.->|"syncs feedback"| node_feedback
node_staff -->|"configures integrations"| node_settings

click node_spa "https://github.com/sharmipit/buksupply/blob/main/frontend/src/App.jsx"
click node_auth_ui "https://github.com/sharmipit/buksupply/blob/main/frontend/src/pages/Signin.jsx"
click node_client "https://github.com/sharmipit/buksupply/blob/main/frontend/src/api/client.js"
click node_user_ui "https://github.com/sharmipit/buksupply/blob/main/frontend/src/pages/user/ItemRequest.jsx"
click node_inventory_ui "https://github.com/sharmipit/buksupply/blob/main/frontend/src/pages/Inventory.jsx"
click node_request_ui "https://github.com/sharmipit/buksupply/blob/main/frontend/src/pages/Requests.jsx"
click node_moderator_ui "https://github.com/sharmipit/buksupply/blob/main/frontend/src/pages/moderator/Dashboard.jsx"
click node_admin_ui "https://github.com/sharmipit/buksupply/blob/main/frontend/src/pages/admin/Dashboard.jsx"
click node_server "https://github.com/sharmipit/buksupply/blob/main/backend/server.js"
click node_auth_routes "https://github.com/sharmipit/buksupply/blob/main/backend/routes/authRoutes.js"
click node_auth "https://github.com/sharmipit/buksupply/blob/main/backend/controllers/authController.js"
click node_auth_guard "https://github.com/sharmipit/buksupply/blob/main/backend/middleware/auth.js"
click node_requisitions "https://github.com/sharmipit/buksupply/blob/main/backend/controllers/requisitionController.js"
click node_inventory "https://github.com/sharmipit/buksupply/blob/main/backend/controllers/inventoryController.js"
click node_stock "https://github.com/sharmipit/buksupply/blob/main/backend/services/stock.js"
click node_models "https://github.com/sharmipit/buksupply/tree/main/backend/models"
click node_reports "https://github.com/sharmipit/buksupply/blob/main/backend/controllers/reportController.js"
click node_report_files "https://github.com/sharmipit/buksupply/blob/main/backend/services/reportFiles.js"
click node_audit "https://github.com/sharmipit/buksupply/blob/main/backend/services/activityLog.js"
click node_admin_users "https://github.com/sharmipit/buksupply/blob/main/backend/controllers/adminUserController.js"
click node_settings "https://github.com/sharmipit/buksupply/blob/main/backend/services/settings.js"
click node_feedback "https://github.com/sharmipit/buksupply/blob/main/backend/services/feedback.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_spa,node_auth_ui,node_client,node_user_ui,node_inventory_ui,node_request_ui,node_moderator_ui,node_admin_ui toneBlue
class node_server,node_auth_routes,node_auth,node_auth_guard,node_mongo toneAmber
class node_requisitions,node_inventory,node_stock,node_models,node_requester toneMint
class node_reports,node_report_files,node_audit,node_admin_users,node_settings,node_feedback toneRose
class node_staff,node_drive,node_email toneIndigo
```

## Components

### Web application

- [Role-based portals](https://github.com/sharmipit/buksupply/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Sign-in and signup](https://github.com/sharmipit/buksupply/blob/main/frontend/src/pages/Signin.jsx): `frontend/src/pages/Signin.jsx`
- [API client](https://github.com/sharmipit/buksupply/blob/main/frontend/src/api/client.js): `frontend/src/api/client.js`
- [Requester pages](https://github.com/sharmipit/buksupply/blob/main/frontend/src/pages/user/ItemRequest.jsx): `frontend/src/pages/user/ItemRequest.jsx`
- [Inventory views](https://github.com/sharmipit/buksupply/blob/main/frontend/src/pages/Inventory.jsx): `frontend/src/pages/Inventory.jsx`
- [Request review](https://github.com/sharmipit/buksupply/blob/main/frontend/src/pages/Requests.jsx): `frontend/src/pages/Requests.jsx`
- [Moderator dashboard](https://github.com/sharmipit/buksupply/blob/main/frontend/src/pages/moderator/Dashboard.jsx): `frontend/src/pages/moderator/Dashboard.jsx`
- [Admin portal](https://github.com/sharmipit/buksupply/blob/main/frontend/src/pages/admin/Dashboard.jsx): `frontend/src/pages/admin/Dashboard.jsx`

### API and identity

- [Express API](https://github.com/sharmipit/buksupply/blob/main/backend/server.js): `backend/server.js`
- [Authentication routes](https://github.com/sharmipit/buksupply/blob/main/backend/routes/authRoutes.js): `backend/routes/authRoutes.js`
- [Authentication and RBAC](https://github.com/sharmipit/buksupply/blob/main/backend/controllers/authController.js): `backend/controllers/authController.js`
- [Request authorization](https://github.com/sharmipit/buksupply/blob/main/backend/middleware/auth.js): `backend/middleware/auth.js`

### Supply operations

- [Requisition workflow](https://github.com/sharmipit/buksupply/blob/main/backend/controllers/requisitionController.js): `backend/controllers/requisitionController.js`
- [Inventory management](https://github.com/sharmipit/buksupply/blob/main/backend/controllers/inventoryController.js): `backend/controllers/inventoryController.js`
- [Stock calculations](https://github.com/sharmipit/buksupply/blob/main/backend/services/stock.js): `backend/services/stock.js`
- [Supply and user records](https://github.com/sharmipit/buksupply/tree/main/backend/models): `backend/models`

### Administration and integrations

- [Reports and issuance documents](https://github.com/sharmipit/buksupply/blob/main/backend/controllers/reportController.js): `backend/controllers/reportController.js`
- [Document generation](https://github.com/sharmipit/buksupply/blob/main/backend/services/reportFiles.js): `backend/services/reportFiles.js`
- [Activity auditing](https://github.com/sharmipit/buksupply/blob/main/backend/services/activityLog.js): `backend/services/activityLog.js`
- [Account administration](https://github.com/sharmipit/buksupply/blob/main/backend/controllers/adminUserController.js): `backend/controllers/adminUserController.js`
- [System settings](https://github.com/sharmipit/buksupply/blob/main/backend/services/settings.js): `backend/services/settings.js`
- [Feedback and forms](https://github.com/sharmipit/buksupply/blob/main/backend/services/feedback.js): `backend/services/feedback.js`

### Other components

- **Requester**
- **Moderator and admin**
- **Google Drive**
- **Email service**
- **MongoDB**

## Connections

- Requester → Role-based portals: uses (evidence: `README.md`)
- Moderator and admin → Role-based portals: uses (evidence: `README.md`)
- Role-based portals → Sign-in and signup: routes to (evidence: `frontend/src/App.jsx`)
- Role-based portals → Requester pages: routes to (evidence: `frontend/src/App.jsx`)
- Role-based portals → Inventory views: routes to (evidence: `frontend/src/App.jsx`)
- Role-based portals → Request review: routes to (evidence: `frontend/src/App.jsx`)
- Role-based portals → Moderator dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Role-based portals → Admin portal: routes to (evidence: `frontend/src/App.jsx`)
- Sign-in and signup → API client: calls
- Requester pages → API client: calls
- Inventory views → API client: calls
- Request review → API client: calls
- API client → Express API: calls API (evidence: `README.md`)
- Express API → Authentication routes: mounts (evidence: `backend/server.js`)
- Authentication routes → Authentication and RBAC: dispatches (evidence: `backend/routes/authRoutes.js`)
- Authentication routes → Request authorization: uses (evidence: `backend/routes/authRoutes.js`)
- Express API → MongoDB: connects (evidence: `backend/server.js`)
- Moderator and admin → Requisition workflow: reviews (evidence: `README.md`)
- Requester → Requisition workflow: submits requests (evidence: `README.md`)
- Requisition workflow → Stock calculations: adjusts stock (evidence: `backend/controllers/requisitionController.js`)
- Inventory management → Stock calculations: uses calculations (evidence: `backend/controllers/inventoryController.js`)
- Requisition workflow → Supply and user records: reads and writes (evidence: `backend/controllers/requisitionController.js`)
- Inventory management → Supply and user records: reads and writes (evidence: `backend/controllers/inventoryController.js`)
- Authentication and RBAC → Supply and user records: reads and writes (evidence: `backend/controllers/authController.js`)
- Reports and issuance documents → Document generation: generates exports (evidence: `backend/controllers/reportController.js`)
- Reports and issuance documents → Google Drive: archives reports (evidence: `backend/controllers/reportController.js`)
- Reports and issuance documents → Supply and user records: reads report data (evidence: `backend/controllers/reportController.js`)
- Moderator and admin → Reports and issuance documents: requests reports (evidence: `README.md`)
- Requisition workflow → Activity auditing: records activity (evidence: `backend/controllers/requisitionController.js`)
- Account administration → Activity auditing: records activity (evidence: `backend/controllers/adminUserController.js`)
- Account administration → Supply and user records: manages accounts (evidence: `backend/controllers/adminUserController.js`)
- Moderator and admin → Account administration: manages users (evidence: `README.md`)
- Authentication and RBAC → Email service: sends codes (evidence: `backend/controllers/authController.js`)
- Authentication and RBAC → System settings: reads configuration (evidence: `backend/controllers/authController.js`)
- Reports and issuance documents → Feedback and forms: syncs feedback
- Moderator and admin → System settings: configures integrations (evidence: `README.md`)
