# abhishek8827/tvsm_erp_and_fms architecture

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

- Interactive diagram: https://gitdiagram.com/abhishek8827/tvsm_erp_and_fms
- Repository: https://github.com/abhishek8827/tvsm_erp_and_fms

## Overview

TVSM is a school ERP for student admissions and records, fee collection and accounting, certificates, and administration. Staff sign in, enter the role-appropriate workspace, and use its pages to perform school and finance operations through the API, which persists tenant-scoped data in MongoDB. The graph emphasizes fee workflows where source excerpts show the calls; other major route families are retained from the API registration and repository tree. Several feature implementations were not sampled, so their internal links are omitted rather than inferred.

Main entry points: [`apps/api/src/app.js`](https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/api/src/app.js) (Express API routing), [`apps/web/src/api/client.js`](https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/web/src/api/client.js) (API client), [`apps/web/src/App.jsx`](https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/web/src/App.jsx) (Role-based workspace), [`apps/api/src/routes/feesDatabase.js`](https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/api/src/routes/feesDatabase.js) (Fee database routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web workspace"]
  node_webapp["Role-based workspace<br/>[App.jsx]"]
  node_shell["Navigation shell<br/>[AppShell.jsx]"]
  node_apiclient["API client<br/>[client.js]"]
  node_feeui["Fee collection<br/>[CollectFee.jsx]"]
  node_feesui["Fee records<br/>[FeesDatabase.jsx]"]
  node_certui["Certificate workflows<br/>[Tc.jsx]"]
end

subgraph group_identity["Identity and access"]
  node_authui["Web authentication<br/>[AuthContext.jsx]"]
  node_authapi["Authentication routes<br/>[auth.js]"]
  node_firebase["Firebase identity<br/>[firebase.js]"]
end

subgraph group_api["API and domain services"]
  node_apiapp["Express API routing<br/>[app.js]"]
  node_mongodata[("MongoDB persistence<br/>[db.js]")]
  node_certificates["Certificate routes<br/>[certificates.js]"]
  node_studentrecords["Admissions and student records<br/>[admissions.js]"]
end

subgraph group_finance["Finance and records"]
  node_feeeroute["Fee database routes<br/>[feesDatabase.js]"]
  node_feecalc["Fee database calculations<br/>[feesDatabase.js]"]
  node_money["Money operations<br/>[moneyStore.js]"]
  node_accounting["Cashbook and day close<br/>[cashbook.js]"]
  node_reports["Reports and exports<br/>[reports.js]"]
end

subgraph group_shared["Shared rules"]
  node_sharedmoney["Shared fee and money rules<br/>[money.js]"]
end

node_staff(("School staff"))

node_staff -->|"uses"| node_webapp
node_webapp -->|"checks session"| node_authui
node_webapp -->|"renders workspace"| node_shell
node_shell -->|"offers navigation"| node_staff
node_authui -->|"loads session"| node_apiclient
node_feeui -->|"requests fee operations"| node_apiclient
node_feesui -->|"requests fee records"| node_apiclient
node_certui -->|"requests certificates"| node_apiclient
node_apiclient -.->|"sends HTTP requests"| node_apiapp
node_apiapp -->|"mounts routes"| node_authapi
node_apiapp -->|"mounts routes"| node_feeeroute
node_apiapp -->|"mounts routes"| node_certificates
node_apiapp -->|"mounts routes"| node_studentrecords
node_apiapp -->|"mounts routes"| node_accounting
node_apiapp -->|"mounts routes"| node_reports
node_feeeroute -->|"builds fee rows"| node_feecalc
node_feecalc -->|"computes dues"| node_sharedmoney
node_authapi -.->|"verifies identity"| node_firebase
node_apiapp -.->|"uses database"| node_mongodata
node_feeeroute -.->|"uses finance stores"| node_money

click node_webapp "https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/web/src/App.jsx"
click node_shell "https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/web/src/layout/AppShell.jsx"
click node_authui "https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/web/src/auth/AuthContext.jsx"
click node_apiclient "https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/web/src/api/client.js"
click node_feeui "https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/web/src/pages/CollectFee.jsx"
click node_feesui "https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/web/src/pages/FeesDatabase.jsx"
click node_certui "https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/web/src/pages/certificates/Tc.jsx"
click node_apiapp "https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/api/src/app.js"
click node_authapi "https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/api/src/routes/auth.js"
click node_firebase "https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/api/src/auth/firebase.js"
click node_mongodata "https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/api/src/db.js"
click node_feeeroute "https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/api/src/routes/feesDatabase.js"
click node_feecalc "https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/api/src/services/feesDatabase.js"
click node_money "https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/api/src/services/moneyStore.js"
click node_certificates "https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/api/src/routes/certificates.js"
click node_studentrecords "https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/api/src/routes/admissions.js"
click node_accounting "https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/api/src/routes/cashbook.js"
click node_reports "https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/api/src/routes/reports.js"
click node_sharedmoney "https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/packages/shared/src/money.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_webapp,node_shell,node_apiclient,node_feeui,node_feesui,node_certui toneBlue
class node_authui,node_authapi,node_firebase toneAmber
class node_apiapp,node_mongodata,node_certificates,node_studentrecords toneMint
class node_feeeroute,node_feecalc,node_money,node_accounting,node_reports toneRose
class node_sharedmoney,node_staff toneIndigo
```

## Components

### Web workspace

- [Role-based workspace](https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/web/src/App.jsx): `apps/web/src/App.jsx`
- [Navigation shell](https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/web/src/layout/AppShell.jsx): `apps/web/src/layout/AppShell.jsx`
- [API client](https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/web/src/api/client.js): `apps/web/src/api/client.js`
- [Fee collection](https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/web/src/pages/CollectFee.jsx): `apps/web/src/pages/CollectFee.jsx`
- [Fee records](https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/web/src/pages/FeesDatabase.jsx): `apps/web/src/pages/FeesDatabase.jsx`
- [Certificate workflows](https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/web/src/pages/certificates/Tc.jsx): `apps/web/src/pages/certificates/Tc.jsx`

### Identity and access

- [Web authentication](https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/web/src/auth/AuthContext.jsx): `apps/web/src/auth/AuthContext.jsx`
- [Authentication routes](https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/api/src/routes/auth.js): `apps/api/src/routes/auth.js`
- [Firebase identity](https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/api/src/auth/firebase.js): `apps/api/src/auth/firebase.js`

### API and domain services

- [Express API routing](https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/api/src/app.js): `apps/api/src/app.js`
- [MongoDB persistence](https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/api/src/db.js): `apps/api/src/db.js`
- [Certificate routes](https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/api/src/routes/certificates.js): `apps/api/src/routes/certificates.js`
- [Admissions and student records](https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/api/src/routes/admissions.js): `apps/api/src/routes/admissions.js`

### Finance and records

- [Fee database routes](https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/api/src/routes/feesDatabase.js): `apps/api/src/routes/feesDatabase.js`
- [Fee database calculations](https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/api/src/services/feesDatabase.js): `apps/api/src/services/feesDatabase.js`
- [Money operations](https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/api/src/services/moneyStore.js): `apps/api/src/services/moneyStore.js`
- [Cashbook and day close](https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/api/src/routes/cashbook.js): `apps/api/src/routes/cashbook.js`
- [Reports and exports](https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/apps/api/src/routes/reports.js): `apps/api/src/routes/reports.js`

### Shared rules

- [Shared fee and money rules](https://github.com/abhishek8827/tvsm_erp_and_fms/blob/main/packages/shared/src/money.js): `packages/shared/src/money.js`

### Other components

- **School staff**

## Connections

- School staff → Role-based workspace: uses
- Role-based workspace → Web authentication: checks session (evidence: `apps/web/src/App.jsx`)
- Role-based workspace → Navigation shell: renders workspace (evidence: `apps/web/src/App.jsx`)
- Navigation shell → School staff: offers navigation (evidence: `apps/web/src/layout/AppShell.jsx`)
- Web authentication → API client: loads session (evidence: `apps/web/src/auth/AuthContext.jsx`)
- Fee collection → API client: requests fee operations (evidence: `apps/web/src/pages/CollectFee.jsx`)
- Fee records → API client: requests fee records (evidence: `apps/web/src/pages/FeesDatabase.jsx`)
- Certificate workflows → API client: requests certificates (evidence: `apps/web/src/pages/certificates/Tc.jsx`)
- API client → Express API routing: sends HTTP requests
- Express API routing → Authentication routes: mounts routes (evidence: `apps/api/src/app.js`)
- Express API routing → Fee database routes: mounts routes (evidence: `apps/api/src/app.js`)
- Express API routing → Certificate routes: mounts routes (evidence: `apps/api/src/app.js`)
- Express API routing → Admissions and student records: mounts routes (evidence: `apps/api/src/app.js`)
- Express API routing → Cashbook and day close: mounts routes (evidence: `apps/api/src/app.js`)
- Express API routing → Reports and exports: mounts routes (evidence: `apps/api/src/app.js`)
- Fee database routes → Fee database calculations: builds fee rows (evidence: `apps/api/src/routes/feesDatabase.js`)
- Fee database calculations → Shared fee and money rules: computes dues (evidence: `apps/api/src/services/feesDatabase.js`)
- Authentication routes → Firebase identity: verifies identity
- Express API routing → MongoDB persistence: uses database
- Fee database routes → Money operations: uses finance stores
