# gartgetget/pesoledger-accounting-financial-management-system architecture

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

- Interactive diagram: https://gitdiagram.com/gartgetget/pesoledger-accounting-financial-management-system
- Repository: https://github.com/gartgetget/pesoledger-accounting-financial-management-system

## Overview

ChaChing is a workspace-based accounting and operations application. Staff sign in, work in a selected accounting area (such as revenue, expenses, jobs, payroll, vehicles, or inventory), and review dashboards, reports, and period summaries. The frontend keeps shared accounting state and uses an API client; the Express backend authenticates requests, dispatches them to domain routes, and connects to MongoDB. The README documents only local startup, so feature coverage comes from the source tree and excerpts; several feature-to-route links are therefore omitted where request wiring was not shown.

Main entry points: [`src/App.tsx`](https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/src/App.tsx) (App navigation), [`src/context/AccountingContext.tsx`](https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/src/context/AccountingContext.tsx) (Accounting state), [`backend/routes`](https://github.com/gartgetget/pesoledger-accounting-financial-management-system/tree/main/backend/routes) (Domain routes), [`src/components/reports/ReportsView.tsx`](https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/src/components/reports/ReportsView.tsx) (Reports)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["App navigation<br/>[App.tsx]"]
  node_auth["Authentication state<br/>[AuthContext.tsx]"]
  node_accounting_state["Accounting state"]
  node_api_client["API client<br/>[client.ts]"]
  node_date_utils["Date filtering<br/>[date.ts]"]
  node_spreadsheet["Spreadsheet import/export<br/>[excel.ts]"]
end

subgraph group_accounting["Accounting operations"]
  node_accounting_views["Accounting views<br/>[RevenueView.tsx]"]
  node_daily["Daily accounting"]
  node_periods["Period summaries"]
  node_dashboard["Dashboard<br/>[DashboardView.tsx]"]
  node_reports["Reports<br/>[ReportsView.tsx]"]
end

subgraph group_operations["Business operations"]
  node_jobs["Job orders<br/>[JobModal.tsx]"]
  node_people["Customers and payroll<br/>[CustomersView.tsx]"]
  node_fleet["Vehicles<br/>[VehiclesView.tsx]"]
  node_stock["Inventory<br/>[InventoryView.tsx]"]
  node_settings["Workspace settings<br/>[SettingsView.tsx]"]
end

subgraph group_server["API and persistence"]
  node_server["Express API<br/>[index.ts]"]
  node_routes["Domain routes"]
  node_auth_middleware["Request authentication<br/>[auth.ts]"]
  node_router["Async router<br/>[createRouter.ts]"]
  node_models[("Domain records")]
  node_database[("MongoDB connection<br/>[db.ts]")]
end

node_user(("Staff user"))

node_user -->|"uses"| node_app
node_app -->|"checks session"| node_auth
node_app -->|"provides state"| node_accounting_state
node_app -->|"renders views"| node_accounting_views
node_app -->|"renders dashboard"| node_dashboard
node_app -->|"renders daily view"| node_daily
node_app -->|"renders summaries"| node_periods
node_app -->|"renders reports"| node_reports
node_app -->|"renders jobs"| node_jobs
node_app -->|"renders operations"| node_people
node_app -->|"renders vehicles"| node_fleet
node_app -->|"renders inventory"| node_stock
node_app -->|"renders settings"| node_settings
node_auth -->|"requests auth"| node_api_client
node_accounting_state -->|"requests data"| node_api_client
node_accounting_state -->|"calculates ranges"| node_date_utils
node_dashboard -->|"reads state"| node_accounting_state
node_daily -->|"reads state"| node_accounting_state
node_periods -.->|"reads state"| node_accounting_state
node_reports -->|"reads state"| node_accounting_state
node_reports -->|"exports data"| node_spreadsheet
node_stock -->|"imports data"| node_spreadsheet
node_fleet -->|"exports data"| node_spreadsheet
node_api_client -.->|"sends HTTP"| node_server
node_server -->|"mounts routes"| node_routes
node_routes -->|"authenticates requests"| node_auth_middleware
node_routes -->|"creates routers"| node_router
node_routes -->|"reads and writes"| node_models
node_server -->|"connects database"| node_database
node_auth_middleware -->|"looks up user"| node_models
node_routes -->|"synchronizes job revenue"| node_models

click node_app "https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/src/App.tsx"
click node_auth "https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/src/context/AuthContext.tsx"
click node_accounting_state "https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/src/context/AccountingContext.tsx"
click node_api_client "https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/src/api/client.ts"
click node_accounting_views "https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/src/components/revenue/RevenueView.tsx"
click node_daily "https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/src/components/daily/DailyAccountingView.tsx"
click node_periods "https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/src/components/monthly/MonthlyAccountingView.tsx"
click node_dashboard "https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/src/components/dashboard/DashboardView.tsx"
click node_reports "https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/src/components/reports/ReportsView.tsx"
click node_jobs "https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/src/components/jobs/JobModal.tsx"
click node_people "https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/src/components/customers/CustomersView.tsx"
click node_fleet "https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/src/components/vehicles/VehiclesView.tsx"
click node_stock "https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/src/components/inventory/InventoryView.tsx"
click node_settings "https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/src/components/settings/SettingsView.tsx"
click node_date_utils "https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/src/utils/date.ts"
click node_spreadsheet "https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/src/utils/excel.ts"
click node_server "https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/backend/index.ts"
click node_routes "https://github.com/gartgetget/pesoledger-accounting-financial-management-system/tree/main/backend/routes"
click node_auth_middleware "https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/backend/middleware/auth.ts"
click node_router "https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/backend/middleware/createRouter.ts"
click node_models "https://github.com/gartgetget/pesoledger-accounting-financial-management-system/tree/main/backend/models"
click node_database "https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/backend/db.ts"

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_auth,node_accounting_state,node_api_client,node_date_utils,node_spreadsheet,node_user toneBlue
class node_accounting_views,node_daily,node_periods,node_dashboard,node_reports toneAmber
class node_jobs,node_people,node_fleet,node_stock,node_settings toneMint
class node_server,node_routes,node_auth_middleware,node_router,node_models,node_database toneRose
```

## Components

### Web application

- [App navigation](https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/src/App.tsx): `src/App.tsx`
- [Authentication state](https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [Accounting state](https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/src/context/AccountingContext.tsx): `src/context/AccountingContext.tsx`
- [API client](https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/src/api/client.ts): `src/api/client.ts`
- [Date filtering](https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/src/utils/date.ts): `src/utils/date.ts`
- [Spreadsheet import/export](https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/src/utils/excel.ts): `src/utils/excel.ts`

### Accounting operations

- [Accounting views](https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/src/components/revenue/RevenueView.tsx): `src/components/revenue/RevenueView.tsx`
- [Daily accounting](https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/src/components/daily/DailyAccountingView.tsx): `src/components/daily/DailyAccountingView.tsx`
- [Period summaries](https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/src/components/monthly/MonthlyAccountingView.tsx): `src/components/monthly/MonthlyAccountingView.tsx`
- [Dashboard](https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/src/components/dashboard/DashboardView.tsx): `src/components/dashboard/DashboardView.tsx`
- [Reports](https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/src/components/reports/ReportsView.tsx): `src/components/reports/ReportsView.tsx`

### Business operations

- [Job orders](https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/src/components/jobs/JobModal.tsx): `src/components/jobs/JobModal.tsx`
- [Customers and payroll](https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/src/components/customers/CustomersView.tsx): `src/components/customers/CustomersView.tsx`
- [Vehicles](https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/src/components/vehicles/VehiclesView.tsx): `src/components/vehicles/VehiclesView.tsx`
- [Inventory](https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/src/components/inventory/InventoryView.tsx): `src/components/inventory/InventoryView.tsx`
- [Workspace settings](https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/src/components/settings/SettingsView.tsx): `src/components/settings/SettingsView.tsx`

### API and persistence

- [Express API](https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/backend/index.ts): `backend/index.ts`
- [Domain routes](https://github.com/gartgetget/pesoledger-accounting-financial-management-system/tree/main/backend/routes): `backend/routes`
- [Request authentication](https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/backend/middleware/auth.ts): `backend/middleware/auth.ts`
- [Async router](https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/backend/middleware/createRouter.ts): `backend/middleware/createRouter.ts`
- [Domain records](https://github.com/gartgetget/pesoledger-accounting-financial-management-system/tree/main/backend/models): `backend/models`
- [MongoDB connection](https://github.com/gartgetget/pesoledger-accounting-financial-management-system/blob/main/backend/db.ts): `backend/db.ts`

### Other components

- **Staff user**

## Connections

- Staff user → App navigation: uses (evidence: `src/App.tsx`)
- App navigation → Authentication state: checks session (evidence: `src/App.tsx`)
- App navigation → Accounting state: provides state (evidence: `src/App.tsx`)
- App navigation → Accounting views: renders views (evidence: `src/App.tsx`)
- App navigation → Dashboard: renders dashboard (evidence: `src/App.tsx`)
- App navigation → Daily accounting: renders daily view (evidence: `src/App.tsx`)
- App navigation → Period summaries: renders summaries (evidence: `src/App.tsx`)
- App navigation → Reports: renders reports (evidence: `src/App.tsx`)
- App navigation → Job orders: renders jobs (evidence: `src/App.tsx`)
- App navigation → Customers and payroll: renders operations (evidence: `src/App.tsx`)
- App navigation → Vehicles: renders vehicles (evidence: `src/App.tsx`)
- App navigation → Inventory: renders inventory (evidence: `src/App.tsx`)
- App navigation → Workspace settings: renders settings (evidence: `src/App.tsx`)
- Authentication state → API client: requests auth (evidence: `src/context/AuthContext.tsx`)
- Accounting state → API client: requests data (evidence: `src/context/AccountingContext.tsx`)
- Accounting state → Date filtering: calculates ranges (evidence: `src/context/AccountingContext.tsx`)
- Dashboard → Accounting state: reads state (evidence: `src/components/dashboard/DashboardView.tsx`)
- Daily accounting → Accounting state: reads state (evidence: `src/components/daily/DailyAccountingView.tsx`)
- Period summaries → Accounting state: reads state
- Reports → Accounting state: reads state (evidence: `src/components/reports/ReportsView.tsx`)
- Reports → Spreadsheet import/export: exports data (evidence: `src/components/reports/ReportsView.tsx`)
- Inventory → Spreadsheet import/export: imports data (evidence: `src/components/inventory/InventoryView.tsx`)
- Vehicles → Spreadsheet import/export: exports data (evidence: `src/components/vehicles/VehiclesView.tsx`)
- API client → Express API: sends HTTP
- Express API → Domain routes: mounts routes (evidence: `backend/index.ts`)
- Domain routes → Request authentication: authenticates requests (evidence: `backend/routes/jobOrderRoutes.ts`)
- Domain routes → Async router: creates routers (evidence: `backend/routes/jobOrderRoutes.ts`)
- Domain routes → Domain records: reads and writes (evidence: `backend/routes/jobOrderRoutes.ts`)
- Express API → MongoDB connection: connects database (evidence: `backend/index.ts`)
- Request authentication → Domain records: looks up user (evidence: `backend/middleware/auth.ts`)
- Domain routes → Domain records: synchronizes job revenue (evidence: `backend/routes/jobOrderRoutes.ts`)
