# zaramlt59/tmsv2 architecture

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

- Interactive diagram: https://gitdiagram.com/zaramlt59/tmsv2
- Repository: https://github.com/zaramlt59/tmsv2

## Overview

TMS is a government Teacher Management System: staff and administrators use a Vue application to manage teacher and school records, submit and approve transfers, and access reports and workforce analytics. The backend exposes an Express API, applies authentication and role-based access controls, and implements domain operations over MySQL. The map combines documented product capabilities with relationships visible in the supplied excerpts and source index; several feature areas are represented at directory level because their implementation files were not sampled.

Main entry points: [`frontend/src/App.vue`](https://github.com/zaramlt59/tmsv2/blob/main/frontend/src/App.vue) (TMS interface), [`src/app.ts`](https://github.com/zaramlt59/tmsv2/blob/main/src/app.ts) (HTTP API), [`src/routes/teacherRoutes.ts`](https://github.com/zaramlt59/tmsv2/blob/main/src/routes/teacherRoutes.ts) (Teacher routes), [`src/services/prismaService.ts`](https://github.com/zaramlt59/tmsv2/blob/main/src/services/prismaService.ts) (MySQL database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_spa["TMS interface<br/>[App.vue]"]
  node_authstate["Session state<br/>[auth.ts]"]
  node_dashboards["Dashboards"]
  node_teacherui["Teacher records UI<br/>[TeacherList.vue]"]
  node_transferui["Transfer workflows UI"]
  node_reportui["Reports UI"]
end

subgraph group_api["API and access"]
  node_api["HTTP API<br/>[app.ts]"]
  node_authmw["Authentication<br/>[auth.ts]"]
  node_rolefilter["Role access"]
  node_teacheroutes["Teacher routes<br/>[teacherRoutes.ts]"]
  node_transferoutes["Transfer routes"]
  node_workflows["Administrative workflows<br/>[workflowRoutes.ts]"]
end

subgraph group_domain["Domain services"]
  node_teachercontroller["Teacher operations"]
  node_transferservice["Transfer applications"]
  node_assignments["Approver assignments"]
  node_teacherdata["Teacher and school data<br/>[teacherService.ts]"]
  node_analytics["Reports and analytics"]
end

subgraph group_persistence["Persistence"]
  node_database[("MySQL database<br/>[prismaService.ts]")]
end

node_staff(("Staff and administrators"))
node_mailer["Email and SMS"]

node_staff -->|"uses"| node_spa
node_spa -->|"reads session"| node_authstate
node_spa -->|"presents"| node_dashboards
node_spa -->|"presents"| node_teacherui
node_spa -->|"presents"| node_transferui
node_spa -->|"presents"| node_reportui
node_spa -->|"calls API"| node_api
node_api -->|"applies"| node_authmw
node_authmw -->|"checks roles"| node_rolefilter
node_api -->|"mounts routes"| node_teacheroutes
node_teacheroutes -->|"authenticates"| node_authmw
node_teacheroutes -->|"filters access"| node_rolefilter
node_teacheroutes -->|"dispatches"| node_teachercontroller
node_teachercontroller -->|"uses"| node_teacherdata
node_teacherdata -->|"queries"| node_database
node_api -->|"mounts routes"| node_transferoutes
node_transferoutes -->|"handles requests"| node_transferservice
node_transferservice -->|"queries"| node_database
node_api -->|"mounts routes"| node_workflows
node_assignments -->|"queries"| node_database
node_analytics -.->|"reads records"| node_database
node_transferservice -.->|"notified by"| node_mailer

click node_spa "https://github.com/zaramlt59/tmsv2/blob/main/frontend/src/App.vue"
click node_authstate "https://github.com/zaramlt59/tmsv2/blob/main/frontend/src/stores/auth.ts"
click node_dashboards "https://github.com/zaramlt59/tmsv2/tree/main/frontend/src/views/dashboards"
click node_teacherui "https://github.com/zaramlt59/tmsv2/blob/main/frontend/src/views/TeacherList.vue"
click node_transferui "https://github.com/zaramlt59/tmsv2/blob/main/frontend/src/views/TransferApplication.vue"
click node_reportui "https://github.com/zaramlt59/tmsv2/blob/main/frontend/src/views/TransferReports.vue"
click node_api "https://github.com/zaramlt59/tmsv2/blob/main/src/app.ts"
click node_authmw "https://github.com/zaramlt59/tmsv2/blob/main/src/middleware/auth.ts"
click node_rolefilter "https://github.com/zaramlt59/tmsv2/blob/main/src/middleware/roleBasedFiltering.ts"
click node_teacheroutes "https://github.com/zaramlt59/tmsv2/blob/main/src/routes/teacherRoutes.ts"
click node_transferoutes "https://github.com/zaramlt59/tmsv2/blob/main/src/routes/transferApplicationRoutes.ts"
click node_workflows "https://github.com/zaramlt59/tmsv2/blob/main/src/routes/workflowRoutes.ts"
click node_teachercontroller "https://github.com/zaramlt59/tmsv2/blob/main/src/controllers/teacherController.ts"
click node_transferservice "https://github.com/zaramlt59/tmsv2/blob/main/src/services/transferApplicationService.ts"
click node_assignments "https://github.com/zaramlt59/tmsv2/blob/main/src/services/approverAssignmentService.ts"
click node_teacherdata "https://github.com/zaramlt59/tmsv2/blob/main/src/services/teacherService.ts"
click node_analytics "https://github.com/zaramlt59/tmsv2/tree/main/src/services"
click node_database "https://github.com/zaramlt59/tmsv2/blob/main/src/services/prismaService.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_spa,node_authstate,node_dashboards,node_teacherui,node_transferui,node_reportui toneBlue
class node_api,node_authmw,node_rolefilter,node_teacheroutes,node_transferoutes,node_workflows toneAmber
class node_teachercontroller,node_transferservice,node_assignments,node_teacherdata,node_analytics toneMint
class node_database toneRose
class node_staff,node_mailer toneIndigo
```

## Components

### Web application

- [TMS interface](https://github.com/zaramlt59/tmsv2/blob/main/frontend/src/App.vue): `frontend/src/App.vue`
- [Session state](https://github.com/zaramlt59/tmsv2/blob/main/frontend/src/stores/auth.ts): `frontend/src/stores/auth.ts`
- [Dashboards](https://github.com/zaramlt59/tmsv2/tree/main/frontend/src/views/dashboards): `frontend/src/views/dashboards`
- [Teacher records UI](https://github.com/zaramlt59/tmsv2/blob/main/frontend/src/views/TeacherList.vue): `frontend/src/views/TeacherList.vue`
- [Transfer workflows UI](https://github.com/zaramlt59/tmsv2/blob/main/frontend/src/views/TransferApplication.vue): `frontend/src/views/TransferApplication.vue`
- [Reports UI](https://github.com/zaramlt59/tmsv2/blob/main/frontend/src/views/TransferReports.vue): `frontend/src/views/TransferReports.vue`

### API and access

- [HTTP API](https://github.com/zaramlt59/tmsv2/blob/main/src/app.ts): `src/app.ts`
- [Authentication](https://github.com/zaramlt59/tmsv2/blob/main/src/middleware/auth.ts): `src/middleware/auth.ts`
- [Role access](https://github.com/zaramlt59/tmsv2/blob/main/src/middleware/roleBasedFiltering.ts): `src/middleware/roleBasedFiltering.ts`
- [Teacher routes](https://github.com/zaramlt59/tmsv2/blob/main/src/routes/teacherRoutes.ts): `src/routes/teacherRoutes.ts`
- [Transfer routes](https://github.com/zaramlt59/tmsv2/blob/main/src/routes/transferApplicationRoutes.ts): `src/routes/transferApplicationRoutes.ts`
- [Administrative workflows](https://github.com/zaramlt59/tmsv2/blob/main/src/routes/workflowRoutes.ts): `src/routes/workflowRoutes.ts`

### Domain services

- [Teacher operations](https://github.com/zaramlt59/tmsv2/blob/main/src/controllers/teacherController.ts): `src/controllers/teacherController.ts`
- [Transfer applications](https://github.com/zaramlt59/tmsv2/blob/main/src/services/transferApplicationService.ts): `src/services/transferApplicationService.ts`
- [Approver assignments](https://github.com/zaramlt59/tmsv2/blob/main/src/services/approverAssignmentService.ts): `src/services/approverAssignmentService.ts`
- [Teacher and school data](https://github.com/zaramlt59/tmsv2/blob/main/src/services/teacherService.ts): `src/services/teacherService.ts`
- [Reports and analytics](https://github.com/zaramlt59/tmsv2/tree/main/src/services): `src/services`

### Persistence

- [MySQL database](https://github.com/zaramlt59/tmsv2/blob/main/src/services/prismaService.ts): `src/services/prismaService.ts`

### Other components

- **Staff and administrators**
- **Email and SMS**

## Connections

- Staff and administrators → TMS interface: uses
- TMS interface → Session state: reads session (evidence: `frontend/src/App.vue`)
- TMS interface → Dashboards: presents
- TMS interface → Teacher records UI: presents
- TMS interface → Transfer workflows UI: presents
- TMS interface → Reports UI: presents
- TMS interface → HTTP API: calls API
- HTTP API → Authentication: applies (evidence: `src/app.ts`)
- Authentication → Role access: checks roles (evidence: `src/middleware/auth.ts`)
- HTTP API → Teacher routes: mounts routes (evidence: `src/app.ts`)
- Teacher routes → Authentication: authenticates (evidence: `src/routes/teacherRoutes.ts`)
- Teacher routes → Role access: filters access (evidence: `src/routes/teacherRoutes.ts`)
- Teacher routes → Teacher operations: dispatches (evidence: `src/routes/teacherRoutes.ts`)
- Teacher operations → Teacher and school data: uses (evidence: `src/controllers/teacherController.ts`)
- Teacher and school data → MySQL database: queries (evidence: `src/services/teacherService.ts`)
- HTTP API → Transfer routes: mounts routes (evidence: `src/app.ts`)
- Transfer routes → Transfer applications: handles requests (evidence: `src/services/transferApplicationService.ts`)
- Transfer applications → MySQL database: queries (evidence: `src/services/transferApplicationService.ts`)
- HTTP API → Administrative workflows: mounts routes (evidence: `src/app.ts`)
- Approver assignments → MySQL database: queries (evidence: `src/services/approverAssignmentService.ts`)
- Reports and analytics → MySQL database: reads records (evidence: `src/services/authService.ts`)
- Transfer applications → Email and SMS: notified by
