# anjan0205/collegefinance architecture

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

- Interactive diagram: https://gitdiagram.com/anjan0205/collegefinance
- Repository: https://github.com/anjan0205/collegefinance

## Overview

This is a college budget and purchase-requisition monitoring system: users authenticate, inspect budget and PR analytics, review department/budget details, and import Excel workbooks for financial tracking. The repository also contains a broader ERP-facing area for RFQs, approvals, inventory, receipts, invoices, and related records, although the README distinguishes its monitoring scope from a full procurement transaction engine. Evidence is strongest for sampled routing, API fallback, dashboard aggregation, and persistence; unsampled areas are represented only where the README or source index supports them.

Main entry points: [`backend/src/routes/index.ts`](https://github.com/anjan0205/collegefinance/blob/main/backend/src/routes/index.ts) (API route registry), [`frontend/src/App.tsx`](https://github.com/anjan0205/collegefinance/blob/main/frontend/src/App.tsx) (Application routes), [`frontend/src/services/api.ts`](https://github.com/anjan0205/collegefinance/blob/main/frontend/src/services/api.ts) (API client), [`backend/src/utils/seedData.ts`](https://github.com/anjan0205/collegefinance/blob/main/backend/src/utils/seedData.ts) (Financial data access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_app["Application routes<br/>[App.tsx]"]
  node_session["Authentication context<br/>[AuthContext.tsx]"]
  node_clientapi["API client<br/>[api.ts]"]
end

subgraph group_monitoring["Financial monitoring"]
  node_dashboard["Financial dashboard<br/>[Dashboard.tsx]"]
  node_budgetviews["Budget and departments<br/>[MasterBudget.tsx]"]
  node_prviews["PR tracking<br/>[PRManagement.tsx]"]
  node_reports["Financial reports<br/>[Reports.tsx]"]
  node_imports["Workbook import<br/>[DataImport.tsx]"]
end

subgraph group_erp["ERP workflows"]
  node_erpviews["ERP pages"]
  node_erpctl["ERP operations<br/>[erpController.ts]"]
  node_rfqctl["RFQ operations<br/>[rfqController.ts]"]
  node_approval["Approval engine<br/>[approvalEngine.ts]"]
end

subgraph group_backend["Backend services"]
  node_backendapp["Express application<br/>[app.ts]"]
  node_routes["API route registry<br/>[index.ts]"]
  node_dashboardctl["Dashboard aggregation"]
  node_budgetctl["Budget operations"]
  node_prctl["PR tracking operations<br/>[prController.ts]"]
  node_reportctl["Report operations"]
  node_importctl["Import operations"]
  node_excel["Excel processing"]
  node_seeddata["Financial data access<br/>[seedData.ts]"]
end

subgraph group_storage["Data stores"]
  node_firebaseclient["Firebase client engine"]
  node_firestore[("Firestore<br/>[firebase.ts]")]
  node_postgres[("PostgreSQL")]
  node_sqlite[("SQLite<br/>[sqlDatabase.ts]")]
end

node_users(("College users"))

node_users -->|"use"| node_app
node_app -->|"provides session"| node_session
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_budgetviews
node_app -->|"routes to"| node_prviews
node_app -->|"routes to"| node_reports
node_app -->|"routes to"| node_imports
node_app -->|"routes to"| node_erpviews
node_session -->|"requests profile"| node_clientapi
node_dashboard -.->|"requests data"| node_clientapi
node_budgetviews -->|"requests data"| node_clientapi
node_prviews -.->|"requests data"| node_clientapi
node_reports -.->|"requests data"| node_clientapi
node_imports -.->|"uploads workbook"| node_clientapi
node_erpviews -.->|"requests ERP data"| node_clientapi
node_clientapi -->|"delegates requests"| node_firebaseclient
node_clientapi -->|"sends REST requests"| node_backendapp
node_backendapp -->|"mounts routes"| node_routes
node_routes -->|"routes requests"| node_dashboardctl
node_routes -->|"routes requests"| node_budgetctl
node_routes -->|"routes requests"| node_prctl
node_routes -->|"routes requests"| node_reportctl
node_routes -->|"routes requests"| node_importctl
node_routes -->|"routes ERP calls"| node_erpctl
node_routes -->|"routes RFQ calls"| node_rfqctl
node_routes -->|"dispatches matrix calls"| node_approval
node_dashboardctl -->|"reads financial data"| node_seeddata
node_importctl -.->|"processes workbooks"| node_excel
node_excel -->|"updates imported data"| node_seeddata
node_seeddata -->|"reads and writes"| node_firestore
node_seeddata -->|"queries and writes"| node_postgres
node_seeddata -.->|"persists data"| node_sqlite
node_firebaseclient -->|"reads and writes"| node_firestore

click node_app "https://github.com/anjan0205/collegefinance/blob/main/frontend/src/App.tsx"
click node_session "https://github.com/anjan0205/collegefinance/blob/main/frontend/src/contexts/AuthContext.tsx"
click node_clientapi "https://github.com/anjan0205/collegefinance/blob/main/frontend/src/services/api.ts"
click node_firebaseclient "https://github.com/anjan0205/collegefinance/blob/main/frontend/src/services/firebaseClientService.ts"
click node_dashboard "https://github.com/anjan0205/collegefinance/blob/main/frontend/src/pages/Dashboard.tsx"
click node_budgetviews "https://github.com/anjan0205/collegefinance/blob/main/frontend/src/pages/MasterBudget.tsx"
click node_prviews "https://github.com/anjan0205/collegefinance/blob/main/frontend/src/pages/PRManagement.tsx"
click node_reports "https://github.com/anjan0205/collegefinance/blob/main/frontend/src/pages/Reports.tsx"
click node_imports "https://github.com/anjan0205/collegefinance/blob/main/frontend/src/pages/DataImport.tsx"
click node_erpviews "https://github.com/anjan0205/collegefinance/tree/main/frontend/src/pages/erp"
click node_backendapp "https://github.com/anjan0205/collegefinance/blob/main/backend/src/app.ts"
click node_routes "https://github.com/anjan0205/collegefinance/blob/main/backend/src/routes/index.ts"
click node_dashboardctl "https://github.com/anjan0205/collegefinance/blob/main/backend/src/controllers/dashboardController.ts"
click node_budgetctl "https://github.com/anjan0205/collegefinance/blob/main/backend/src/controllers/budgetController.ts"
click node_prctl "https://github.com/anjan0205/collegefinance/blob/main/backend/src/controllers/prController.ts"
click node_reportctl "https://github.com/anjan0205/collegefinance/blob/main/backend/src/controllers/reportController.ts"
click node_importctl "https://github.com/anjan0205/collegefinance/blob/main/backend/src/controllers/importController.ts"
click node_excel "https://github.com/anjan0205/collegefinance/blob/main/backend/src/services/excelImportService.ts"
click node_erpctl "https://github.com/anjan0205/collegefinance/blob/main/backend/src/controllers/erpController.ts"
click node_rfqctl "https://github.com/anjan0205/collegefinance/blob/main/backend/src/controllers/rfqController.ts"
click node_approval "https://github.com/anjan0205/collegefinance/blob/main/backend/src/services/approvalEngine.ts"
click node_seeddata "https://github.com/anjan0205/collegefinance/blob/main/backend/src/utils/seedData.ts"
click node_firestore "https://github.com/anjan0205/collegefinance/blob/main/backend/src/config/firebase.ts"
click node_postgres "https://github.com/anjan0205/collegefinance/blob/main/backend/src/config/postgresDatabase.ts"
click node_sqlite "https://github.com/anjan0205/collegefinance/blob/main/backend/src/config/sqlDatabase.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_session,node_clientapi,node_users toneBlue
class node_dashboard,node_budgetviews,node_prviews,node_reports,node_imports toneAmber
class node_erpviews,node_erpctl,node_rfqctl,node_approval toneMint
class node_backendapp,node_routes,node_dashboardctl,node_budgetctl,node_prctl,node_reportctl,node_importctl,node_excel,node_seeddata toneRose
class node_firebaseclient,node_firestore,node_postgres,node_sqlite toneIndigo
```

## Components

### Web experience

- [Application routes](https://github.com/anjan0205/collegefinance/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Authentication context](https://github.com/anjan0205/collegefinance/blob/main/frontend/src/contexts/AuthContext.tsx): `frontend/src/contexts/AuthContext.tsx`
- [API client](https://github.com/anjan0205/collegefinance/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`

### Financial monitoring

- [Financial dashboard](https://github.com/anjan0205/collegefinance/blob/main/frontend/src/pages/Dashboard.tsx): `frontend/src/pages/Dashboard.tsx`
- [Budget and departments](https://github.com/anjan0205/collegefinance/blob/main/frontend/src/pages/MasterBudget.tsx): `frontend/src/pages/MasterBudget.tsx`
- [PR tracking](https://github.com/anjan0205/collegefinance/blob/main/frontend/src/pages/PRManagement.tsx): `frontend/src/pages/PRManagement.tsx`
- [Financial reports](https://github.com/anjan0205/collegefinance/blob/main/frontend/src/pages/Reports.tsx): `frontend/src/pages/Reports.tsx`
- [Workbook import](https://github.com/anjan0205/collegefinance/blob/main/frontend/src/pages/DataImport.tsx): `frontend/src/pages/DataImport.tsx`

### ERP workflows

- [ERP pages](https://github.com/anjan0205/collegefinance/tree/main/frontend/src/pages/erp): `frontend/src/pages/erp`
- [ERP operations](https://github.com/anjan0205/collegefinance/blob/main/backend/src/controllers/erpController.ts): `backend/src/controllers/erpController.ts`
- [RFQ operations](https://github.com/anjan0205/collegefinance/blob/main/backend/src/controllers/rfqController.ts): `backend/src/controllers/rfqController.ts`
- [Approval engine](https://github.com/anjan0205/collegefinance/blob/main/backend/src/services/approvalEngine.ts): `backend/src/services/approvalEngine.ts`

### Backend services

- [Express application](https://github.com/anjan0205/collegefinance/blob/main/backend/src/app.ts): `backend/src/app.ts`
- [API route registry](https://github.com/anjan0205/collegefinance/blob/main/backend/src/routes/index.ts): `backend/src/routes/index.ts`
- [Dashboard aggregation](https://github.com/anjan0205/collegefinance/blob/main/backend/src/controllers/dashboardController.ts): `backend/src/controllers/dashboardController.ts`
- [Budget operations](https://github.com/anjan0205/collegefinance/blob/main/backend/src/controllers/budgetController.ts): `backend/src/controllers/budgetController.ts`
- [PR tracking operations](https://github.com/anjan0205/collegefinance/blob/main/backend/src/controllers/prController.ts): `backend/src/controllers/prController.ts`
- [Report operations](https://github.com/anjan0205/collegefinance/blob/main/backend/src/controllers/reportController.ts): `backend/src/controllers/reportController.ts`
- [Import operations](https://github.com/anjan0205/collegefinance/blob/main/backend/src/controllers/importController.ts): `backend/src/controllers/importController.ts`
- [Excel processing](https://github.com/anjan0205/collegefinance/blob/main/backend/src/services/excelImportService.ts): `backend/src/services/excelImportService.ts`
- [Financial data access](https://github.com/anjan0205/collegefinance/blob/main/backend/src/utils/seedData.ts): `backend/src/utils/seedData.ts`

### Data stores

- [Firebase client engine](https://github.com/anjan0205/collegefinance/blob/main/frontend/src/services/firebaseClientService.ts): `frontend/src/services/firebaseClientService.ts`
- [Firestore](https://github.com/anjan0205/collegefinance/blob/main/backend/src/config/firebase.ts): `backend/src/config/firebase.ts`
- [PostgreSQL](https://github.com/anjan0205/collegefinance/blob/main/backend/src/config/postgresDatabase.ts): `backend/src/config/postgresDatabase.ts`
- [SQLite](https://github.com/anjan0205/collegefinance/blob/main/backend/src/config/sqlDatabase.ts): `backend/src/config/sqlDatabase.ts`

### Other components

- **College users**

## Connections

- College users → Application routes: use
- Application routes → Authentication context: provides session (evidence: `frontend/src/App.tsx`)
- Application routes → Financial dashboard: routes to (evidence: `frontend/src/App.tsx`)
- Application routes → Budget and departments: routes to (evidence: `frontend/src/App.tsx`)
- Application routes → PR tracking: routes to (evidence: `frontend/src/App.tsx`)
- Application routes → Financial reports: routes to (evidence: `frontend/src/App.tsx`)
- Application routes → Workbook import: routes to
- Application routes → ERP pages: routes to (evidence: `frontend/src/App.tsx`)
- Authentication context → API client: requests profile (evidence: `frontend/src/contexts/AuthContext.tsx`)
- Financial dashboard → API client: requests data
- Budget and departments → API client: requests data (evidence: `frontend/src/pages/MasterBudget.tsx`)
- PR tracking → API client: requests data
- Financial reports → API client: requests data
- Workbook import → API client: uploads workbook
- ERP pages → API client: requests ERP data
- API client → Firebase client engine: delegates requests (evidence: `frontend/src/services/api.ts`)
- API client → Express application: sends REST requests
- Express application → API route registry: mounts routes (evidence: `backend/src/app.ts`)
- API route registry → Dashboard aggregation: routes requests (evidence: `backend/src/routes/index.ts`)
- API route registry → Budget operations: routes requests (evidence: `backend/src/routes/index.ts`)
- API route registry → PR tracking operations: routes requests (evidence: `backend/src/routes/index.ts`)
- API route registry → Report operations: routes requests (evidence: `backend/src/routes/index.ts`)
- API route registry → Import operations: routes requests (evidence: `backend/src/routes/index.ts`)
- API route registry → ERP operations: routes ERP calls
- API route registry → RFQ operations: routes RFQ calls
- API route registry → Approval engine: dispatches matrix calls
- Dashboard aggregation → Financial data access: reads financial data (evidence: `backend/src/controllers/dashboardController.ts`)
- Import operations → Excel processing: processes workbooks
- Excel processing → Financial data access: updates imported data (evidence: `backend/src/services/excelImportService.ts`)
- Financial data access → Firestore: reads and writes (evidence: `backend/src/utils/seedData.ts`)
- Financial data access → PostgreSQL: queries and writes (evidence: `backend/src/utils/seedData.ts`)
- Financial data access → SQLite: persists data (evidence: `backend/src/utils/seedData.ts`)
- Firebase client engine → Firestore: reads and writes (evidence: `frontend/src/services/firebaseClientService.ts`)
