# s-mauryaa/prepxpertcoaching architecture

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

- Interactive diagram: https://gitdiagram.com/s-mauryaa/prepxpertcoaching
- Repository: https://github.com/s-mauryaa/prepxpertcoaching

## Overview

PrepXpert is a coaching-institute management app with an admin workspace and a public student learning portal. The main admin workflow loads student and institute data, then supports student records, attendance, fee tracking, and configuration; a separate content workflow manages classes, courses, and lessons for the portal. The frontend hooks call the mounted backend APIs for persisted data, while some settings and class names use local storage. The README is only a generic AI Studio starter guide, and backend route/model implementations were not sampled, so their internal wiring is left unspecified.

Main entry points: [`frontend/src/App.tsx`](https://github.com/s-mauryaa/prepxpertcoaching/blob/main/frontend/src/App.tsx) (Web app router), [`backend/src/index.ts`](https://github.com/s-mauryaa/prepxpertcoaching/blob/main/backend/src/index.ts) (API server), [`frontend/src/hooks/useContent.ts`](https://github.com/s-mauryaa/prepxpertcoaching/blob/main/frontend/src/hooks/useContent.ts) (Content hook), [`frontend/src/hooks/useSettings.ts`](https://github.com/s-mauryaa/prepxpertcoaching/blob/main/frontend/src/hooks/useSettings.ts) (Settings hook)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_admin["Admin workspace"]
  node_webapp["Web app router<br/>[App.tsx]"]
  node_auth["Admin login<br/>[useAuth.ts]"]
  node_studentui["Student records"]
  node_studentedit["Student editing<br/>[AddEditStudent.tsx]"]
  node_profile["Student profile<br/>[StudentProfile.tsx]"]
  node_attendance["Attendance<br/>[Attendance.tsx]"]
  node_fees["Fee tracking<br/>[Fees.tsx]"]
  node_dashboard["Admin dashboard<br/>[Dashboard.tsx]"]
  node_settingsui["Institute settings<br/>[Settings.tsx]"]
  node_studentdata["Student data hook<br/>[useStudents.ts]"]
  node_settingsdata["Settings hook<br/>[useSettings.ts]"]
end

subgraph group_learning["Learning content"]
  node_contentadmin["Content management"]
  node_portal["Student portal<br/>[StudentPortal.tsx]"]
  node_contentdata["Content hook<br/>[useContent.ts]"]
end

subgraph group_api["Backend API"]
  node_backend["API server<br/>[index.ts]"]
  node_studentroutes["Student routes<br/>[students.ts]"]
  node_batchroutes["Batch routes<br/>[batches.ts]"]
  node_feeroutes["Subject fee routes<br/>[subjectFees.ts]"]
  node_courseroutes["Course routes<br/>[courses.ts]"]
  node_lessonroutes["Lesson routes<br/>[lessons.ts]"]
  node_settingroutes["Settings routes<br/>[settings.ts]"]
end

subgraph group_data["Persistence"]
  node_dbconfig["Database connection<br/>[db.ts]"]
  node_mongo[("MongoDB")]
  node_studentmodel["Student schema<br/>[Student.ts]"]
  node_paymentmodel["Payment schema<br/>[Payment.ts]"]
  node_batchmodel["Batch schema<br/>[Batch.ts]"]
  node_feemodel["Subject fee schema<br/>[SubjectFee.ts]"]
  node_coursemodel["Course schema<br/>[Course.ts]"]
  node_lessonmodel["Lesson schema<br/>[Lesson.ts]"]
  node_settingsmodel["Settings schema<br/>[Settings.ts]"]
end

node_admin(("Institute admin"))

node_admin -->|"uses"| node_webapp
node_webapp -->|"checks login"| node_auth
node_webapp -->|"routes to"| node_studentui
node_webapp -->|"routes to"| node_studentedit
node_webapp -->|"routes to"| node_profile
node_webapp -->|"routes to"| node_attendance
node_webapp -->|"routes to"| node_fees
node_webapp -->|"routes to"| node_dashboard
node_webapp -->|"routes to"| node_settingsui
node_webapp -->|"routes to"| node_contentadmin
node_webapp -->|"routes to"| node_portal
node_webapp -->|"loads data"| node_studentdata
node_webapp -->|"loads data"| node_settingsdata
node_webapp -->|"loads data"| node_contentdata
node_studentdata -->|"requests students"| node_backend
node_settingsdata -->|"requests settings"| node_backend
node_contentdata -->|"requests content"| node_backend
node_backend -->|"mounts endpoint"| node_studentroutes
node_backend -->|"mounts endpoint"| node_batchroutes
node_backend -->|"mounts endpoint"| node_feeroutes
node_backend -->|"mounts endpoint"| node_courseroutes
node_backend -->|"mounts endpoint"| node_lessonroutes
node_backend -->|"mounts endpoint"| node_settingroutes
node_backend -->|"connects database"| node_dbconfig
node_dbconfig -->|"connects"| node_mongo
node_contentadmin -->|"updates content"| node_contentdata
node_portal -->|"receives content"| node_contentdata
node_settingsdata -.->|"not established"| node_mongo

click node_webapp "https://github.com/s-mauryaa/prepxpertcoaching/blob/main/frontend/src/App.tsx"
click node_auth "https://github.com/s-mauryaa/prepxpertcoaching/blob/main/frontend/src/hooks/useAuth.ts"
click node_studentui "https://github.com/s-mauryaa/prepxpertcoaching/blob/main/frontend/src/components/StudentDirectory.tsx"
click node_studentedit "https://github.com/s-mauryaa/prepxpertcoaching/blob/main/frontend/src/components/AddEditStudent.tsx"
click node_profile "https://github.com/s-mauryaa/prepxpertcoaching/blob/main/frontend/src/components/StudentProfile.tsx"
click node_attendance "https://github.com/s-mauryaa/prepxpertcoaching/blob/main/frontend/src/components/Attendance.tsx"
click node_fees "https://github.com/s-mauryaa/prepxpertcoaching/blob/main/frontend/src/components/Fees.tsx"
click node_dashboard "https://github.com/s-mauryaa/prepxpertcoaching/blob/main/frontend/src/components/Dashboard.tsx"
click node_settingsui "https://github.com/s-mauryaa/prepxpertcoaching/blob/main/frontend/src/components/Settings.tsx"
click node_studentdata "https://github.com/s-mauryaa/prepxpertcoaching/blob/main/frontend/src/hooks/useStudents.ts"
click node_settingsdata "https://github.com/s-mauryaa/prepxpertcoaching/blob/main/frontend/src/hooks/useSettings.ts"
click node_contentadmin "https://github.com/s-mauryaa/prepxpertcoaching/blob/main/frontend/src/components/admin/ContentManagement.tsx"
click node_portal "https://github.com/s-mauryaa/prepxpertcoaching/blob/main/frontend/src/components/student/StudentPortal.tsx"
click node_contentdata "https://github.com/s-mauryaa/prepxpertcoaching/blob/main/frontend/src/hooks/useContent.ts"
click node_backend "https://github.com/s-mauryaa/prepxpertcoaching/blob/main/backend/src/index.ts"
click node_studentroutes "https://github.com/s-mauryaa/prepxpertcoaching/blob/main/backend/src/routes/students.ts"
click node_batchroutes "https://github.com/s-mauryaa/prepxpertcoaching/blob/main/backend/src/routes/batches.ts"
click node_feeroutes "https://github.com/s-mauryaa/prepxpertcoaching/blob/main/backend/src/routes/subjectFees.ts"
click node_courseroutes "https://github.com/s-mauryaa/prepxpertcoaching/blob/main/backend/src/routes/courses.ts"
click node_lessonroutes "https://github.com/s-mauryaa/prepxpertcoaching/blob/main/backend/src/routes/lessons.ts"
click node_settingroutes "https://github.com/s-mauryaa/prepxpertcoaching/blob/main/backend/src/routes/settings.ts"
click node_dbconfig "https://github.com/s-mauryaa/prepxpertcoaching/blob/main/backend/src/config/db.ts"
click node_studentmodel "https://github.com/s-mauryaa/prepxpertcoaching/blob/main/backend/src/models/Student.ts"
click node_paymentmodel "https://github.com/s-mauryaa/prepxpertcoaching/blob/main/backend/src/models/Payment.ts"
click node_batchmodel "https://github.com/s-mauryaa/prepxpertcoaching/blob/main/backend/src/models/Batch.ts"
click node_feemodel "https://github.com/s-mauryaa/prepxpertcoaching/blob/main/backend/src/models/SubjectFee.ts"
click node_coursemodel "https://github.com/s-mauryaa/prepxpertcoaching/blob/main/backend/src/models/Course.ts"
click node_lessonmodel "https://github.com/s-mauryaa/prepxpertcoaching/blob/main/backend/src/models/Lesson.ts"
click node_settingsmodel "https://github.com/s-mauryaa/prepxpertcoaching/blob/main/backend/src/models/Settings.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_webapp,node_auth,node_studentui,node_studentedit,node_profile,node_attendance,node_fees,node_dashboard,node_settingsui,node_studentdata,node_settingsdata toneBlue
class node_contentadmin,node_portal,node_contentdata toneAmber
class node_backend,node_studentroutes,node_batchroutes,node_feeroutes,node_courseroutes,node_lessonroutes,node_settingroutes toneMint
class node_dbconfig,node_mongo,node_studentmodel,node_paymentmodel,node_batchmodel,node_feemodel,node_coursemodel,node_lessonmodel,node_settingsmodel toneRose
class node_admin toneIndigo
```

## Components

### Admin workspace

- [Web app router](https://github.com/s-mauryaa/prepxpertcoaching/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Admin login](https://github.com/s-mauryaa/prepxpertcoaching/blob/main/frontend/src/hooks/useAuth.ts): `frontend/src/hooks/useAuth.ts`
- [Student records](https://github.com/s-mauryaa/prepxpertcoaching/blob/main/frontend/src/components/StudentDirectory.tsx): `frontend/src/components/StudentDirectory.tsx`
- [Student editing](https://github.com/s-mauryaa/prepxpertcoaching/blob/main/frontend/src/components/AddEditStudent.tsx): `frontend/src/components/AddEditStudent.tsx`
- [Student profile](https://github.com/s-mauryaa/prepxpertcoaching/blob/main/frontend/src/components/StudentProfile.tsx): `frontend/src/components/StudentProfile.tsx`
- [Attendance](https://github.com/s-mauryaa/prepxpertcoaching/blob/main/frontend/src/components/Attendance.tsx): `frontend/src/components/Attendance.tsx`
- [Fee tracking](https://github.com/s-mauryaa/prepxpertcoaching/blob/main/frontend/src/components/Fees.tsx): `frontend/src/components/Fees.tsx`
- [Admin dashboard](https://github.com/s-mauryaa/prepxpertcoaching/blob/main/frontend/src/components/Dashboard.tsx): `frontend/src/components/Dashboard.tsx`
- [Institute settings](https://github.com/s-mauryaa/prepxpertcoaching/blob/main/frontend/src/components/Settings.tsx): `frontend/src/components/Settings.tsx`
- [Student data hook](https://github.com/s-mauryaa/prepxpertcoaching/blob/main/frontend/src/hooks/useStudents.ts): `frontend/src/hooks/useStudents.ts`
- [Settings hook](https://github.com/s-mauryaa/prepxpertcoaching/blob/main/frontend/src/hooks/useSettings.ts): `frontend/src/hooks/useSettings.ts`

### Learning content

- [Content management](https://github.com/s-mauryaa/prepxpertcoaching/blob/main/frontend/src/components/admin/ContentManagement.tsx): `frontend/src/components/admin/ContentManagement.tsx`
- [Student portal](https://github.com/s-mauryaa/prepxpertcoaching/blob/main/frontend/src/components/student/StudentPortal.tsx): `frontend/src/components/student/StudentPortal.tsx`
- [Content hook](https://github.com/s-mauryaa/prepxpertcoaching/blob/main/frontend/src/hooks/useContent.ts): `frontend/src/hooks/useContent.ts`

### Backend API

- [API server](https://github.com/s-mauryaa/prepxpertcoaching/blob/main/backend/src/index.ts): `backend/src/index.ts`
- [Student routes](https://github.com/s-mauryaa/prepxpertcoaching/blob/main/backend/src/routes/students.ts): `backend/src/routes/students.ts`
- [Batch routes](https://github.com/s-mauryaa/prepxpertcoaching/blob/main/backend/src/routes/batches.ts): `backend/src/routes/batches.ts`
- [Subject fee routes](https://github.com/s-mauryaa/prepxpertcoaching/blob/main/backend/src/routes/subjectFees.ts): `backend/src/routes/subjectFees.ts`
- [Course routes](https://github.com/s-mauryaa/prepxpertcoaching/blob/main/backend/src/routes/courses.ts): `backend/src/routes/courses.ts`
- [Lesson routes](https://github.com/s-mauryaa/prepxpertcoaching/blob/main/backend/src/routes/lessons.ts): `backend/src/routes/lessons.ts`
- [Settings routes](https://github.com/s-mauryaa/prepxpertcoaching/blob/main/backend/src/routes/settings.ts): `backend/src/routes/settings.ts`

### Persistence

- [Database connection](https://github.com/s-mauryaa/prepxpertcoaching/blob/main/backend/src/config/db.ts): `backend/src/config/db.ts`
- **MongoDB**
- [Student schema](https://github.com/s-mauryaa/prepxpertcoaching/blob/main/backend/src/models/Student.ts): `backend/src/models/Student.ts`
- [Payment schema](https://github.com/s-mauryaa/prepxpertcoaching/blob/main/backend/src/models/Payment.ts): `backend/src/models/Payment.ts`
- [Batch schema](https://github.com/s-mauryaa/prepxpertcoaching/blob/main/backend/src/models/Batch.ts): `backend/src/models/Batch.ts`
- [Subject fee schema](https://github.com/s-mauryaa/prepxpertcoaching/blob/main/backend/src/models/SubjectFee.ts): `backend/src/models/SubjectFee.ts`
- [Course schema](https://github.com/s-mauryaa/prepxpertcoaching/blob/main/backend/src/models/Course.ts): `backend/src/models/Course.ts`
- [Lesson schema](https://github.com/s-mauryaa/prepxpertcoaching/blob/main/backend/src/models/Lesson.ts): `backend/src/models/Lesson.ts`
- [Settings schema](https://github.com/s-mauryaa/prepxpertcoaching/blob/main/backend/src/models/Settings.ts): `backend/src/models/Settings.ts`

### Other components

- **Institute admin**

## Connections

- Institute admin → Web app router: uses
- Web app router → Admin login: checks login
- Web app router → Student records: routes to
- Web app router → Student editing: routes to
- Web app router → Student profile: routes to
- Web app router → Attendance: routes to
- Web app router → Fee tracking: routes to
- Web app router → Admin dashboard: routes to
- Web app router → Institute settings: routes to
- Web app router → Content management: routes to
- Web app router → Student portal: routes to
- Web app router → Student data hook: loads data
- Web app router → Settings hook: loads data
- Web app router → Content hook: loads data
- Student data hook → API server: requests students
- Settings hook → API server: requests settings
- Content hook → API server: requests content
- API server → Student routes: mounts endpoint
- API server → Batch routes: mounts endpoint
- API server → Subject fee routes: mounts endpoint
- API server → Course routes: mounts endpoint
- API server → Lesson routes: mounts endpoint
- API server → Settings routes: mounts endpoint
- API server → Database connection: connects database
- Database connection → MongoDB: connects
- Content management → Content hook: updates content
- Student portal → Content hook: receives content
- Settings hook → MongoDB: not established
