# adit244496/asset_management architecture

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

- Interactive diagram: https://gitdiagram.com/adit244496/asset_management
- Repository: https://github.com/adit244496/asset_management

## Overview

IT Asset Engine is a shared, authenticated asset-register application: users sign in, enter or import records, and submitted records pass through verification before becoming visible in inventory, dashboards, history and reports. The React client calls a Flask API, which enforces permissions and owns PostgreSQL reads and writes. Separate product branches support administration, master data, audit activity, live updates and an AI assistant. Some routes and pages are documented but unsampled, so their internal links are shown only where the README or source index establishes them.

Main entry points: [`frontend/src/context/AssetsContext.jsx`](https://github.com/adit244496/asset_management/blob/main/frontend/src/context/AssetsContext.jsx) (Register state), [`backend/app/main.py`](https://github.com/adit244496/asset_management/blob/main/backend/app/main.py) (Flask application), [`backend/app/crud.py`](https://github.com/adit244496/asset_management/blob/main/backend/app/crud.py) (Register operations), [`frontend/src/api.js`](https://github.com/adit244496/asset_management/blob/main/frontend/src/api.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_app["App routing<br/>[App.jsx]"]
  node_authctx["Session state<br/>[AuthContext.jsx]"]
  node_assetctx["Register state<br/>[AssetsContext.jsx]"]
  node_api_client["API client<br/>[api.js]"]
  node_entry["Data entry<br/>[DataEntryPage.jsx]"]
  node_verification_ui["Verification queue"]
  node_inventory["Inventory and reports<br/>[ReportPage.jsx]"]
  node_dashboard["Dashboard<br/>[DashboardPage.jsx]"]
  node_history["History views<br/>[HistoryPage.jsx]"]
end

subgraph group_api["API and access"]
  node_flask["Flask application<br/>[main.py]"]
  node_auth_routes["Authentication routes<br/>[auth.py]"]
  node_asset_routes["Asset routes<br/>[assets.py]"]
end

subgraph group_register["Register lifecycle"]
  node_crud["Register operations<br/>[crud.py]"]
  node_approval["Approval workflow<br/>[approvals.py]"]
  node_models["Register data model<br/>[models.py]"]
  node_database[("PostgreSQL store<br/>[database.py]")]
end

subgraph group_insight["Insights and assistance"]
  node_assistant_ui["Assistant panel<br/>[AssistantPanel.jsx]"]
  node_assistant_api["Assistant endpoint<br/>[assistant.py]"]
  node_assistant_engine["Assistant engine<br/>[engine.py]"]
  node_assistant_tools["Assistant tools<br/>[tools.py]"]
end

subgraph group_ops["Administration"]
  node_activity["Activity audit<br/>[activity.py]"]
  node_activity_ui["Activity screen"]
  node_masters_ui["Master data<br/>[MasterDataPage.jsx]"]
  node_masters_api["Master routes<br/>[masters.py]"]
  node_live["Live updates<br/>[live.py]"]
end

node_user(("Staff user"))

node_user -->|"uses"| node_app
node_app -->|"provides session"| node_authctx
node_app -->|"provides register state"| node_assetctx
node_authctx -->|"requests session"| node_api_client
node_assetctx -->|"fetches and mutates"| node_api_client
node_entry -->|"submits records"| node_assetctx
node_assetctx -->|"calls API"| node_asset_routes
node_api_client -->|"sends API requests"| node_flask
node_flask -->|"registers routes"| node_auth_routes
node_flask -->|"registers routes"| node_asset_routes
node_auth_routes -->|"loads user"| node_crud
node_asset_routes -->|"operates on records"| node_crud
node_asset_routes -->|"handles approvals"| node_approval
node_crud -->|"queries register models"| node_models
node_crud -.->|"reads and writes"| node_database
node_approval -.->|"persists decisions"| node_database
node_verification_ui -->|"decides records"| node_api_client
node_approval -->|"uses register operations"| node_crud
node_assetctx -.->|"supplies register data"| node_inventory
node_assetctx -.->|"supplies register data"| node_dashboard
node_assetctx -.->|"supplies register data"| node_history
node_inventory -->|"exports and edits"| node_api_client
node_assistant_ui -->|"asks questions"| node_assistant_api
node_flask -->|"registers routes"| node_assistant_api
node_assistant_api -->|"runs turns"| node_assistant_engine
node_assistant_engine -->|"dispatches tools"| node_assistant_tools
node_assistant_tools -->|"queries register"| node_crud
node_activity_ui -.->|"loads audit feed"| node_api_client
node_flask -->|"records requests"| node_activity
node_masters_ui -.->|"manages master data"| node_api_client
node_flask -->|"registers routes"| node_masters_api
node_masters_api -.->|"updates master data"| node_crud
node_assetctx -->|"subscribes to updates"| node_live
node_flask -->|"initializes live service"| node_live

click node_app "https://github.com/adit244496/asset_management/blob/main/frontend/src/App.jsx"
click node_authctx "https://github.com/adit244496/asset_management/blob/main/frontend/src/context/AuthContext.jsx"
click node_assetctx "https://github.com/adit244496/asset_management/blob/main/frontend/src/context/AssetsContext.jsx"
click node_api_client "https://github.com/adit244496/asset_management/blob/main/frontend/src/api.js"
click node_entry "https://github.com/adit244496/asset_management/blob/main/frontend/src/pages/DataEntryPage.jsx"
click node_verification_ui "https://github.com/adit244496/asset_management/blob/main/frontend/src/pages/VerificationPage.jsx"
click node_inventory "https://github.com/adit244496/asset_management/blob/main/frontend/src/pages/ReportPage.jsx"
click node_dashboard "https://github.com/adit244496/asset_management/blob/main/frontend/src/pages/DashboardPage.jsx"
click node_history "https://github.com/adit244496/asset_management/blob/main/frontend/src/pages/HistoryPage.jsx"
click node_flask "https://github.com/adit244496/asset_management/blob/main/backend/app/main.py"
click node_auth_routes "https://github.com/adit244496/asset_management/blob/main/backend/app/api/auth.py"
click node_asset_routes "https://github.com/adit244496/asset_management/blob/main/backend/app/api/assets.py"
click node_crud "https://github.com/adit244496/asset_management/blob/main/backend/app/crud.py"
click node_approval "https://github.com/adit244496/asset_management/blob/main/backend/app/approvals.py"
click node_models "https://github.com/adit244496/asset_management/blob/main/backend/app/models.py"
click node_database "https://github.com/adit244496/asset_management/blob/main/backend/app/database.py"
click node_assistant_ui "https://github.com/adit244496/asset_management/blob/main/frontend/src/components/AssistantPanel.jsx"
click node_assistant_api "https://github.com/adit244496/asset_management/blob/main/backend/app/api/assistant.py"
click node_assistant_engine "https://github.com/adit244496/asset_management/blob/main/backend/app/assistant/engine.py"
click node_assistant_tools "https://github.com/adit244496/asset_management/blob/main/backend/app/assistant/tools.py"
click node_activity "https://github.com/adit244496/asset_management/blob/main/backend/app/activity.py"
click node_activity_ui "https://github.com/adit244496/asset_management/blob/main/frontend/src/pages/ActivityLogPage.jsx"
click node_masters_ui "https://github.com/adit244496/asset_management/blob/main/frontend/src/pages/MasterDataPage.jsx"
click node_masters_api "https://github.com/adit244496/asset_management/blob/main/backend/app/api/masters.py"
click node_live "https://github.com/adit244496/asset_management/blob/main/backend/app/live.py"

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_authctx,node_assetctx,node_api_client,node_entry,node_verification_ui,node_inventory,node_dashboard,node_history,node_user toneBlue
class node_flask,node_auth_routes,node_asset_routes toneAmber
class node_crud,node_approval,node_models,node_database toneMint
class node_assistant_ui,node_assistant_api,node_assistant_engine,node_assistant_tools toneRose
class node_activity,node_activity_ui,node_masters_ui,node_masters_api,node_live toneIndigo
```

## Components

### Web application

- [App routing](https://github.com/adit244496/asset_management/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Session state](https://github.com/adit244496/asset_management/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [Register state](https://github.com/adit244496/asset_management/blob/main/frontend/src/context/AssetsContext.jsx): `frontend/src/context/AssetsContext.jsx`
- [API client](https://github.com/adit244496/asset_management/blob/main/frontend/src/api.js): `frontend/src/api.js`
- [Data entry](https://github.com/adit244496/asset_management/blob/main/frontend/src/pages/DataEntryPage.jsx): `frontend/src/pages/DataEntryPage.jsx`
- [Verification queue](https://github.com/adit244496/asset_management/blob/main/frontend/src/pages/VerificationPage.jsx): `frontend/src/pages/VerificationPage.jsx`
- [Inventory and reports](https://github.com/adit244496/asset_management/blob/main/frontend/src/pages/ReportPage.jsx): `frontend/src/pages/ReportPage.jsx`
- [Dashboard](https://github.com/adit244496/asset_management/blob/main/frontend/src/pages/DashboardPage.jsx): `frontend/src/pages/DashboardPage.jsx`
- [History views](https://github.com/adit244496/asset_management/blob/main/frontend/src/pages/HistoryPage.jsx): `frontend/src/pages/HistoryPage.jsx`

### API and access

- [Flask application](https://github.com/adit244496/asset_management/blob/main/backend/app/main.py): `backend/app/main.py`
- [Authentication routes](https://github.com/adit244496/asset_management/blob/main/backend/app/api/auth.py): `backend/app/api/auth.py`
- [Asset routes](https://github.com/adit244496/asset_management/blob/main/backend/app/api/assets.py): `backend/app/api/assets.py`

### Register lifecycle

- [Register operations](https://github.com/adit244496/asset_management/blob/main/backend/app/crud.py): `backend/app/crud.py`
- [Approval workflow](https://github.com/adit244496/asset_management/blob/main/backend/app/approvals.py): `backend/app/approvals.py`
- [Register data model](https://github.com/adit244496/asset_management/blob/main/backend/app/models.py): `backend/app/models.py`
- [PostgreSQL store](https://github.com/adit244496/asset_management/blob/main/backend/app/database.py): `backend/app/database.py`

### Insights and assistance

- [Assistant panel](https://github.com/adit244496/asset_management/blob/main/frontend/src/components/AssistantPanel.jsx): `frontend/src/components/AssistantPanel.jsx`
- [Assistant endpoint](https://github.com/adit244496/asset_management/blob/main/backend/app/api/assistant.py): `backend/app/api/assistant.py`
- [Assistant engine](https://github.com/adit244496/asset_management/blob/main/backend/app/assistant/engine.py): `backend/app/assistant/engine.py`
- [Assistant tools](https://github.com/adit244496/asset_management/blob/main/backend/app/assistant/tools.py): `backend/app/assistant/tools.py`

### Administration

- [Activity audit](https://github.com/adit244496/asset_management/blob/main/backend/app/activity.py): `backend/app/activity.py`
- [Activity screen](https://github.com/adit244496/asset_management/blob/main/frontend/src/pages/ActivityLogPage.jsx): `frontend/src/pages/ActivityLogPage.jsx`
- [Master data](https://github.com/adit244496/asset_management/blob/main/frontend/src/pages/MasterDataPage.jsx): `frontend/src/pages/MasterDataPage.jsx`
- [Master routes](https://github.com/adit244496/asset_management/blob/main/backend/app/api/masters.py): `backend/app/api/masters.py`
- [Live updates](https://github.com/adit244496/asset_management/blob/main/backend/app/live.py): `backend/app/live.py`

### Other components

- **Staff user**

## Connections

- Staff user → App routing: uses
- App routing → Session state: provides session (evidence: `frontend/src/App.jsx`)
- App routing → Register state: provides register state (evidence: `frontend/src/App.jsx`)
- Session state → API client: requests session (evidence: `frontend/src/context/AuthContext.jsx`)
- Register state → API client: fetches and mutates (evidence: `frontend/src/context/AssetsContext.jsx`)
- Data entry → Register state: submits records
- Register state → Asset routes: calls API (evidence: `frontend/src/context/AssetsContext.jsx`)
- API client → Flask application: sends API requests
- Flask application → Authentication routes: registers routes (evidence: `backend/app/main.py`)
- Flask application → Asset routes: registers routes (evidence: `backend/app/main.py`)
- Authentication routes → Register operations: loads user (evidence: `backend/app/api/auth.py`)
- Asset routes → Register operations: operates on records (evidence: `backend/app/api/assets.py`)
- Asset routes → Approval workflow: handles approvals (evidence: `backend/app/api/assets.py`)
- Register operations → Register data model: queries register models (evidence: `backend/app/crud.py`)
- Register operations → PostgreSQL store: reads and writes
- Approval workflow → PostgreSQL store: persists decisions (evidence: `backend/app/approvals.py`)
- Verification queue → API client: decides records
- Approval workflow → Register operations: uses register operations (evidence: `backend/app/approvals.py`)
- Register state → Inventory and reports: supplies register data (evidence: `frontend/src/pages/ReportPage.jsx`)
- Register state → Dashboard: supplies register data
- Register state → History views: supplies register data
- Inventory and reports → API client: exports and edits (evidence: `frontend/src/pages/ReportPage.jsx`)
- Assistant panel → Assistant endpoint: asks questions
- Flask application → Assistant endpoint: registers routes (evidence: `backend/app/main.py`)
- Assistant endpoint → Assistant engine: runs turns (evidence: `backend/app/api/assistant.py`)
- Assistant engine → Assistant tools: dispatches tools (evidence: `backend/app/assistant/engine.py`)
- Assistant tools → Register operations: queries register (evidence: `backend/app/assistant/tools.py`)
- Activity screen → API client: loads audit feed
- Flask application → Activity audit: records requests (evidence: `backend/app/main.py`)
- Master data → API client: manages master data
- Flask application → Master routes: registers routes (evidence: `backend/app/main.py`)
- Master routes → Register operations: updates master data
- Register state → Live updates: subscribes to updates (evidence: `frontend/src/context/AssetsContext.jsx`)
- Flask application → Live updates: initializes live service (evidence: `backend/app/main.py`)
