# vanshsuri07/classroom architecture

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

- Interactive diagram: https://gitdiagram.com/vanshsuri07/classroom
- Repository: https://github.com/vanshsuri07/classroom

## Overview

Classroom is a role-based academic management platform. Users authenticate and enter a Refine dashboard to manage departments, subjects, classes, faculty, and enrollments; the frontend communicates with an Express REST API backed by PostgreSQL. The graph includes the dashboard, domain screens, authentication, and data model. Relationship evidence is limited to the README and sampled/indexed source; infrastructure and deployment capabilities described by the README are excluded because they are not runtime product components in the supplied tree.

Main entry points: [`classroom-frontend/src/App.tsx`](https://github.com/vanshsuri07/classroom/blob/main/classroom-frontend/src/App.tsx) (Refine app and routes), [`classroom-backend/src/index.ts`](https://github.com/vanshsuri07/classroom/blob/main/classroom-backend/src/index.ts) (Express API entry), [`classroom-backend/src/db/index.ts`](https://github.com/vanshsuri07/classroom/blob/main/classroom-backend/src/db/index.ts) (Drizzle database client), [`classroom-backend/src/lib/auth.ts`](https://github.com/vanshsuri07/classroom/blob/main/classroom-backend/src/lib/auth.ts) (Better Auth)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_app["Refine app and routes<br/>[App.tsx]"]
  node_dashboard["Metrics dashboard<br/>[dashboard.tsx]"]
  node_classes_ui["Class screens"]
  node_departments_ui["Department screens"]
  node_subjects_ui["Subject screens"]
  node_enrollments_ui["Enrollment workflows"]
  node_faculty_ui["Faculty screens"]
  node_auth_ui["Sign-in and signup<br/>[auth.ts]"]
  node_cloudinary_client["Upload integration<br/>[cloudinary.ts]"]
end

subgraph group_backend["API and auth"]
  node_api["Express API entry<br/>[index.ts]"]
  node_auth_service["Better Auth<br/>[auth.ts]"]
  node_classes_api["Class endpoints<br/>[classes.ts]"]
  node_departments_api["Department endpoints<br/>[departments.ts]"]
  node_subjects_api["Subject endpoints<br/>[subject.ts]"]
  node_users_api["User endpoints<br/>[users.ts]"]
  node_enrollments_api["Enrollment endpoints<br/>[enrollments.ts]"]
  node_stats_api["Statistics endpoints<br/>[stats.ts]"]
  node_security["Arcjet security middleware<br/>[security.ts]"]
end

subgraph group_data["Academic data"]
  node_db_client["Drizzle database client<br/>[index.ts]"]
  node_academic_schema[("Academic schema<br/>[app.ts]")]
  node_auth_schema[("Identity schema<br/>[auth.ts]")]
end

subgraph group_integrations["External services"]
  node_postgres[("PostgreSQL")]
  node_cloudinary[("Cloudinary")]
end

node_user(("Admin, teacher, student"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_classes_ui
node_app -->|"routes to"| node_subjects_ui
node_app -->|"routes to"| node_auth_ui
node_app -->|"calls REST API"| node_api
node_auth_ui -->|"authenticates via"| node_auth_service
node_api -->|"mounts auth handler"| node_auth_service
node_api -->|"mounts"| node_classes_api
node_api -->|"mounts"| node_departments_api
node_api -->|"mounts"| node_subjects_api
node_api -->|"mounts"| node_users_api
node_api -->|"mounts"| node_enrollments_api
node_api -->|"mounts"| node_stats_api
node_classes_api -->|"queries"| node_db_client
node_departments_api -->|"queries"| node_db_client
node_subjects_api -->|"queries"| node_db_client
node_users_api -->|"queries"| node_db_client
node_enrollments_api -->|"queries"| node_db_client
node_stats_api -->|"queries"| node_db_client
node_db_client -->|"connects"| node_postgres
node_db_client -->|"uses schema"| node_academic_schema
node_auth_service -->|"persists auth data"| node_db_client
node_auth_service -->|"uses schema"| node_auth_schema
node_academic_schema -->|"references users"| node_auth_schema
node_app -.->|"routes to"| node_departments_ui
node_app -.->|"routes to"| node_enrollments_ui
node_app -.->|"routes to"| node_faculty_ui
node_classes_ui -.->|"uploads assets"| node_cloudinary_client
node_cloudinary_client -.->|"uploads"| node_cloudinary
node_api -.->|"may apply"| node_security

click node_app "https://github.com/vanshsuri07/classroom/blob/main/classroom-frontend/src/App.tsx"
click node_dashboard "https://github.com/vanshsuri07/classroom/blob/main/classroom-frontend/src/pages/dashboard.tsx"
click node_classes_ui "https://github.com/vanshsuri07/classroom/tree/main/classroom-frontend/src/pages/classes"
click node_departments_ui "https://github.com/vanshsuri07/classroom/tree/main/classroom-frontend/src/pages/departments"
click node_subjects_ui "https://github.com/vanshsuri07/classroom/tree/main/classroom-frontend/src/pages/subjects"
click node_enrollments_ui "https://github.com/vanshsuri07/classroom/tree/main/classroom-frontend/src/pages/enrollments"
click node_faculty_ui "https://github.com/vanshsuri07/classroom/tree/main/classroom-frontend/src/pages/faculty"
click node_auth_ui "https://github.com/vanshsuri07/classroom/blob/main/classroom-frontend/src/providers/auth.ts"
click node_cloudinary_client "https://github.com/vanshsuri07/classroom/blob/main/classroom-frontend/src/lib/cloudinary.ts"
click node_api "https://github.com/vanshsuri07/classroom/blob/main/classroom-backend/src/index.ts"
click node_auth_service "https://github.com/vanshsuri07/classroom/blob/main/classroom-backend/src/lib/auth.ts"
click node_classes_api "https://github.com/vanshsuri07/classroom/blob/main/classroom-backend/src/routes/classes.ts"
click node_departments_api "https://github.com/vanshsuri07/classroom/blob/main/classroom-backend/src/routes/departments.ts"
click node_subjects_api "https://github.com/vanshsuri07/classroom/blob/main/classroom-backend/src/routes/subject.ts"
click node_users_api "https://github.com/vanshsuri07/classroom/blob/main/classroom-backend/src/routes/users.ts"
click node_enrollments_api "https://github.com/vanshsuri07/classroom/blob/main/classroom-backend/src/routes/enrollments.ts"
click node_stats_api "https://github.com/vanshsuri07/classroom/blob/main/classroom-backend/src/routes/stats.ts"
click node_security "https://github.com/vanshsuri07/classroom/blob/main/classroom-backend/src/middleware/security.ts"
click node_db_client "https://github.com/vanshsuri07/classroom/blob/main/classroom-backend/src/db/index.ts"
click node_academic_schema "https://github.com/vanshsuri07/classroom/blob/main/classroom-backend/src/db/schema/app.ts"
click node_auth_schema "https://github.com/vanshsuri07/classroom/blob/main/classroom-backend/src/db/schema/auth.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_dashboard,node_classes_ui,node_departments_ui,node_subjects_ui,node_enrollments_ui,node_faculty_ui,node_auth_ui,node_cloudinary_client toneBlue
class node_api,node_auth_service,node_classes_api,node_departments_api,node_subjects_api,node_users_api,node_enrollments_api,node_stats_api,node_security toneAmber
class node_db_client,node_academic_schema,node_auth_schema toneMint
class node_postgres,node_cloudinary toneRose
class node_user toneIndigo
```

## Components

### Web application

- [Refine app and routes](https://github.com/vanshsuri07/classroom/blob/main/classroom-frontend/src/App.tsx): `classroom-frontend/src/App.tsx`
- [Metrics dashboard](https://github.com/vanshsuri07/classroom/blob/main/classroom-frontend/src/pages/dashboard.tsx): `classroom-frontend/src/pages/dashboard.tsx`
- [Class screens](https://github.com/vanshsuri07/classroom/tree/main/classroom-frontend/src/pages/classes): `classroom-frontend/src/pages/classes`
- [Department screens](https://github.com/vanshsuri07/classroom/tree/main/classroom-frontend/src/pages/departments): `classroom-frontend/src/pages/departments`
- [Subject screens](https://github.com/vanshsuri07/classroom/tree/main/classroom-frontend/src/pages/subjects): `classroom-frontend/src/pages/subjects`
- [Enrollment workflows](https://github.com/vanshsuri07/classroom/tree/main/classroom-frontend/src/pages/enrollments): `classroom-frontend/src/pages/enrollments`
- [Faculty screens](https://github.com/vanshsuri07/classroom/tree/main/classroom-frontend/src/pages/faculty): `classroom-frontend/src/pages/faculty`
- [Sign-in and signup](https://github.com/vanshsuri07/classroom/blob/main/classroom-frontend/src/providers/auth.ts): `classroom-frontend/src/providers/auth.ts`
- [Upload integration](https://github.com/vanshsuri07/classroom/blob/main/classroom-frontend/src/lib/cloudinary.ts): `classroom-frontend/src/lib/cloudinary.ts`

### API and auth

- [Express API entry](https://github.com/vanshsuri07/classroom/blob/main/classroom-backend/src/index.ts): `classroom-backend/src/index.ts`
- [Better Auth](https://github.com/vanshsuri07/classroom/blob/main/classroom-backend/src/lib/auth.ts): `classroom-backend/src/lib/auth.ts`
- [Class endpoints](https://github.com/vanshsuri07/classroom/blob/main/classroom-backend/src/routes/classes.ts): `classroom-backend/src/routes/classes.ts`
- [Department endpoints](https://github.com/vanshsuri07/classroom/blob/main/classroom-backend/src/routes/departments.ts): `classroom-backend/src/routes/departments.ts`
- [Subject endpoints](https://github.com/vanshsuri07/classroom/blob/main/classroom-backend/src/routes/subject.ts): `classroom-backend/src/routes/subject.ts`
- [User endpoints](https://github.com/vanshsuri07/classroom/blob/main/classroom-backend/src/routes/users.ts): `classroom-backend/src/routes/users.ts`
- [Enrollment endpoints](https://github.com/vanshsuri07/classroom/blob/main/classroom-backend/src/routes/enrollments.ts): `classroom-backend/src/routes/enrollments.ts`
- [Statistics endpoints](https://github.com/vanshsuri07/classroom/blob/main/classroom-backend/src/routes/stats.ts): `classroom-backend/src/routes/stats.ts`
- [Arcjet security middleware](https://github.com/vanshsuri07/classroom/blob/main/classroom-backend/src/middleware/security.ts): `classroom-backend/src/middleware/security.ts`

### Academic data

- [Drizzle database client](https://github.com/vanshsuri07/classroom/blob/main/classroom-backend/src/db/index.ts): `classroom-backend/src/db/index.ts`
- [Academic schema](https://github.com/vanshsuri07/classroom/blob/main/classroom-backend/src/db/schema/app.ts): `classroom-backend/src/db/schema/app.ts`
- [Identity schema](https://github.com/vanshsuri07/classroom/blob/main/classroom-backend/src/db/schema/auth.ts): `classroom-backend/src/db/schema/auth.ts`

### External services

- **PostgreSQL**
- **Cloudinary**

### Other components

- **Admin, teacher, student**

## Connections

- Admin, teacher, student → Refine app and routes: uses (evidence: `Readme.md`)
- Refine app and routes → Metrics dashboard: routes to (evidence: `classroom-frontend/src/App.tsx`)
- Refine app and routes → Class screens: routes to (evidence: `classroom-frontend/src/App.tsx`)
- Refine app and routes → Subject screens: routes to (evidence: `classroom-frontend/src/App.tsx`)
- Refine app and routes → Sign-in and signup: routes to (evidence: `classroom-frontend/src/App.tsx`)
- Refine app and routes → Express API entry: calls REST API (evidence: `Readme.md`)
- Sign-in and signup → Better Auth: authenticates via (evidence: `Readme.md`)
- Express API entry → Better Auth: mounts auth handler (evidence: `classroom-backend/src/index.ts`)
- Express API entry → Class endpoints: mounts (evidence: `classroom-backend/src/index.ts`)
- Express API entry → Department endpoints: mounts (evidence: `classroom-backend/src/index.ts`)
- Express API entry → Subject endpoints: mounts (evidence: `classroom-backend/src/index.ts`)
- Express API entry → User endpoints: mounts (evidence: `classroom-backend/src/index.ts`)
- Express API entry → Enrollment endpoints: mounts (evidence: `classroom-backend/src/index.ts`)
- Express API entry → Statistics endpoints: mounts (evidence: `classroom-backend/src/index.ts`)
- Class endpoints → Drizzle database client: queries (evidence: `classroom-backend/src/routes/classes.ts`)
- Department endpoints → Drizzle database client: queries (evidence: `classroom-backend/src/routes/departments.ts`)
- Subject endpoints → Drizzle database client: queries (evidence: `classroom-backend/src/routes/subject.ts`)
- User endpoints → Drizzle database client: queries (evidence: `classroom-backend/src/routes/users.ts`)
- Enrollment endpoints → Drizzle database client: queries (evidence: `classroom-backend/src/routes/enrollments.ts`)
- Statistics endpoints → Drizzle database client: queries (evidence: `classroom-backend/src/routes/stats.ts`)
- Drizzle database client → PostgreSQL: connects (evidence: `Readme.md`)
- Drizzle database client → Academic schema: uses schema
- Better Auth → Drizzle database client: persists auth data (evidence: `classroom-backend/src/lib/auth.ts`)
- Better Auth → Identity schema: uses schema (evidence: `classroom-backend/src/lib/auth.ts`)
- Academic schema → Identity schema: references users (evidence: `classroom-backend/src/db/schema/app.ts`)
- Refine app and routes → Department screens: routes to (evidence: `classroom-frontend/src/App.tsx`)
- Refine app and routes → Enrollment workflows: routes to (evidence: `classroom-frontend/src/App.tsx`)
- Refine app and routes → Faculty screens: routes to (evidence: `classroom-frontend/src/App.tsx`)
- Class screens → Upload integration: uploads assets
- Upload integration → Cloudinary: uploads (evidence: `Readme.md`)
- Express API entry → Arcjet security middleware: may apply (evidence: `classroom-backend/src/index.ts`)
