# namtrungdn310/tpro-classio architecture

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

- Interactive diagram: https://gitdiagram.com/namtrungdn310/tpro-classio
- Repository: https://github.com/namtrungdn310/tpro-classio

## Overview

TPRO Classio is an operations platform for an English-language learning centre. Staff use its dashboard to manage students and enrollments, classes and teaching schedules, attendance, fees and payments, then review operational and financial history. The frontend sends requests through a same-origin proxy to the FastAPI backend; backend services implement domain operations against PostgreSQL. Authentication, role controls, and external Google and Pay2S integrations are distinct supporting capabilities. The README documents broad capabilities; sampled excerpts are partial, so detailed wiring between several backend subsystems is not established here.

Main entry points: [`backend/app/main.py`](https://github.com/namtrungdn310/tpro-classio/blob/main/backend/app/main.py) (FastAPI application), [`frontend/src/lib/api`](https://github.com/namtrungdn310/tpro-classio/tree/main/frontend/src/lib/api) (API clients), [`backend/app/services`](https://github.com/namtrungdn310/tpro-classio/tree/main/backend/app/services) (Domain services), [`frontend/src/app/api/proxy/[...path]/route.ts`](https://github.com/namtrungdn310/tpro-classio/blob/main/frontend/src/app/api/proxy/%5B...path%5D/route.ts) (Session proxy)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Staff workspace"]
  node_dashboard["Dashboard<br/>[page.tsx]"]
  node_students_ui["Student management<br/>[page.tsx]"]
  node_classes_ui["Class management<br/>[page.tsx]"]
  node_attendance_ui["Attendance<br/>[page.tsx]"]
  node_fees_ui["Fee management<br/>[page.tsx]"]
  node_banking_ui["Banking<br/>[page.tsx]"]
  node_reports_ui["Reports<br/>[page.tsx]"]
  node_staff_ui["Staff management<br/>[page.tsx]"]
  node_frontend_api["API clients"]
  node_proxy["Session proxy<br/>[route.ts]"]
end

subgraph group_learning["Learning operations"]
  node_student_ops["Students and enrollment<br/>[students.py]"]
  node_class_ops["Classes and schedule<br/>[classes.py]"]
  node_attendance_ops["Attendance operations<br/>[attendance.py]"]
  node_staff_ops["Staff and payroll<br/>[staff.py]"]
end

subgraph group_finance["Finance operations"]
  node_fee_ops["Fees and payments<br/>[fees.py]"]
  node_banking_ops["Banking operations<br/>[banking.py]"]
  node_payment_webhook["Payment webhook<br/>[pay2s_webhook.py]"]
  node_reports_ops["Reporting<br/>[reports.py]"]
end

subgraph group_platform["Backend platform"]
  node_services["Domain services"]
  node_api_app["FastAPI application<br/>[main.py]"]
  node_database[("PostgreSQL<br/>[database.py]")]
end

subgraph group_identity["Identity and integrations"]
  node_auth_ui["Sign-in and setup<br/>[page.tsx]"]
  node_auth_ops["Authentication"]
end

node_staff(("Centre staff"))
node_google{{"Google identity"}}
node_pay2s{{"Pay2S"}}

node_staff -->|"uses"| node_dashboard
node_staff -->|"manages"| node_students_ui
node_staff -->|"manages"| node_classes_ui
node_staff -->|"records"| node_attendance_ui
node_staff -->|"manages"| node_fees_ui
node_staff -->|"reviews"| node_banking_ui
node_staff -->|"reviews"| node_reports_ui
node_staff -->|"manages"| node_staff_ui
node_dashboard -->|"requests data"| node_frontend_api
node_students_ui -->|"requests data"| node_frontend_api
node_classes_ui -->|"requests data"| node_frontend_api
node_attendance_ui -->|"requests data"| node_frontend_api
node_fees_ui -->|"requests data"| node_frontend_api
node_banking_ui -->|"requests data"| node_frontend_api
node_reports_ui -->|"requests data"| node_frontend_api
node_staff_ui -->|"requests data"| node_frontend_api
node_frontend_api -->|"sends requests"| node_proxy
node_proxy -->|"forwards requests"| node_api_app
node_api_app -->|"dispatches"| node_student_ops
node_api_app -->|"dispatches"| node_class_ops
node_api_app -->|"dispatches"| node_attendance_ops
node_api_app -->|"dispatches"| node_staff_ops
node_api_app -->|"dispatches"| node_fee_ops
node_api_app -->|"dispatches"| node_banking_ops
node_api_app -->|"dispatches"| node_payment_webhook
node_api_app -->|"dispatches"| node_reports_ops
node_student_ops -->|"uses"| node_services
node_class_ops -->|"uses"| node_services
node_attendance_ops -->|"uses"| node_services
node_staff_ops -->|"uses"| node_services
node_fee_ops -->|"uses"| node_services
node_banking_ops -->|"uses"| node_services
node_reports_ops -->|"uses"| node_services
node_services -->|"reads and writes"| node_database
node_staff -->|"signs in"| node_auth_ui
node_auth_ui -->|"starts session"| node_proxy
node_proxy -->|"forwards auth"| node_auth_ops
node_auth_ops -->|"uses"| node_services
node_auth_ops -.->|"verifies identity"| node_google
node_payment_webhook -.->|"receives events"| node_pay2s

click node_dashboard "https://github.com/namtrungdn310/tpro-classio/blob/main/frontend/src/app/(dashboard)/page.tsx"
click node_students_ui "https://github.com/namtrungdn310/tpro-classio/blob/main/frontend/src/app/(dashboard)/students/page.tsx"
click node_classes_ui "https://github.com/namtrungdn310/tpro-classio/blob/main/frontend/src/app/(dashboard)/classes/page.tsx"
click node_attendance_ui "https://github.com/namtrungdn310/tpro-classio/blob/main/frontend/src/app/attendance/page.tsx"
click node_fees_ui "https://github.com/namtrungdn310/tpro-classio/blob/main/frontend/src/app/(dashboard)/fees/page.tsx"
click node_banking_ui "https://github.com/namtrungdn310/tpro-classio/blob/main/frontend/src/app/(dashboard)/banking/page.tsx"
click node_reports_ui "https://github.com/namtrungdn310/tpro-classio/blob/main/frontend/src/app/(dashboard)/report/page.tsx"
click node_staff_ui "https://github.com/namtrungdn310/tpro-classio/blob/main/frontend/src/app/(dashboard)/staff/page.tsx"
click node_frontend_api "https://github.com/namtrungdn310/tpro-classio/tree/main/frontend/src/lib/api"
click node_proxy "https://github.com/namtrungdn310/tpro-classio/blob/main/frontend/src/app/api/proxy/%5B...path%5D/route.ts"
click node_student_ops "https://github.com/namtrungdn310/tpro-classio/blob/main/backend/app/routers/students.py"
click node_class_ops "https://github.com/namtrungdn310/tpro-classio/blob/main/backend/app/routers/classes.py"
click node_attendance_ops "https://github.com/namtrungdn310/tpro-classio/blob/main/backend/app/routers/attendance.py"
click node_staff_ops "https://github.com/namtrungdn310/tpro-classio/blob/main/backend/app/routers/staff.py"
click node_fee_ops "https://github.com/namtrungdn310/tpro-classio/blob/main/backend/app/routers/fees.py"
click node_banking_ops "https://github.com/namtrungdn310/tpro-classio/blob/main/backend/app/routers/banking.py"
click node_payment_webhook "https://github.com/namtrungdn310/tpro-classio/blob/main/backend/app/routers/pay2s_webhook.py"
click node_reports_ops "https://github.com/namtrungdn310/tpro-classio/blob/main/backend/app/routers/reports.py"
click node_services "https://github.com/namtrungdn310/tpro-classio/tree/main/backend/app/services"
click node_api_app "https://github.com/namtrungdn310/tpro-classio/blob/main/backend/app/main.py"
click node_database "https://github.com/namtrungdn310/tpro-classio/blob/main/backend/app/core/database.py"
click node_auth_ui "https://github.com/namtrungdn310/tpro-classio/blob/main/frontend/src/app/login/page.tsx"
click node_auth_ops "https://github.com/namtrungdn310/tpro-classio/tree/main/backend/app/routers/auth"

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_dashboard,node_students_ui,node_classes_ui,node_attendance_ui,node_fees_ui,node_banking_ui,node_reports_ui,node_staff_ui,node_frontend_api,node_proxy toneBlue
class node_student_ops,node_class_ops,node_attendance_ops,node_staff_ops toneAmber
class node_fee_ops,node_banking_ops,node_payment_webhook,node_reports_ops toneMint
class node_services,node_api_app,node_database toneRose
class node_auth_ui,node_auth_ops,node_staff,node_google,node_pay2s toneIndigo
```

## Components

### Staff workspace

- [Dashboard](https://github.com/namtrungdn310/tpro-classio/blob/main/frontend/src/app/(dashboard)/page.tsx): `frontend/src/app/(dashboard)/page.tsx`
- [Student management](https://github.com/namtrungdn310/tpro-classio/blob/main/frontend/src/app/(dashboard)/students/page.tsx): `frontend/src/app/(dashboard)/students/page.tsx`
- [Class management](https://github.com/namtrungdn310/tpro-classio/blob/main/frontend/src/app/(dashboard)/classes/page.tsx): `frontend/src/app/(dashboard)/classes/page.tsx`
- [Attendance](https://github.com/namtrungdn310/tpro-classio/blob/main/frontend/src/app/attendance/page.tsx): `frontend/src/app/attendance/page.tsx`
- [Fee management](https://github.com/namtrungdn310/tpro-classio/blob/main/frontend/src/app/(dashboard)/fees/page.tsx): `frontend/src/app/(dashboard)/fees/page.tsx`
- [Banking](https://github.com/namtrungdn310/tpro-classio/blob/main/frontend/src/app/(dashboard)/banking/page.tsx): `frontend/src/app/(dashboard)/banking/page.tsx`
- [Reports](https://github.com/namtrungdn310/tpro-classio/blob/main/frontend/src/app/(dashboard)/report/page.tsx): `frontend/src/app/(dashboard)/report/page.tsx`
- [Staff management](https://github.com/namtrungdn310/tpro-classio/blob/main/frontend/src/app/(dashboard)/staff/page.tsx): `frontend/src/app/(dashboard)/staff/page.tsx`
- [API clients](https://github.com/namtrungdn310/tpro-classio/tree/main/frontend/src/lib/api): `frontend/src/lib/api`
- [Session proxy](https://github.com/namtrungdn310/tpro-classio/blob/main/frontend/src/app/api/proxy/%5B...path%5D/route.ts): `frontend/src/app/api/proxy/[...path]/route.ts`

### Learning operations

- [Students and enrollment](https://github.com/namtrungdn310/tpro-classio/blob/main/backend/app/routers/students.py): `backend/app/routers/students.py`
- [Classes and schedule](https://github.com/namtrungdn310/tpro-classio/blob/main/backend/app/routers/classes.py): `backend/app/routers/classes.py`
- [Attendance operations](https://github.com/namtrungdn310/tpro-classio/blob/main/backend/app/routers/attendance.py): `backend/app/routers/attendance.py`
- [Staff and payroll](https://github.com/namtrungdn310/tpro-classio/blob/main/backend/app/routers/staff.py): `backend/app/routers/staff.py`

### Finance operations

- [Fees and payments](https://github.com/namtrungdn310/tpro-classio/blob/main/backend/app/routers/fees.py): `backend/app/routers/fees.py`
- [Banking operations](https://github.com/namtrungdn310/tpro-classio/blob/main/backend/app/routers/banking.py): `backend/app/routers/banking.py`
- [Payment webhook](https://github.com/namtrungdn310/tpro-classio/blob/main/backend/app/routers/pay2s_webhook.py): `backend/app/routers/pay2s_webhook.py`
- [Reporting](https://github.com/namtrungdn310/tpro-classio/blob/main/backend/app/routers/reports.py): `backend/app/routers/reports.py`

### Backend platform

- [Domain services](https://github.com/namtrungdn310/tpro-classio/tree/main/backend/app/services): `backend/app/services`
- [FastAPI application](https://github.com/namtrungdn310/tpro-classio/blob/main/backend/app/main.py): `backend/app/main.py`
- [PostgreSQL](https://github.com/namtrungdn310/tpro-classio/blob/main/backend/app/core/database.py): `backend/app/core/database.py`

### Identity and integrations

- [Sign-in and setup](https://github.com/namtrungdn310/tpro-classio/blob/main/frontend/src/app/login/page.tsx): `frontend/src/app/login/page.tsx`
- [Authentication](https://github.com/namtrungdn310/tpro-classio/tree/main/backend/app/routers/auth): `backend/app/routers/auth`

### Other components

- **Centre staff**
- **Google identity**
- **Pay2S**

## Connections

- Centre staff → Dashboard: uses
- Centre staff → Student management: manages
- Centre staff → Class management: manages
- Centre staff → Attendance: records
- Centre staff → Fee management: manages
- Centre staff → Banking: reviews
- Centre staff → Reports: reviews
- Centre staff → Staff management: manages
- Dashboard → API clients: requests data
- Student management → API clients: requests data
- Class management → API clients: requests data
- Attendance → API clients: requests data
- Fee management → API clients: requests data
- Banking → API clients: requests data
- Reports → API clients: requests data
- Staff management → API clients: requests data
- API clients → Session proxy: sends requests
- Session proxy → FastAPI application: forwards requests
- FastAPI application → Students and enrollment: dispatches
- FastAPI application → Classes and schedule: dispatches
- FastAPI application → Attendance operations: dispatches
- FastAPI application → Staff and payroll: dispatches
- FastAPI application → Fees and payments: dispatches
- FastAPI application → Banking operations: dispatches
- FastAPI application → Payment webhook: dispatches
- FastAPI application → Reporting: dispatches
- Students and enrollment → Domain services: uses
- Classes and schedule → Domain services: uses
- Attendance operations → Domain services: uses
- Staff and payroll → Domain services: uses
- Fees and payments → Domain services: uses
- Banking operations → Domain services: uses
- Reporting → Domain services: uses
- Domain services → PostgreSQL: reads and writes
- Centre staff → Sign-in and setup: signs in
- Sign-in and setup → Session proxy: starts session
- Session proxy → Authentication: forwards auth
- Authentication → Domain services: uses
- Authentication → Google identity: verifies identity
- Payment webhook → Pay2S: receives events
