# ishwar-123/assets-flow-app architecture

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

- Interactive diagram: https://gitdiagram.com/ishwar-123/assets-flow-app
- Repository: https://github.com/ishwar-123/assets-flow-app

## Overview

AssetFlow is an enterprise asset inventory and lifecycle platform. Users authenticate into a role-aware React workspace, then register and track assets, allocate or book them, manage maintenance and audits, and review analytics and activity logs. Express routes dispatch these operations to controllers backed by MongoDB models; controllers also record activity and create notifications. The README documents the broader capabilities, while several frontend pages and backend modules were not sampled, so their detailed request flows are not asserted here.

Main entry points: [`frontend/src/App.js`](https://github.com/ishwar-123/assets-flow-app/blob/main/frontend/src/App.js) (React application), [`backend/routes`](https://github.com/ishwar-123/assets-flow-app/tree/main/backend/routes) (REST route modules), [`backend/controllers/dashboardController.js`](https://github.com/ishwar-123/assets-flow-app/blob/main/backend/controllers/dashboardController.js) (Dashboard summaries), [`backend/cron/automationJobs.js`](https://github.com/ishwar-123/assets-flow-app/blob/main/backend/cron/automationJobs.js) (Scheduled automation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["User workspace"]
  node_app["React application<br/>[App.js]"]
  node_authui["Sign-in and session<br/>[Auth.jsx]"]
  node_assetui["Asset directory<br/>[AssetDirectory.jsx]"]
  node_allocationui["Allocations<br/>[Allocation.jsx]"]
  node_bookingui["Bookings<br/>[Booking.jsx]"]
  node_maintui["Maintenance<br/>[Maintenance.jsx]"]
  node_auditui["Audits<br/>[Audit.jsx]"]
  node_insightui["Analytics and logs<br/>[Analytics.jsx]"]
  node_orgui["Organization setup"]
  node_authcontext["Auth context<br/>[AuthContext.js]"]
end

subgraph group_api["API and access"]
  node_api["Express API<br/>[server.js]"]
  node_routes["REST route modules"]
  node_authmw["JWT and role checks<br/>[authMiddleware.js]"]
end

subgraph group_lifecycle["Asset lifecycle"]
  node_assetctrl["Asset management<br/>[assetController.js]"]
  node_allocationctrl["Allocation workflows"]
  node_bookingctrl["Booking workflows"]
  node_maintctrl["Maintenance workflows"]
end

subgraph group_operations["Operations and insight"]
  node_auditctrl["Audit workflows<br/>[auditController.js]"]
  node_dashctrl["Dashboard summaries"]
  node_automation["Scheduled automation<br/>[automationJobs.js]"]
  node_activity["Activity logging<br/>[activityLogger.js]"]
  node_notify["Notifications<br/>[notify.js]"]
end

subgraph group_data["Persistent records"]
  node_asset[("Asset records<br/>[Asset.js]")]
  node_allocation[("Allocation records<br/>[Allocation.js]")]
  node_booking[("Booking records<br/>[Booking.js]")]
  node_maintenance[("Maintenance records<br/>[Maintenance.js]")]
  node_audit[("Audit records<br/>[Audit.js]")]
  node_userrecord[("User records<br/>[User.js]")]
  node_notification[("Notification records<br/>[Notification.js]")]
  node_activityrecord[("Activity log records<br/>[ActivityLog.js]")]
end

node_user(("Employee or admin"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_authui
node_app -->|"routes to"| node_assetui
node_app -->|"routes to"| node_allocationui
node_app -->|"routes to"| node_bookingui
node_app -->|"routes to"| node_maintui
node_app -->|"routes to"| node_auditui
node_app -->|"routes to"| node_insightui
node_app -->|"routes to"| node_orgui
node_app -->|"provides session"| node_authcontext
node_authcontext -->|"posts login"| node_api
node_api -->|"mounts"| node_routes
node_routes -->|"guards requests"| node_authmw
node_routes -->|"dispatches assets"| node_assetctrl
node_routes -->|"dispatches allocations"| node_allocationctrl
node_routes -->|"dispatches bookings"| node_bookingctrl
node_routes -->|"dispatches maintenance"| node_maintctrl
node_routes -->|"dispatches audits"| node_auditctrl
node_routes -->|"dispatches dashboard"| node_dashctrl
node_assetctrl -->|"reads and writes"| node_asset
node_assetctrl -->|"reads history"| node_allocation
node_assetctrl -->|"reads history"| node_booking
node_assetctrl -->|"reads history"| node_maintenance
node_allocationctrl -->|"updates status"| node_asset
node_allocationctrl -->|"creates and updates"| node_allocation
node_allocationctrl -->|"logs actions"| node_activity
node_allocationctrl -->|"creates notices"| node_notify
node_maintctrl -->|"creates and updates"| node_maintenance
node_maintctrl -->|"updates status"| node_asset
node_maintctrl -->|"logs actions"| node_activity
node_maintctrl -->|"creates notices"| node_notify
node_bookingctrl -->|"reads and writes"| node_booking
node_bookingctrl -->|"checks asset"| node_asset
node_auditctrl -->|"reads and writes"| node_audit
node_auditctrl -->|"checks assets"| node_asset
node_auditctrl -->|"logs actions"| node_activity
node_auditctrl -->|"creates notices"| node_notify
node_dashctrl -->|"summarizes"| node_asset
node_dashctrl -->|"summarizes"| node_allocation
node_dashctrl -->|"summarizes"| node_maintenance
node_dashctrl -->|"summarizes"| node_booking
node_dashctrl -->|"counts users"| node_userrecord
node_api -->|"starts after database connects"| node_automation
node_automation -->|"checks records"| node_asset
node_automation -->|"checks records"| node_allocation
node_automation -->|"checks records"| node_booking
node_automation -->|"creates records"| node_notification
node_automation -->|"checks users"| node_userrecord

click node_app "https://github.com/ishwar-123/assets-flow-app/blob/main/frontend/src/App.js"
click node_authui "https://github.com/ishwar-123/assets-flow-app/blob/main/frontend/src/pages/Auth.jsx"
click node_assetui "https://github.com/ishwar-123/assets-flow-app/blob/main/frontend/src/pages/AssetDirectory.jsx"
click node_allocationui "https://github.com/ishwar-123/assets-flow-app/blob/main/frontend/src/pages/Allocation.jsx"
click node_bookingui "https://github.com/ishwar-123/assets-flow-app/blob/main/frontend/src/pages/Booking.jsx"
click node_maintui "https://github.com/ishwar-123/assets-flow-app/blob/main/frontend/src/pages/Maintenance.jsx"
click node_auditui "https://github.com/ishwar-123/assets-flow-app/blob/main/frontend/src/pages/Audit.jsx"
click node_insightui "https://github.com/ishwar-123/assets-flow-app/blob/main/frontend/src/pages/Analytics.jsx"
click node_orgui "https://github.com/ishwar-123/assets-flow-app/blob/main/frontend/src/pages/OrganizationSetup.jsx"
click node_authcontext "https://github.com/ishwar-123/assets-flow-app/blob/main/frontend/src/context/AuthContext.js"
click node_api "https://github.com/ishwar-123/assets-flow-app/blob/main/backend/server.js"
click node_routes "https://github.com/ishwar-123/assets-flow-app/tree/main/backend/routes"
click node_authmw "https://github.com/ishwar-123/assets-flow-app/blob/main/backend/middleware/authMiddleware.js"
click node_assetctrl "https://github.com/ishwar-123/assets-flow-app/blob/main/backend/controllers/assetController.js"
click node_allocationctrl "https://github.com/ishwar-123/assets-flow-app/blob/main/backend/controllers/allocationController.js"
click node_bookingctrl "https://github.com/ishwar-123/assets-flow-app/blob/main/backend/controllers/bookingController.js"
click node_maintctrl "https://github.com/ishwar-123/assets-flow-app/blob/main/backend/controllers/maintenanceController.js"
click node_auditctrl "https://github.com/ishwar-123/assets-flow-app/blob/main/backend/controllers/auditController.js"
click node_dashctrl "https://github.com/ishwar-123/assets-flow-app/blob/main/backend/controllers/dashboardController.js"
click node_automation "https://github.com/ishwar-123/assets-flow-app/blob/main/backend/cron/automationJobs.js"
click node_activity "https://github.com/ishwar-123/assets-flow-app/blob/main/backend/utils/activityLogger.js"
click node_notify "https://github.com/ishwar-123/assets-flow-app/blob/main/backend/utils/notify.js"
click node_asset "https://github.com/ishwar-123/assets-flow-app/blob/main/backend/models/Asset.js"
click node_allocation "https://github.com/ishwar-123/assets-flow-app/blob/main/backend/models/Allocation.js"
click node_booking "https://github.com/ishwar-123/assets-flow-app/blob/main/backend/models/Booking.js"
click node_maintenance "https://github.com/ishwar-123/assets-flow-app/blob/main/backend/models/Maintenance.js"
click node_audit "https://github.com/ishwar-123/assets-flow-app/blob/main/backend/models/Audit.js"
click node_userrecord "https://github.com/ishwar-123/assets-flow-app/blob/main/backend/models/User.js"
click node_notification "https://github.com/ishwar-123/assets-flow-app/blob/main/backend/models/Notification.js"
click node_activityrecord "https://github.com/ishwar-123/assets-flow-app/blob/main/backend/models/ActivityLog.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_authui,node_assetui,node_allocationui,node_bookingui,node_maintui,node_auditui,node_insightui,node_orgui,node_authcontext toneBlue
class node_api,node_routes,node_authmw toneAmber
class node_assetctrl,node_allocationctrl,node_bookingctrl,node_maintctrl toneMint
class node_auditctrl,node_dashctrl,node_automation,node_activity,node_notify toneRose
class node_asset,node_allocation,node_booking,node_maintenance,node_audit,node_userrecord,node_notification,node_activityrecord,node_user toneIndigo
```

## Components

### User workspace

- [React application](https://github.com/ishwar-123/assets-flow-app/blob/main/frontend/src/App.js): `frontend/src/App.js`
- [Sign-in and session](https://github.com/ishwar-123/assets-flow-app/blob/main/frontend/src/pages/Auth.jsx): `frontend/src/pages/Auth.jsx`
- [Asset directory](https://github.com/ishwar-123/assets-flow-app/blob/main/frontend/src/pages/AssetDirectory.jsx): `frontend/src/pages/AssetDirectory.jsx`
- [Allocations](https://github.com/ishwar-123/assets-flow-app/blob/main/frontend/src/pages/Allocation.jsx): `frontend/src/pages/Allocation.jsx`
- [Bookings](https://github.com/ishwar-123/assets-flow-app/blob/main/frontend/src/pages/Booking.jsx): `frontend/src/pages/Booking.jsx`
- [Maintenance](https://github.com/ishwar-123/assets-flow-app/blob/main/frontend/src/pages/Maintenance.jsx): `frontend/src/pages/Maintenance.jsx`
- [Audits](https://github.com/ishwar-123/assets-flow-app/blob/main/frontend/src/pages/Audit.jsx): `frontend/src/pages/Audit.jsx`
- [Analytics and logs](https://github.com/ishwar-123/assets-flow-app/blob/main/frontend/src/pages/Analytics.jsx): `frontend/src/pages/Analytics.jsx`
- [Organization setup](https://github.com/ishwar-123/assets-flow-app/blob/main/frontend/src/pages/OrganizationSetup.jsx): `frontend/src/pages/OrganizationSetup.jsx`
- [Auth context](https://github.com/ishwar-123/assets-flow-app/blob/main/frontend/src/context/AuthContext.js): `frontend/src/context/AuthContext.js`

### API and access

- [Express API](https://github.com/ishwar-123/assets-flow-app/blob/main/backend/server.js): `backend/server.js`
- [REST route modules](https://github.com/ishwar-123/assets-flow-app/tree/main/backend/routes): `backend/routes`
- [JWT and role checks](https://github.com/ishwar-123/assets-flow-app/blob/main/backend/middleware/authMiddleware.js): `backend/middleware/authMiddleware.js`

### Asset lifecycle

- [Asset management](https://github.com/ishwar-123/assets-flow-app/blob/main/backend/controllers/assetController.js): `backend/controllers/assetController.js`
- [Allocation workflows](https://github.com/ishwar-123/assets-flow-app/blob/main/backend/controllers/allocationController.js): `backend/controllers/allocationController.js`
- [Booking workflows](https://github.com/ishwar-123/assets-flow-app/blob/main/backend/controllers/bookingController.js): `backend/controllers/bookingController.js`
- [Maintenance workflows](https://github.com/ishwar-123/assets-flow-app/blob/main/backend/controllers/maintenanceController.js): `backend/controllers/maintenanceController.js`

### Operations and insight

- [Audit workflows](https://github.com/ishwar-123/assets-flow-app/blob/main/backend/controllers/auditController.js): `backend/controllers/auditController.js`
- [Dashboard summaries](https://github.com/ishwar-123/assets-flow-app/blob/main/backend/controllers/dashboardController.js): `backend/controllers/dashboardController.js`
- [Scheduled automation](https://github.com/ishwar-123/assets-flow-app/blob/main/backend/cron/automationJobs.js): `backend/cron/automationJobs.js`
- [Activity logging](https://github.com/ishwar-123/assets-flow-app/blob/main/backend/utils/activityLogger.js): `backend/utils/activityLogger.js`
- [Notifications](https://github.com/ishwar-123/assets-flow-app/blob/main/backend/utils/notify.js): `backend/utils/notify.js`

### Persistent records

- [Asset records](https://github.com/ishwar-123/assets-flow-app/blob/main/backend/models/Asset.js): `backend/models/Asset.js`
- [Allocation records](https://github.com/ishwar-123/assets-flow-app/blob/main/backend/models/Allocation.js): `backend/models/Allocation.js`
- [Booking records](https://github.com/ishwar-123/assets-flow-app/blob/main/backend/models/Booking.js): `backend/models/Booking.js`
- [Maintenance records](https://github.com/ishwar-123/assets-flow-app/blob/main/backend/models/Maintenance.js): `backend/models/Maintenance.js`
- [Audit records](https://github.com/ishwar-123/assets-flow-app/blob/main/backend/models/Audit.js): `backend/models/Audit.js`
- [User records](https://github.com/ishwar-123/assets-flow-app/blob/main/backend/models/User.js): `backend/models/User.js`
- [Notification records](https://github.com/ishwar-123/assets-flow-app/blob/main/backend/models/Notification.js): `backend/models/Notification.js`
- [Activity log records](https://github.com/ishwar-123/assets-flow-app/blob/main/backend/models/ActivityLog.js): `backend/models/ActivityLog.js`

### Other components

- **Employee or admin**

## Connections

- Employee or admin → React application: uses
- React application → Sign-in and session: routes to (evidence: `frontend/src/App.js`)
- React application → Asset directory: routes to (evidence: `frontend/src/App.js`)
- React application → Allocations: routes to (evidence: `frontend/src/App.js`)
- React application → Bookings: routes to (evidence: `frontend/src/App.js`)
- React application → Maintenance: routes to (evidence: `frontend/src/App.js`)
- React application → Audits: routes to (evidence: `frontend/src/App.js`)
- React application → Analytics and logs: routes to (evidence: `frontend/src/App.js`)
- React application → Organization setup: routes to (evidence: `frontend/src/App.js`)
- React application → Auth context: provides session (evidence: `frontend/src/App.js`)
- Auth context → Express API: posts login (evidence: `frontend/src/context/AuthContext.js`)
- Express API → REST route modules: mounts (evidence: `backend/server.js`)
- REST route modules → JWT and role checks: guards requests (evidence: `backend/routes/assetRoutes.js`)
- REST route modules → Asset management: dispatches assets (evidence: `backend/routes/assetRoutes.js`)
- REST route modules → Allocation workflows: dispatches allocations (evidence: `backend/routes/allocationRoutes.js`)
- REST route modules → Booking workflows: dispatches bookings (evidence: `backend/routes/bookingRoutes.js`)
- REST route modules → Maintenance workflows: dispatches maintenance (evidence: `backend/routes/maintenanceRoutes.js`)
- REST route modules → Audit workflows: dispatches audits (evidence: `backend/routes/auditRoutes.js`)
- REST route modules → Dashboard summaries: dispatches dashboard
- Asset management → Asset records: reads and writes (evidence: `backend/controllers/assetController.js`)
- Asset management → Allocation records: reads history (evidence: `backend/controllers/assetController.js`)
- Asset management → Booking records: reads history (evidence: `backend/controllers/assetController.js`)
- Asset management → Maintenance records: reads history (evidence: `backend/controllers/assetController.js`)
- Allocation workflows → Asset records: updates status (evidence: `backend/controllers/allocationController.js`)
- Allocation workflows → Allocation records: creates and updates (evidence: `backend/controllers/allocationController.js`)
- Allocation workflows → Activity logging: logs actions (evidence: `backend/controllers/allocationController.js`)
- Allocation workflows → Notifications: creates notices (evidence: `backend/controllers/allocationController.js`)
- Maintenance workflows → Maintenance records: creates and updates (evidence: `backend/controllers/maintenanceController.js`)
- Maintenance workflows → Asset records: updates status (evidence: `backend/controllers/maintenanceController.js`)
- Maintenance workflows → Activity logging: logs actions (evidence: `backend/controllers/maintenanceController.js`)
- Maintenance workflows → Notifications: creates notices (evidence: `backend/controllers/maintenanceController.js`)
- Booking workflows → Booking records: reads and writes (evidence: `backend/controllers/bookingController.js`)
- Booking workflows → Asset records: checks asset (evidence: `backend/controllers/bookingController.js`)
- Audit workflows → Audit records: reads and writes (evidence: `backend/controllers/auditController.js`)
- Audit workflows → Asset records: checks assets (evidence: `backend/controllers/auditController.js`)
- Audit workflows → Activity logging: logs actions (evidence: `backend/controllers/auditController.js`)
- Audit workflows → Notifications: creates notices (evidence: `backend/controllers/auditController.js`)
- Dashboard summaries → Asset records: summarizes (evidence: `backend/controllers/dashboardController.js`)
- Dashboard summaries → Allocation records: summarizes (evidence: `backend/controllers/dashboardController.js`)
- Dashboard summaries → Maintenance records: summarizes (evidence: `backend/controllers/dashboardController.js`)
- Dashboard summaries → Booking records: summarizes (evidence: `backend/controllers/dashboardController.js`)
- Dashboard summaries → User records: counts users (evidence: `backend/controllers/dashboardController.js`)
- Express API → Scheduled automation: starts after database connects (evidence: `backend/server.js`)
- Scheduled automation → Asset records: checks records (evidence: `backend/cron/automationJobs.js`)
- Scheduled automation → Allocation records: checks records (evidence: `backend/cron/automationJobs.js`)
- Scheduled automation → Booking records: checks records (evidence: `backend/cron/automationJobs.js`)
- Scheduled automation → Notification records: creates records (evidence: `backend/cron/automationJobs.js`)
- Scheduled automation → User records: checks users (evidence: `backend/cron/automationJobs.js`)
