# vidhyasagar-27/pragathi-ai-education architecture

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

- Interactive diagram: https://gitdiagram.com/vidhyasagar-27/pragathi-ai-education
- Repository: https://github.com/vidhyasagar-27/pragathi-ai-education

## Overview

PRAGATHI AI is an education platform combining public-facing school information and enrollment with administration and student/instructor learning tools. A principal workflow is student registration: the public registration API normalizes and checks applicant details, stores an application, and triggers automation; administrators review applications and can accept them into student accounts. The app also provides curriculum, quizzes, assignments, attendance, certificates, and operational management. Several feature routes are unsampled, so their presence is represented without asserting unverified call paths.

Main entry points: [`lib/automation/engine.ts`](https://github.com/vidhyasagar-27/pragathi-ai-education/blob/main/lib/automation/engine.ts) (Automation Engine), [`app/api/register/route.ts`](https://github.com/vidhyasagar-27/pragathi-ai-education/blob/main/app/api/register/route.ts) (Registration API), [`app/api/admin/registrations/route.ts`](https://github.com/vidhyasagar-27/pragathi-ai-education/blob/main/app/api/admin/registrations/route.ts) (Application Review), [`app/HomeClient.tsx`](https://github.com/vidhyasagar-27/pragathi-ai-education/blob/main/app/HomeClient.tsx) (Public Site)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public Experience"]
  node_public_site["Public Site<br/>[HomeClient.tsx]"]
  node_public_sections["Site Sections"]
  node_partnership["Partnerships"]
end

subgraph group_enrollment["Enrollment"]
  node_registration_ui["Registration UI<br/>[page.tsx]"]
  node_registration_api["Registration API<br/>[route.ts]"]
end

subgraph group_learning["Learning"]
  node_instructor_tools["Instructor Tools"]
  node_student_tools["Student Learning"]
  node_learning_content["Learning Content APIs"]
  node_ai_chat["AI Chat<br/>[route.ts]"]
  node_quiz_generation["Quiz Generation"]
end

subgraph group_operations["Administration"]
  node_registration_review["Application Review<br/>[route.ts]"]
  node_student_admin["Student Management<br/>[page.tsx]"]
  node_admin_features["Admin Operations"]
end

subgraph group_platform["Platform Services"]
  node_auth["Session Auth<br/>[session.ts]"]
  node_automation["Automation Engine<br/>[engine.ts]"]
  node_normalization["Family Matching<br/>[normalization.ts]"]
  node_database[("Application Data<br/>[index.ts]")]
  node_notifications["Notifications"]
  node_email["Gmail Delivery<br/>[gmail.ts]"]
  node_jwt["JWT Utilities<br/>[jwt.ts]"]
end

node_visitor(("Visitor"))

node_visitor -.->|"views"| node_public_site
node_public_site -->|"renders"| node_public_sections
node_visitor -.->|"applies through"| node_registration_ui
node_registration_ui -.->|"submits to"| node_registration_api
node_registration_api -->|"normalizes with"| node_normalization
node_registration_api -->|"reads and writes"| node_database
node_registration_api -->|"triggers"| node_automation
node_registration_review -->|"checks session"| node_auth
node_registration_review -->|"reads and updates"| node_database
node_registration_review -->|"triggers"| node_automation
node_student_admin -.->|"manages applications"| node_registration_review
node_student_admin -.->|"uses protected access"| node_auth
node_automation -->|"reads and logs"| node_database
node_automation -->|"sends messages"| node_email
node_automation -.->|"delivers alerts"| node_notifications
node_auth -->|"verifies tokens"| node_jwt
node_instructor_tools -->|"uses generator"| node_quiz_generation
node_student_tools -.->|"uses learning APIs"| node_learning_content
node_instructor_tools -.->|"uses learning APIs"| node_learning_content
node_partnership -.->|"featured on"| node_public_site

click node_public_site "https://github.com/vidhyasagar-27/pragathi-ai-education/blob/main/app/HomeClient.tsx"
click node_public_sections "https://github.com/vidhyasagar-27/pragathi-ai-education/tree/main/components"
click node_partnership "https://github.com/vidhyasagar-27/pragathi-ai-education/blob/main/components/SchoolPartnershipSection.tsx"
click node_registration_ui "https://github.com/vidhyasagar-27/pragathi-ai-education/blob/main/app/register/page.tsx"
click node_registration_api "https://github.com/vidhyasagar-27/pragathi-ai-education/blob/main/app/api/register/route.ts"
click node_registration_review "https://github.com/vidhyasagar-27/pragathi-ai-education/blob/main/app/api/admin/registrations/route.ts"
click node_student_admin "https://github.com/vidhyasagar-27/pragathi-ai-education/blob/main/app/admin/students/page.tsx"
click node_admin_features "https://github.com/vidhyasagar-27/pragathi-ai-education/tree/main/app/admin"
click node_instructor_tools "https://github.com/vidhyasagar-27/pragathi-ai-education/tree/main/app/instructor"
click node_student_tools "https://github.com/vidhyasagar-27/pragathi-ai-education/tree/main/app/student"
click node_learning_content "https://github.com/vidhyasagar-27/pragathi-ai-education/tree/main/app/api/content"
click node_ai_chat "https://github.com/vidhyasagar-27/pragathi-ai-education/blob/main/app/api/ai/chat/route.ts"
click node_quiz_generation "https://github.com/vidhyasagar-27/pragathi-ai-education/blob/main/components/AiQuizGeneratorModal.tsx"
click node_auth "https://github.com/vidhyasagar-27/pragathi-ai-education/blob/main/lib/auth/session.ts"
click node_automation "https://github.com/vidhyasagar-27/pragathi-ai-education/blob/main/lib/automation/engine.ts"
click node_normalization "https://github.com/vidhyasagar-27/pragathi-ai-education/blob/main/lib/family/normalization.ts"
click node_database "https://github.com/vidhyasagar-27/pragathi-ai-education/blob/main/lib/db/index.ts"
click node_notifications "https://github.com/vidhyasagar-27/pragathi-ai-education/tree/main/lib/notifications"
click node_email "https://github.com/vidhyasagar-27/pragathi-ai-education/blob/main/lib/email/gmail.ts"
click node_jwt "https://github.com/vidhyasagar-27/pragathi-ai-education/blob/main/lib/auth/jwt.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_public_site,node_public_sections,node_partnership toneBlue
class node_registration_ui,node_registration_api toneAmber
class node_instructor_tools,node_student_tools,node_learning_content,node_ai_chat,node_quiz_generation toneMint
class node_registration_review,node_student_admin,node_admin_features toneRose
class node_auth,node_automation,node_normalization,node_database,node_notifications,node_email,node_jwt,node_visitor toneIndigo
```

## Components

### Public Experience

- [Public Site](https://github.com/vidhyasagar-27/pragathi-ai-education/blob/main/app/HomeClient.tsx): `app/HomeClient.tsx`
- [Site Sections](https://github.com/vidhyasagar-27/pragathi-ai-education/tree/main/components): `components`
- [Partnerships](https://github.com/vidhyasagar-27/pragathi-ai-education/blob/main/components/SchoolPartnershipSection.tsx): `components/SchoolPartnershipSection.tsx`

### Enrollment

- [Registration UI](https://github.com/vidhyasagar-27/pragathi-ai-education/blob/main/app/register/page.tsx): `app/register/page.tsx`
- [Registration API](https://github.com/vidhyasagar-27/pragathi-ai-education/blob/main/app/api/register/route.ts): `app/api/register/route.ts`

### Learning

- [Instructor Tools](https://github.com/vidhyasagar-27/pragathi-ai-education/tree/main/app/instructor): `app/instructor`
- [Student Learning](https://github.com/vidhyasagar-27/pragathi-ai-education/tree/main/app/student): `app/student`
- [Learning Content APIs](https://github.com/vidhyasagar-27/pragathi-ai-education/tree/main/app/api/content): `app/api/content`
- [AI Chat](https://github.com/vidhyasagar-27/pragathi-ai-education/blob/main/app/api/ai/chat/route.ts): `app/api/ai/chat/route.ts`
- [Quiz Generation](https://github.com/vidhyasagar-27/pragathi-ai-education/blob/main/components/AiQuizGeneratorModal.tsx): `components/AiQuizGeneratorModal.tsx`

### Administration

- [Application Review](https://github.com/vidhyasagar-27/pragathi-ai-education/blob/main/app/api/admin/registrations/route.ts): `app/api/admin/registrations/route.ts`
- [Student Management](https://github.com/vidhyasagar-27/pragathi-ai-education/blob/main/app/admin/students/page.tsx): `app/admin/students/page.tsx`
- [Admin Operations](https://github.com/vidhyasagar-27/pragathi-ai-education/tree/main/app/admin): `app/admin`

### Platform Services

- [Session Auth](https://github.com/vidhyasagar-27/pragathi-ai-education/blob/main/lib/auth/session.ts): `lib/auth/session.ts`
- [Automation Engine](https://github.com/vidhyasagar-27/pragathi-ai-education/blob/main/lib/automation/engine.ts): `lib/automation/engine.ts`
- [Family Matching](https://github.com/vidhyasagar-27/pragathi-ai-education/blob/main/lib/family/normalization.ts): `lib/family/normalization.ts`
- [Application Data](https://github.com/vidhyasagar-27/pragathi-ai-education/blob/main/lib/db/index.ts): `lib/db/index.ts`
- [Notifications](https://github.com/vidhyasagar-27/pragathi-ai-education/tree/main/lib/notifications): `lib/notifications`
- [Gmail Delivery](https://github.com/vidhyasagar-27/pragathi-ai-education/blob/main/lib/email/gmail.ts): `lib/email/gmail.ts`
- [JWT Utilities](https://github.com/vidhyasagar-27/pragathi-ai-education/blob/main/lib/auth/jwt.ts): `lib/auth/jwt.ts`

### Other components

- **Visitor**

## Connections

- Visitor → Public Site: views
- Public Site → Site Sections: renders (evidence: `app/HomeClient.tsx`)
- Visitor → Registration UI: applies through
- Registration UI → Registration API: submits to
- Registration API → Family Matching: normalizes with (evidence: `app/api/register/route.ts`)
- Registration API → Application Data: reads and writes (evidence: `app/api/register/route.ts`)
- Registration API → Automation Engine: triggers (evidence: `app/api/register/route.ts`)
- Application Review → Session Auth: checks session (evidence: `app/api/admin/registrations/route.ts`)
- Application Review → Application Data: reads and updates (evidence: `app/api/admin/registrations/route.ts`)
- Application Review → Automation Engine: triggers (evidence: `app/api/admin/registrations/route.ts`)
- Student Management → Application Review: manages applications
- Student Management → Session Auth: uses protected access
- Automation Engine → Application Data: reads and logs (evidence: `lib/automation/engine.ts`)
- Automation Engine → Gmail Delivery: sends messages (evidence: `lib/automation/engine.ts`)
- Automation Engine → Notifications: delivers alerts
- Session Auth → JWT Utilities: verifies tokens (evidence: `lib/auth/session.ts`)
- Instructor Tools → Quiz Generation: uses generator (evidence: `app/instructor/quizzes/page.tsx`)
- Student Learning → Learning Content APIs: uses learning APIs
- Instructor Tools → Learning Content APIs: uses learning APIs
- Partnerships → Public Site: featured on
