# pshkarsngh/padhaanewala_education architecture

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

- Interactive diagram: https://gitdiagram.com/pshkarsngh/padhaanewala_education
- Repository: https://github.com/pshkarsngh/padhaanewala_education

## Overview

Padhaanewala is an education and college-admissions platform: students can explore colleges and courses, prepare for exams, use a predictor and mock tests, and engage with counselling and admissions services. Its backend exposes catalog, account, engagement, and learning APIs backed by PostgreSQL, with Redis also used by the runtime. The source index confirms route registration and several service relationships; frontend-to-backend calls and many unsampled feature details are not visible, so those links are left unasserted or marked unverified.

Main entry points: [`padhaanewala/backend/app/main.py`](https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/backend/app/main.py) (FastAPI application), [`padhaanewala/backend/app/routers/auth.py`](https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/backend/app/routers/auth.py) (Authentication API), [`padhaanewala/backend/app/database.py`](https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/backend/app/database.py) (Database sessions), [`padhaanewala/backend/app/routers/reviews.py`](https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/backend/app/routers/reviews.py) (Review moderation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["College discovery"]
  node_college_pages["College explorer<br/>[page.tsx]"]
  node_college_detail["College details"]
  node_course_pages["Course catalog<br/>[page.tsx]"]
  node_predictor["College predictor<br/>[page.tsx]"]
  node_admission["Admissions help<br/>[page.tsx]"]
end

subgraph group_preparation["Exam preparation"]
  node_exam_pages["Exam catalog<br/>[page.tsx]"]
  node_mock_test_ui["Mock test engine<br/>[MockTestEngine.tsx]"]
  node_mock_test_api["Mock test API<br/>[mock_tests.py]"]
  node_ai_chat["AI guidance<br/>[route.ts]"]
end

subgraph group_engagement["Student engagement"]
  node_reviews_ui["Reviews"]
  node_review_api["Review moderation<br/>[reviews.py]"]
end

subgraph group_identity["Identity and governance"]
  node_auth_ui["Sign in<br/>[page.tsx]"]
  node_auth_api["Authentication API<br/>[auth.py]"]
  node_otp["OTP lifecycle<br/>[otp_service.py]"]
  node_sessions["Refresh sessions<br/>[session_service.py]"]
  node_compliance["Consent checks"]
end

subgraph group_runtime["API and data runtime"]
  node_api_app["FastAPI application<br/>[main.py]"]
  node_catalog_api["Catalog APIs<br/>[colleges.py]"]
  node_enrichment_api["Catalog enrichment<br/>[enrichment.py]"]
  node_database_layer["Database sessions<br/>[database.py]"]
  node_catalog_models["Domain records<br/>[college.py]"]
  node_redis["Redis service<br/>[redis_client.py]"]
  node_config["Runtime settings<br/>[config.py]"]
end

node_student(("Student"))

node_student -.->|"browses"| node_college_pages
node_student -.->|"explores"| node_course_pages
node_student -.->|"predicts"| node_predictor
node_student -.->|"prepares"| node_exam_pages
node_student -.->|"signs in"| node_auth_ui
node_student -.->|"takes test"| node_mock_test_ui
node_student -.->|"asks"| node_ai_chat
node_student -.->|"seeks help"| node_admission
node_api_app -->|"registers"| node_auth_api
node_api_app -->|"registers"| node_catalog_api
node_api_app -->|"registers"| node_enrichment_api
node_api_app -->|"registers"| node_mock_test_api
node_api_app -->|"registers"| node_review_api
node_api_app -->|"checks database"| node_database_layer
node_api_app -->|"closes connection"| node_redis
node_api_app -->|"configures runtime"| node_config
node_auth_api -->|"uses lifecycle"| node_otp
node_auth_api -->|"rotates sessions"| node_sessions
node_auth_api -->|"checks consent"| node_compliance
node_auth_api -->|"gets session"| node_database_layer
node_catalog_api -->|"gets session"| node_database_layer
node_review_api -->|"gets session"| node_database_layer
node_database_layer -->|"reads settings"| node_config
node_auth_api -->|"loads models"| node_catalog_models
node_review_api -->|"queries records"| node_catalog_models
node_auth_ui -.->|"calls API"| node_auth_api
node_college_pages -.->|"fetches catalog"| node_catalog_api
node_mock_test_ui -.->|"submits attempts"| node_mock_test_api
node_predictor -.->|"requests prediction"| node_enrichment_api

click node_college_pages "https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/frontend/app/colleges/page.tsx"
click node_college_detail "https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/frontend/frontend/components/college/CollegeDetailClient.tsx"
click node_course_pages "https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/frontend/app/courses/%5Bslug%5D/page.tsx"
click node_predictor "https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/frontend/app/college-predictor/page.tsx"
click node_admission "https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/frontend/app/admission/page.tsx"
click node_exam_pages "https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/frontend/app/exams/%5Bslug%5D/page.tsx"
click node_mock_test_ui "https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/frontend/frontend/components/mocktests/MockTestEngine.tsx"
click node_mock_test_api "https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/backend/app/routers/mock_tests.py"
click node_ai_chat "https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/frontend/app/api/ai/route.ts"
click node_reviews_ui "https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/frontend/frontend/components/reviews/ReviewsExplorer.tsx"
click node_review_api "https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/backend/app/routers/reviews.py"
click node_auth_ui "https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/frontend/app/login/page.tsx"
click node_auth_api "https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/backend/app/routers/auth.py"
click node_otp "https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/backend/app/services/otp_service.py"
click node_sessions "https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/backend/app/services/session_service.py"
click node_compliance "https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/backend/app/services/compliance_service.py"
click node_api_app "https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/backend/app/main.py"
click node_catalog_api "https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/backend/app/routers/colleges.py"
click node_enrichment_api "https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/backend/app/routers/enrichment.py"
click node_database_layer "https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/backend/app/database.py"
click node_catalog_models "https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/backend/app/models/college.py"
click node_redis "https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/backend/app/services/redis_client.py"
click node_config "https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/backend/app/config.py"

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_college_pages,node_college_detail,node_course_pages,node_predictor,node_admission toneBlue
class node_exam_pages,node_mock_test_ui,node_mock_test_api,node_ai_chat toneAmber
class node_reviews_ui,node_review_api toneMint
class node_auth_ui,node_auth_api,node_otp,node_sessions,node_compliance toneRose
class node_api_app,node_catalog_api,node_enrichment_api,node_database_layer,node_catalog_models,node_redis,node_config,node_student toneIndigo
```

## Components

### College discovery

- [College explorer](https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/frontend/app/colleges/page.tsx): `padhaanewala/frontend/app/colleges/page.tsx`
- [College details](https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/frontend/frontend/components/college/CollegeDetailClient.tsx): `padhaanewala/frontend/frontend/components/college/CollegeDetailClient.tsx`
- [Course catalog](https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/frontend/app/courses/%5Bslug%5D/page.tsx): `padhaanewala/frontend/app/courses/[slug]/page.tsx`
- [College predictor](https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/frontend/app/college-predictor/page.tsx): `padhaanewala/frontend/app/college-predictor/page.tsx`
- [Admissions help](https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/frontend/app/admission/page.tsx): `padhaanewala/frontend/app/admission/page.tsx`

### Exam preparation

- [Exam catalog](https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/frontend/app/exams/%5Bslug%5D/page.tsx): `padhaanewala/frontend/app/exams/[slug]/page.tsx`
- [Mock test engine](https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/frontend/frontend/components/mocktests/MockTestEngine.tsx): `padhaanewala/frontend/frontend/components/mocktests/MockTestEngine.tsx`
- [Mock test API](https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/backend/app/routers/mock_tests.py): `padhaanewala/backend/app/routers/mock_tests.py`
- [AI guidance](https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/frontend/app/api/ai/route.ts): `padhaanewala/frontend/app/api/ai/route.ts`

### Student engagement

- [Reviews](https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/frontend/frontend/components/reviews/ReviewsExplorer.tsx): `padhaanewala/frontend/frontend/components/reviews/ReviewsExplorer.tsx`
- [Review moderation](https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/backend/app/routers/reviews.py): `padhaanewala/backend/app/routers/reviews.py`

### Identity and governance

- [Sign in](https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/frontend/app/login/page.tsx): `padhaanewala/frontend/app/login/page.tsx`
- [Authentication API](https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/backend/app/routers/auth.py): `padhaanewala/backend/app/routers/auth.py`
- [OTP lifecycle](https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/backend/app/services/otp_service.py): `padhaanewala/backend/app/services/otp_service.py`
- [Refresh sessions](https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/backend/app/services/session_service.py): `padhaanewala/backend/app/services/session_service.py`
- [Consent checks](https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/backend/app/services/compliance_service.py): `padhaanewala/backend/app/services/compliance_service.py`

### API and data runtime

- [FastAPI application](https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/backend/app/main.py): `padhaanewala/backend/app/main.py`
- [Catalog APIs](https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/backend/app/routers/colleges.py): `padhaanewala/backend/app/routers/colleges.py`
- [Catalog enrichment](https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/backend/app/routers/enrichment.py): `padhaanewala/backend/app/routers/enrichment.py`
- [Database sessions](https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/backend/app/database.py): `padhaanewala/backend/app/database.py`
- [Domain records](https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/backend/app/models/college.py): `padhaanewala/backend/app/models/college.py`
- [Redis service](https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/backend/app/services/redis_client.py): `padhaanewala/backend/app/services/redis_client.py`
- [Runtime settings](https://github.com/pshkarsngh/padhaanewala_education/blob/main/padhaanewala/backend/app/config.py): `padhaanewala/backend/app/config.py`

### Other components

- **Student**

## Connections

- Student → College explorer: browses
- Student → Course catalog: explores
- Student → College predictor: predicts
- Student → Exam catalog: prepares
- Student → Sign in: signs in
- Student → Mock test engine: takes test
- Student → AI guidance: asks
- Student → Admissions help: seeks help
- FastAPI application → Authentication API: registers (evidence: `padhaanewala/backend/app/main.py`)
- FastAPI application → Catalog APIs: registers (evidence: `padhaanewala/backend/app/main.py`)
- FastAPI application → Catalog enrichment: registers (evidence: `padhaanewala/backend/app/main.py`)
- FastAPI application → Mock test API: registers (evidence: `padhaanewala/backend/app/main.py`)
- FastAPI application → Review moderation: registers (evidence: `padhaanewala/backend/app/main.py`)
- FastAPI application → Database sessions: checks database (evidence: `padhaanewala/backend/app/main.py`)
- FastAPI application → Redis service: closes connection (evidence: `padhaanewala/backend/app/main.py`)
- FastAPI application → Runtime settings: configures runtime (evidence: `padhaanewala/backend/app/main.py`)
- Authentication API → OTP lifecycle: uses lifecycle (evidence: `padhaanewala/backend/app/routers/auth.py`)
- Authentication API → Refresh sessions: rotates sessions (evidence: `padhaanewala/backend/app/routers/auth.py`)
- Authentication API → Consent checks: checks consent (evidence: `padhaanewala/backend/app/routers/auth.py`)
- Authentication API → Database sessions: gets session (evidence: `padhaanewala/backend/app/routers/auth.py`)
- Catalog APIs → Database sessions: gets session
- Review moderation → Database sessions: gets session (evidence: `padhaanewala/backend/app/routers/reviews.py`)
- Database sessions → Runtime settings: reads settings (evidence: `padhaanewala/backend/app/database.py`)
- Authentication API → Domain records: loads models (evidence: `padhaanewala/backend/app/routers/auth.py`)
- Review moderation → Domain records: queries records (evidence: `padhaanewala/backend/app/routers/reviews.py`)
- Sign in → Authentication API: calls API
- College explorer → Catalog APIs: fetches catalog
- Mock test engine → Mock test API: submits attempts
- College predictor → Catalog enrichment: requests prediction
