# smartbuddy1/frontend_expense architecture

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

- Interactive diagram: https://gitdiagram.com/smartbuddy1/frontend_expense
- Repository: https://github.com/smartbuddy1/frontend_expense

## Overview

ASEMS is a role-based frontend for managing expenses and progress on installation projects. The primary workflow runs from a supervisor’s expense entry, through Operations approval and Accounts verification/payment, with Admin oversight; supervisors can also request advances, upload bills, and submit a public expense form. The root shell authenticates users and routes them to role-specific apps. The README describes backend services as a separate repository; backend internals are not shown here, and several dashboard implementations were not sampled, so those links reflect documented capabilities rather than inspected calls.

Main entry points: [`src/App.jsx`](https://github.com/smartbuddy1/frontend_expense/blob/main/src/App.jsx) (Login and Routing), [`src/modules/Accountant/pages/AccountsDashboard.jsx`](https://github.com/smartbuddy1/frontend_expense/blob/main/src/modules/Accountant/pages/AccountsDashboard.jsx) (Accounts Dashboard), [`src/modules/SiteSupervisor/context/WalletContext.jsx`](https://github.com/smartbuddy1/frontend_expense/blob/main/src/modules/SiteSupervisor/context/WalletContext.jsx) (Wallet and Expense API), [`src/modules/SiteSupervisor/App.jsx`](https://github.com/smartbuddy1/frontend_expense/blob/main/src/modules/SiteSupervisor/App.jsx) (Supervisor App)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Portal Entry"]
  node_portal["Login and Routing<br/>[App.jsx]"]
end

subgraph group_field["Field Supervision"]
  node_supervisor_app["Supervisor App<br/>[App.jsx]"]
  node_field_dashboard["Field Expense Workflows"]
  node_wallet["Wallet and Expense API<br/>[WalletContext.jsx]"]
  node_public_form["Public Expense Form"]
end

subgraph group_operations["Operations Control"]
  node_ops_app["Operations App<br/>[App.jsx]"]
  node_project_progress["Projects and Progress"]
  node_ops_approval["Expense and Advance Approval"]
  node_ops_dashboard["Operations Dashboard"]
  node_admin_controls["Organization and Team Oversight"]
  node_admin_dashboard["Admin Dashboard"]
end

subgraph group_finance["Accounts and Oversight"]
  node_admin_app["Admin App<br/>[App.jsx]"]
  node_accountant_app["Accounts App<br/>[App.jsx]"]
  node_accounting["Verification and Payments"]
  node_financial_reports["Ledger and Reports"]
  node_accountant_dashboard["Accounts Dashboard"]
  node_accountant_api["Accounts API Client<br/>[accountantApi.js]"]
end

node_user(("User"))
node_backend["ASEMS Backend"]

node_user -->|"signs in"| node_portal
node_portal -->|"authenticates"| node_backend
node_portal -->|"routes by role"| node_admin_app
node_portal -->|"routes by role"| node_ops_app
node_portal -->|"routes by role"| node_accountant_app
node_portal -->|"routes by role"| node_supervisor_app
node_admin_app -->|"renders"| node_admin_dashboard
node_ops_app -->|"renders"| node_ops_dashboard
node_accountant_app -->|"renders"| node_accountant_dashboard
node_supervisor_app -->|"routes to"| node_field_dashboard
node_supervisor_app -->|"provides"| node_wallet
node_field_dashboard -->|"uses"| node_wallet
node_public_form -->|"records expense"| node_wallet
node_wallet -->|"reads and writes"| node_backend
node_ops_dashboard -->|"presents"| node_project_progress
node_ops_dashboard -->|"presents"| node_ops_approval
node_admin_dashboard -->|"presents"| node_admin_controls
node_accountant_dashboard -->|"presents"| node_accounting
node_accountant_dashboard -->|"presents"| node_financial_reports
node_accountant_dashboard -->|"uses"| node_accountant_api
node_accountant_api -->|"requests data"| node_backend
node_ops_approval -.->|"submits decisions"| node_backend
node_admin_controls -.->|"manages records"| node_backend
node_accounting -.->|"verifies and pays"| node_backend

click node_portal "https://github.com/smartbuddy1/frontend_expense/blob/main/src/App.jsx"
click node_admin_app "https://github.com/smartbuddy1/frontend_expense/blob/main/src/modules/Admin/App.jsx"
click node_ops_app "https://github.com/smartbuddy1/frontend_expense/blob/main/src/modules/Operations/App.jsx"
click node_accountant_app "https://github.com/smartbuddy1/frontend_expense/blob/main/src/modules/Accountant/App.jsx"
click node_supervisor_app "https://github.com/smartbuddy1/frontend_expense/blob/main/src/modules/SiteSupervisor/App.jsx"
click node_field_dashboard "https://github.com/smartbuddy1/frontend_expense/tree/main/src/modules/SiteSupervisor/pages"
click node_wallet "https://github.com/smartbuddy1/frontend_expense/blob/main/src/modules/SiteSupervisor/context/WalletContext.jsx"
click node_public_form "https://github.com/smartbuddy1/frontend_expense/blob/main/src/modules/SiteSupervisor/pages/PublicExpenseForm.jsx"
click node_project_progress "https://github.com/smartbuddy1/frontend_expense/tree/main/src/modules/Operations/components/operations"
click node_ops_approval "https://github.com/smartbuddy1/frontend_expense/tree/main/src/modules/Operations/components/operations"
click node_ops_dashboard "https://github.com/smartbuddy1/frontend_expense/blob/main/src/modules/Operations/pages/OperationsDashboard.jsx"
click node_admin_controls "https://github.com/smartbuddy1/frontend_expense/tree/main/src/modules/Admin/components/operations"
click node_admin_dashboard "https://github.com/smartbuddy1/frontend_expense/blob/main/src/modules/Admin/pages/OperationsDashboard.jsx"
click node_accounting "https://github.com/smartbuddy1/frontend_expense/tree/main/src/modules/Accountant/components/accounts"
click node_financial_reports "https://github.com/smartbuddy1/frontend_expense/tree/main/src/modules/Accountant/components/accounts"
click node_accountant_dashboard "https://github.com/smartbuddy1/frontend_expense/blob/main/src/modules/Accountant/pages/AccountsDashboard.jsx"
click node_accountant_api "https://github.com/smartbuddy1/frontend_expense/blob/main/src/modules/Accountant/api/accountantApi.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_portal,node_user toneBlue
class node_supervisor_app,node_field_dashboard,node_wallet,node_public_form toneAmber
class node_ops_app,node_project_progress,node_ops_approval,node_ops_dashboard,node_admin_controls,node_admin_dashboard toneMint
class node_admin_app,node_accountant_app,node_accounting,node_financial_reports,node_accountant_dashboard,node_accountant_api toneRose
class node_backend toneIndigo
```

## Components

### Portal Entry

- [Login and Routing](https://github.com/smartbuddy1/frontend_expense/blob/main/src/App.jsx): `src/App.jsx`

### Field Supervision

- [Supervisor App](https://github.com/smartbuddy1/frontend_expense/blob/main/src/modules/SiteSupervisor/App.jsx): `src/modules/SiteSupervisor/App.jsx`
- [Field Expense Workflows](https://github.com/smartbuddy1/frontend_expense/tree/main/src/modules/SiteSupervisor/pages): `src/modules/SiteSupervisor/pages`
- [Wallet and Expense API](https://github.com/smartbuddy1/frontend_expense/blob/main/src/modules/SiteSupervisor/context/WalletContext.jsx): `src/modules/SiteSupervisor/context/WalletContext.jsx`
- [Public Expense Form](https://github.com/smartbuddy1/frontend_expense/blob/main/src/modules/SiteSupervisor/pages/PublicExpenseForm.jsx): `src/modules/SiteSupervisor/pages/PublicExpenseForm.jsx`

### Operations Control

- [Operations App](https://github.com/smartbuddy1/frontend_expense/blob/main/src/modules/Operations/App.jsx): `src/modules/Operations/App.jsx`
- [Projects and Progress](https://github.com/smartbuddy1/frontend_expense/tree/main/src/modules/Operations/components/operations): `src/modules/Operations/components/operations`
- [Expense and Advance Approval](https://github.com/smartbuddy1/frontend_expense/tree/main/src/modules/Operations/components/operations): `src/modules/Operations/components/operations`
- [Operations Dashboard](https://github.com/smartbuddy1/frontend_expense/blob/main/src/modules/Operations/pages/OperationsDashboard.jsx): `src/modules/Operations/pages/OperationsDashboard.jsx`
- [Organization and Team Oversight](https://github.com/smartbuddy1/frontend_expense/tree/main/src/modules/Admin/components/operations): `src/modules/Admin/components/operations`
- [Admin Dashboard](https://github.com/smartbuddy1/frontend_expense/blob/main/src/modules/Admin/pages/OperationsDashboard.jsx): `src/modules/Admin/pages/OperationsDashboard.jsx`

### Accounts and Oversight

- [Admin App](https://github.com/smartbuddy1/frontend_expense/blob/main/src/modules/Admin/App.jsx): `src/modules/Admin/App.jsx`
- [Accounts App](https://github.com/smartbuddy1/frontend_expense/blob/main/src/modules/Accountant/App.jsx): `src/modules/Accountant/App.jsx`
- [Verification and Payments](https://github.com/smartbuddy1/frontend_expense/tree/main/src/modules/Accountant/components/accounts): `src/modules/Accountant/components/accounts`
- [Ledger and Reports](https://github.com/smartbuddy1/frontend_expense/tree/main/src/modules/Accountant/components/accounts): `src/modules/Accountant/components/accounts`
- [Accounts Dashboard](https://github.com/smartbuddy1/frontend_expense/blob/main/src/modules/Accountant/pages/AccountsDashboard.jsx): `src/modules/Accountant/pages/AccountsDashboard.jsx`
- [Accounts API Client](https://github.com/smartbuddy1/frontend_expense/blob/main/src/modules/Accountant/api/accountantApi.js): `src/modules/Accountant/api/accountantApi.js`

### Other components

- **User**
- **ASEMS Backend**

## Connections

- User → Login and Routing: signs in
- Login and Routing → ASEMS Backend: authenticates
- Login and Routing → Admin App: routes by role
- Login and Routing → Operations App: routes by role
- Login and Routing → Accounts App: routes by role
- Login and Routing → Supervisor App: routes by role
- Admin App → Admin Dashboard: renders
- Operations App → Operations Dashboard: renders
- Accounts App → Accounts Dashboard: renders
- Supervisor App → Field Expense Workflows: routes to
- Supervisor App → Wallet and Expense API: provides
- Field Expense Workflows → Wallet and Expense API: uses
- Public Expense Form → Wallet and Expense API: records expense
- Wallet and Expense API → ASEMS Backend: reads and writes
- Operations Dashboard → Projects and Progress: presents
- Operations Dashboard → Expense and Advance Approval: presents
- Admin Dashboard → Organization and Team Oversight: presents
- Accounts Dashboard → Verification and Payments: presents
- Accounts Dashboard → Ledger and Reports: presents
- Accounts Dashboard → Accounts API Client: uses
- Accounts API Client → ASEMS Backend: requests data
- Expense and Advance Approval → ASEMS Backend: submits decisions
- Organization and Team Oversight → ASEMS Backend: manages records
- Verification and Payments → ASEMS Backend: verifies and pays
