# arji-hub/assetmanagement architecture

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

- Interactive diagram: https://gitdiagram.com/arji-hub/assetmanagement
- Repository: https://github.com/arji-hub/assetmanagement

## Overview

CICT-AMS is a role-aware web system for registering and tracking institutional assets, their locations and custodians, and their condition over time. Users enter through the routed React application, authenticate, and work through asset, room, custodian, transfer, audit, and report workflows; QR lookup and generated documents support those workflows. The frontend services connect to Firebase, while Cloud Functions handle administrative and event-driven work. The map follows README capabilities and sampled call sites; links within unsampled feature areas are omitted where their wiring cannot be verified.

Main entry points: [`src/App.jsx`](https://github.com/arji-hub/assetmanagement/blob/main/src/App.jsx) (Application routes), [`src/services/authService.js`](https://github.com/arji-hub/assetmanagement/blob/main/src/services/authService.js) (Authentication service), [`src/services/asset.js`](https://github.com/arji-hub/assetmanagement/blob/main/src/services/asset.js) (Asset service), [`src/services/firebase-config.js`](https://github.com/arji-hub/assetmanagement/blob/main/src/services/firebase-config.js) (Firebase services)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and navigation"]
  node_app["Application routes<br/>[App.jsx]"]
  node_login["Login workflow<br/>[useLogin.js]"]
  node_auth["Authentication service<br/>[authService.js]"]
end

subgraph group_inventory["Asset inventory"]
  node_assets["Asset registration<br/>[useItemForm.js]"]
  node_assetpages["Asset pages<br/>[Asset.jsx]"]
  node_assetdata["Asset service<br/>[asset.js]"]
  node_custodians["Custodian management<br/>[useCustodian.js]"]
  node_custodianpages["Custodian pages<br/>[Custodian.jsx]"]
  node_rooms["Room management<br/>[room.js]"]
end

subgraph group_operations["Accountability workflows"]
  node_transfers["Asset transfers"]
  node_audit["Room audits"]
  node_auditdata["Audit service<br/>[audit.js]"]
  node_reports["Condition reports"]
  node_reportdata["Report service<br/>[report.js]"]
end

subgraph group_insight["Lookup and reporting"]
  node_qr["QR lookup<br/>[useQR.js]"]
  node_camera["QR camera scan<br/>[useCamera.js]"]
  node_dashboard["Operational dashboards"]
  node_pdf["PDF documents<br/>[AuditRoomPDF.jsx]"]
end

subgraph group_platform["Data and serverless"]
  node_firebase[("Firebase services<br/>[firebase-config.js]")]
  node_functions["Cloud Functions<br/>[index.js]"]
  node_email["Email delivery"]
end

node_user(("Staff user"))

node_user -->|"opens"| node_app
node_app -->|"routes to"| node_login
node_login -->|"signs in"| node_auth
node_auth -->|"checks identity"| node_firebase
node_app -->|"routes to"| node_assetpages
node_app -->|"routes to"| node_custodianpages
node_assetpages -->|"supports entry"| node_assets
node_assets -->|"checks serials"| node_assetdata
node_custodianpages -->|"manages records"| node_custodians
node_custodians -->|"reads and writes"| node_firebase
node_audit -->|"subscribes assets"| node_rooms
node_audit -->|"creates audit"| node_auditdata
node_reports -->|"looks up asset"| node_assetdata
node_reports -->|"submits report"| node_reportdata
node_dashboard -->|"subscribes reports"| node_reportdata
node_qr -->|"loads QR assets"| node_assetdata
node_camera -->|"decodes QR"| node_qr
node_auth -->|"reads user record"| node_firebase
node_functions -.->|"sends messages"| node_email

click node_app "https://github.com/arji-hub/assetmanagement/blob/main/src/App.jsx"
click node_login "https://github.com/arji-hub/assetmanagement/blob/main/src/hooks/login/useLogin.js"
click node_auth "https://github.com/arji-hub/assetmanagement/blob/main/src/services/authService.js"
click node_assets "https://github.com/arji-hub/assetmanagement/blob/main/src/hooks/asset/useItemForm.js"
click node_assetpages "https://github.com/arji-hub/assetmanagement/blob/main/src/pages/Asset/Asset.jsx"
click node_assetdata "https://github.com/arji-hub/assetmanagement/blob/main/src/services/asset.js"
click node_custodians "https://github.com/arji-hub/assetmanagement/blob/main/src/hooks/custodian/useCustodian.js"
click node_custodianpages "https://github.com/arji-hub/assetmanagement/blob/main/src/pages/Custodian/Custodian.jsx"
click node_rooms "https://github.com/arji-hub/assetmanagement/blob/main/src/services/room.js"
click node_transfers "https://github.com/arji-hub/assetmanagement/blob/main/src/hooks/transfer/useTransferAction.js"
click node_audit "https://github.com/arji-hub/assetmanagement/blob/main/src/hooks/audit/room/useAuditRoomSession.js"
click node_auditdata "https://github.com/arji-hub/assetmanagement/blob/main/src/services/audit.js"
click node_reports "https://github.com/arji-hub/assetmanagement/blob/main/src/hooks/report/useReportRegistration.js"
click node_reportdata "https://github.com/arji-hub/assetmanagement/blob/main/src/services/report.js"
click node_qr "https://github.com/arji-hub/assetmanagement/blob/main/src/hooks/qr/useQR.js"
click node_camera "https://github.com/arji-hub/assetmanagement/blob/main/src/hooks/camera/useCamera.js"
click node_dashboard "https://github.com/arji-hub/assetmanagement/blob/main/src/hooks/dashboard/useReportSummary.js"
click node_pdf "https://github.com/arji-hub/assetmanagement/blob/main/src/pdf/templates/AuditRoomPDF.jsx"
click node_firebase "https://github.com/arji-hub/assetmanagement/blob/main/src/services/firebase-config.js"
click node_functions "https://github.com/arji-hub/assetmanagement/blob/main/functions/src/index.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_login,node_auth,node_user toneBlue
class node_assets,node_assetpages,node_assetdata,node_custodians,node_custodianpages,node_rooms toneAmber
class node_transfers,node_audit,node_auditdata,node_reports,node_reportdata toneMint
class node_qr,node_camera,node_dashboard,node_pdf toneRose
class node_firebase,node_functions,node_email toneIndigo
```

## Components

### Access and navigation

- [Application routes](https://github.com/arji-hub/assetmanagement/blob/main/src/App.jsx): `src/App.jsx`
- [Login workflow](https://github.com/arji-hub/assetmanagement/blob/main/src/hooks/login/useLogin.js): `src/hooks/login/useLogin.js`
- [Authentication service](https://github.com/arji-hub/assetmanagement/blob/main/src/services/authService.js): `src/services/authService.js`

### Asset inventory

- [Asset registration](https://github.com/arji-hub/assetmanagement/blob/main/src/hooks/asset/useItemForm.js): `src/hooks/asset/useItemForm.js`
- [Asset pages](https://github.com/arji-hub/assetmanagement/blob/main/src/pages/Asset/Asset.jsx): `src/pages/Asset/Asset.jsx`
- [Asset service](https://github.com/arji-hub/assetmanagement/blob/main/src/services/asset.js): `src/services/asset.js`
- [Custodian management](https://github.com/arji-hub/assetmanagement/blob/main/src/hooks/custodian/useCustodian.js): `src/hooks/custodian/useCustodian.js`
- [Custodian pages](https://github.com/arji-hub/assetmanagement/blob/main/src/pages/Custodian/Custodian.jsx): `src/pages/Custodian/Custodian.jsx`
- [Room management](https://github.com/arji-hub/assetmanagement/blob/main/src/services/room.js): `src/services/room.js`

### Accountability workflows

- [Asset transfers](https://github.com/arji-hub/assetmanagement/blob/main/src/hooks/transfer/useTransferAction.js): `src/hooks/transfer/useTransferAction.js`
- [Room audits](https://github.com/arji-hub/assetmanagement/blob/main/src/hooks/audit/room/useAuditRoomSession.js): `src/hooks/audit/room/useAuditRoomSession.js`
- [Audit service](https://github.com/arji-hub/assetmanagement/blob/main/src/services/audit.js): `src/services/audit.js`
- [Condition reports](https://github.com/arji-hub/assetmanagement/blob/main/src/hooks/report/useReportRegistration.js): `src/hooks/report/useReportRegistration.js`
- [Report service](https://github.com/arji-hub/assetmanagement/blob/main/src/services/report.js): `src/services/report.js`

### Lookup and reporting

- [QR lookup](https://github.com/arji-hub/assetmanagement/blob/main/src/hooks/qr/useQR.js): `src/hooks/qr/useQR.js`
- [QR camera scan](https://github.com/arji-hub/assetmanagement/blob/main/src/hooks/camera/useCamera.js): `src/hooks/camera/useCamera.js`
- [Operational dashboards](https://github.com/arji-hub/assetmanagement/blob/main/src/hooks/dashboard/useReportSummary.js): `src/hooks/dashboard/useReportSummary.js`
- [PDF documents](https://github.com/arji-hub/assetmanagement/blob/main/src/pdf/templates/AuditRoomPDF.jsx): `src/pdf/templates/AuditRoomPDF.jsx`

### Data and serverless

- [Firebase services](https://github.com/arji-hub/assetmanagement/blob/main/src/services/firebase-config.js): `src/services/firebase-config.js`
- [Cloud Functions](https://github.com/arji-hub/assetmanagement/blob/main/functions/src/index.js): `functions/src/index.js`
- **Email delivery**

### Other components

- **Staff user**

## Connections

- Staff user → Application routes: opens
- Application routes → Login workflow: routes to
- Login workflow → Authentication service: signs in
- Authentication service → Firebase services: checks identity
- Application routes → Asset pages: routes to
- Application routes → Custodian pages: routes to
- Asset pages → Asset registration: supports entry
- Asset registration → Asset service: checks serials
- Custodian pages → Custodian management: manages records
- Custodian management → Firebase services: reads and writes
- Room audits → Room management: subscribes assets
- Room audits → Audit service: creates audit
- Condition reports → Asset service: looks up asset
- Condition reports → Report service: submits report
- Operational dashboards → Report service: subscribes reports
- QR lookup → Asset service: loads QR assets
- QR camera scan → QR lookup: decodes QR
- Authentication service → Firebase services: reads user record
- Cloud Functions → Email delivery: sends messages
