# akt9802/prasikshan architecture

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

- Interactive diagram: https://gitdiagram.com/akt9802/prasikshan
- Repository: https://github.com/akt9802/prasikshan

## Overview

Prasikshan is an SSB-preparation platform: aspirants select and complete aptitude, psychological, speaking, and interview tests; their submissions are recorded as results and surfaced through progress analytics and rankings. The Next.js application provides test pages and API routes, while MongoDB-backed models store questions, users, and results. Admin pages manage test content. The README documents AI review for selected tests, with a separate FastAPI service. Endpoint wiring is sampled for several question-fetch routes; unsampled test and analytics details are represented only at documented subsystem level.

Main entry points: [`prasikshan/lib/db.ts`](https://github.com/akt9802/prasikshan/blob/next-p/prasikshan/lib/db.ts) (Database Connector), [`prasikshan/app/alltest`](https://github.com/akt9802/prasikshan/tree/next-p/prasikshan/app/alltest) (Test Pages), [`prasikshan/models/UserResult.ts`](https://github.com/akt9802/prasikshan/blob/next-p/prasikshan/models/UserResult.ts) (Test Results), [`prasikshan/models`](https://github.com/akt9802/prasikshan/tree/next-p/prasikshan/models) (Question Sets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Aspirant Experience"]
  node_test_pages["Test Pages"]
  node_single_pages["Practice Pages"]
  node_account_pages["Account Pages"]
  node_analytics_pages["Analytics Pages"]
end

subgraph group_tests["Test Delivery"]
  node_test_apis["Test APIs"]
  node_oir_fetch["OIR Delivery<br/>[route.ts]"]
  node_tat_fetch["TAT Delivery<br/>[route.ts]"]
  node_ppdt_fetch["PPDT Delivery<br/>[route.ts]"]
  node_wat_fetch["WAT Delivery<br/>[route.ts]"]
  node_srt_fetch["SRT Delivery<br/>[route.ts]"]
  node_lecturette_fetch["Lecturette Delivery<br/>[route.ts]"]
  node_test_results["Result APIs<br/>[route.ts]"]
  node_review_apis["AI Review APIs<br/>[route.ts]"]
  node_test_content[("Question Sets")]
end

subgraph group_platform["Platform Services"]
  node_auth_api["Authentication APIs<br/>[route.ts]"]
  node_ranking_api["Ranking APIs<br/>[route.ts]"]
  node_db["Database Connector<br/>[db.ts]"]
  node_users[("User Records<br/>[User.ts]")]
  node_results[("Test Results<br/>[UserResult.ts]")]
end

subgraph group_content["Content Administration"]
  node_admin_pages["Admin Pages<br/>[page.tsx]"]
  node_admin_apis["Content APIs"]
end

subgraph group_ai["AI Review"]
  node_ai_service["AI Service<br/>[app.py]"]
  node_ai_routers["AI Review Routes"]
end

node_aspirant(("Aspirant"))
node_mongo[("MongoDB")]

node_aspirant -->|"selects tests"| node_test_pages
node_aspirant -->|"practices"| node_single_pages
node_aspirant -->|"manages account"| node_account_pages
node_aspirant -->|"views progress"| node_analytics_pages
node_test_pages -->|"requests questions"| node_oir_fetch
node_test_pages -->|"requests questions"| node_tat_fetch
node_test_pages -->|"requests questions"| node_ppdt_fetch
node_test_pages -->|"requests questions"| node_wat_fetch
node_test_pages -->|"requests questions"| node_srt_fetch
node_test_pages -->|"requests topics"| node_lecturette_fetch
node_test_pages -->|"uses test endpoints"| node_test_apis
node_test_apis -->|"submits results"| node_test_results
node_test_apis -.->|"requests review"| node_review_apis
node_oir_fetch -->|"connects"| node_db
node_oir_fetch -->|"reads sets"| node_test_content
node_oir_fetch -->|"checks completion"| node_results
node_tat_fetch -->|"connects"| node_db
node_tat_fetch -->|"reads sets"| node_test_content
node_tat_fetch -->|"checks completion"| node_results
node_ppdt_fetch -->|"connects"| node_db
node_ppdt_fetch -->|"reads prompts"| node_test_content
node_ppdt_fetch -->|"checks completion"| node_results
node_wat_fetch -->|"connects"| node_db
node_wat_fetch -->|"reads sets"| node_test_content
node_wat_fetch -->|"checks completion"| node_results
node_srt_fetch -->|"connects"| node_db
node_srt_fetch -->|"reads sets"| node_test_content
node_srt_fetch -->|"checks completion"| node_results
node_lecturette_fetch -->|"connects"| node_db
node_lecturette_fetch -->|"reads topics"| node_test_content
node_lecturette_fetch -->|"checks completion"| node_results
node_test_results -->|"connects"| node_db
node_test_results -->|"writes scores"| node_results
node_review_apis -.->|"requests evaluation"| node_ai_service
node_ai_service -->|"dispatches review"| node_ai_routers
node_auth_api -->|"connects"| node_db
node_auth_api -->|"reads and writes"| node_users
node_ranking_api -->|"connects"| node_db
node_ranking_api -->|"reads users"| node_users
node_ranking_api -->|"reads scores"| node_results
node_analytics_pages -->|"requests rankings"| node_ranking_api
node_analytics_pages -->|"requests progress"| node_test_apis
node_admin_pages -->|"manages content"| node_admin_apis
node_admin_apis -->|"connects"| node_db
node_admin_apis -->|"checks admin role"| node_users
node_admin_apis -->|"creates and edits"| node_test_content
node_db -->|"connects"| node_mongo

click node_test_pages "https://github.com/akt9802/prasikshan/tree/next-p/prasikshan/app/alltest"
click node_single_pages "https://github.com/akt9802/prasikshan/tree/next-p/prasikshan/app/fivequestion"
click node_account_pages "https://github.com/akt9802/prasikshan/tree/next-p/prasikshan/app/signin"
click node_analytics_pages "https://github.com/akt9802/prasikshan/tree/next-p/prasikshan/app/ranking"
click node_test_apis "https://github.com/akt9802/prasikshan/tree/next-p/prasikshan/app/api"
click node_oir_fetch "https://github.com/akt9802/prasikshan/blob/next-p/prasikshan/app/api/oirquestions/route.ts"
click node_tat_fetch "https://github.com/akt9802/prasikshan/blob/next-p/prasikshan/app/api/tatquestions/route.ts"
click node_ppdt_fetch "https://github.com/akt9802/prasikshan/blob/next-p/prasikshan/app/api/ppdtquestions/route.ts"
click node_wat_fetch "https://github.com/akt9802/prasikshan/blob/next-p/prasikshan/app/api/watquestions/route.ts"
click node_srt_fetch "https://github.com/akt9802/prasikshan/blob/next-p/prasikshan/app/api/srtquestions/route.ts"
click node_lecturette_fetch "https://github.com/akt9802/prasikshan/blob/next-p/prasikshan/app/api/lecturettequestions/route.ts"
click node_test_results "https://github.com/akt9802/prasikshan/blob/next-p/prasikshan/app/api/oirquestions/result/route.ts"
click node_review_apis "https://github.com/akt9802/prasikshan/blob/next-p/prasikshan/app/api/ppdt-review/route.ts"
click node_auth_api "https://github.com/akt9802/prasikshan/blob/next-p/prasikshan/app/api/auth/signin/route.ts"
click node_ranking_api "https://github.com/akt9802/prasikshan/blob/next-p/prasikshan/app/api/ranking/route.ts"
click node_admin_pages "https://github.com/akt9802/prasikshan/blob/next-p/prasikshan/app/admin/page.tsx"
click node_admin_apis "https://github.com/akt9802/prasikshan/tree/next-p/prasikshan/app/api/admin"
click node_db "https://github.com/akt9802/prasikshan/blob/next-p/prasikshan/lib/db.ts"
click node_users "https://github.com/akt9802/prasikshan/blob/next-p/prasikshan/models/User.ts"
click node_results "https://github.com/akt9802/prasikshan/blob/next-p/prasikshan/models/UserResult.ts"
click node_test_content "https://github.com/akt9802/prasikshan/tree/next-p/prasikshan/models"
click node_ai_service "https://github.com/akt9802/prasikshan/blob/next-p/prasikshan-ai-service/app.py"
click node_ai_routers "https://github.com/akt9802/prasikshan/tree/next-p/prasikshan-ai-service/routers"

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_test_pages,node_single_pages,node_account_pages,node_analytics_pages toneBlue
class node_test_apis,node_oir_fetch,node_tat_fetch,node_ppdt_fetch,node_wat_fetch,node_srt_fetch,node_lecturette_fetch,node_test_results,node_review_apis,node_test_content,node_mongo toneAmber
class node_auth_api,node_ranking_api,node_db,node_users,node_results toneMint
class node_admin_pages,node_admin_apis toneRose
class node_ai_service,node_ai_routers,node_aspirant toneIndigo
```

## Components

### Aspirant Experience

- [Test Pages](https://github.com/akt9802/prasikshan/tree/next-p/prasikshan/app/alltest): `prasikshan/app/alltest`
- [Practice Pages](https://github.com/akt9802/prasikshan/tree/next-p/prasikshan/app/fivequestion): `prasikshan/app/fivequestion`
- [Account Pages](https://github.com/akt9802/prasikshan/tree/next-p/prasikshan/app/signin): `prasikshan/app/signin`
- [Analytics Pages](https://github.com/akt9802/prasikshan/tree/next-p/prasikshan/app/ranking): `prasikshan/app/ranking`

### Test Delivery

- [Test APIs](https://github.com/akt9802/prasikshan/tree/next-p/prasikshan/app/api): `prasikshan/app/api`
- [OIR Delivery](https://github.com/akt9802/prasikshan/blob/next-p/prasikshan/app/api/oirquestions/route.ts): `prasikshan/app/api/oirquestions/route.ts`
- [TAT Delivery](https://github.com/akt9802/prasikshan/blob/next-p/prasikshan/app/api/tatquestions/route.ts): `prasikshan/app/api/tatquestions/route.ts`
- [PPDT Delivery](https://github.com/akt9802/prasikshan/blob/next-p/prasikshan/app/api/ppdtquestions/route.ts): `prasikshan/app/api/ppdtquestions/route.ts`
- [WAT Delivery](https://github.com/akt9802/prasikshan/blob/next-p/prasikshan/app/api/watquestions/route.ts): `prasikshan/app/api/watquestions/route.ts`
- [SRT Delivery](https://github.com/akt9802/prasikshan/blob/next-p/prasikshan/app/api/srtquestions/route.ts): `prasikshan/app/api/srtquestions/route.ts`
- [Lecturette Delivery](https://github.com/akt9802/prasikshan/blob/next-p/prasikshan/app/api/lecturettequestions/route.ts): `prasikshan/app/api/lecturettequestions/route.ts`
- [Result APIs](https://github.com/akt9802/prasikshan/blob/next-p/prasikshan/app/api/oirquestions/result/route.ts): `prasikshan/app/api/oirquestions/result/route.ts`
- [AI Review APIs](https://github.com/akt9802/prasikshan/blob/next-p/prasikshan/app/api/ppdt-review/route.ts): `prasikshan/app/api/ppdt-review/route.ts`
- [Question Sets](https://github.com/akt9802/prasikshan/tree/next-p/prasikshan/models): `prasikshan/models`

### Platform Services

- [Authentication APIs](https://github.com/akt9802/prasikshan/blob/next-p/prasikshan/app/api/auth/signin/route.ts): `prasikshan/app/api/auth/signin/route.ts`
- [Ranking APIs](https://github.com/akt9802/prasikshan/blob/next-p/prasikshan/app/api/ranking/route.ts): `prasikshan/app/api/ranking/route.ts`
- [Database Connector](https://github.com/akt9802/prasikshan/blob/next-p/prasikshan/lib/db.ts): `prasikshan/lib/db.ts`
- [User Records](https://github.com/akt9802/prasikshan/blob/next-p/prasikshan/models/User.ts): `prasikshan/models/User.ts`
- [Test Results](https://github.com/akt9802/prasikshan/blob/next-p/prasikshan/models/UserResult.ts): `prasikshan/models/UserResult.ts`

### Content Administration

- [Admin Pages](https://github.com/akt9802/prasikshan/blob/next-p/prasikshan/app/admin/page.tsx): `prasikshan/app/admin/page.tsx`
- [Content APIs](https://github.com/akt9802/prasikshan/tree/next-p/prasikshan/app/api/admin): `prasikshan/app/api/admin`

### AI Review

- [AI Service](https://github.com/akt9802/prasikshan/blob/next-p/prasikshan-ai-service/app.py): `prasikshan-ai-service/app.py`
- [AI Review Routes](https://github.com/akt9802/prasikshan/tree/next-p/prasikshan-ai-service/routers): `prasikshan-ai-service/routers`

### Other components

- **Aspirant**
- **MongoDB**

## Connections

- Aspirant → Test Pages: selects tests
- Aspirant → Practice Pages: practices
- Aspirant → Account Pages: manages account
- Aspirant → Analytics Pages: views progress
- Test Pages → OIR Delivery: requests questions
- Test Pages → TAT Delivery: requests questions
- Test Pages → PPDT Delivery: requests questions
- Test Pages → WAT Delivery: requests questions
- Test Pages → SRT Delivery: requests questions
- Test Pages → Lecturette Delivery: requests topics
- Test Pages → Test APIs: uses test endpoints
- Test APIs → Result APIs: submits results
- Test APIs → AI Review APIs: requests review
- OIR Delivery → Database Connector: connects
- OIR Delivery → Question Sets: reads sets
- OIR Delivery → Test Results: checks completion
- TAT Delivery → Database Connector: connects
- TAT Delivery → Question Sets: reads sets
- TAT Delivery → Test Results: checks completion
- PPDT Delivery → Database Connector: connects
- PPDT Delivery → Question Sets: reads prompts
- PPDT Delivery → Test Results: checks completion
- WAT Delivery → Database Connector: connects
- WAT Delivery → Question Sets: reads sets
- WAT Delivery → Test Results: checks completion
- SRT Delivery → Database Connector: connects
- SRT Delivery → Question Sets: reads sets
- SRT Delivery → Test Results: checks completion
- Lecturette Delivery → Database Connector: connects
- Lecturette Delivery → Question Sets: reads topics
- Lecturette Delivery → Test Results: checks completion
- Result APIs → Database Connector: connects
- Result APIs → Test Results: writes scores
- AI Review APIs → AI Service: requests evaluation
- AI Service → AI Review Routes: dispatches review
- Authentication APIs → Database Connector: connects
- Authentication APIs → User Records: reads and writes
- Ranking APIs → Database Connector: connects
- Ranking APIs → User Records: reads users
- Ranking APIs → Test Results: reads scores
- Analytics Pages → Ranking APIs: requests rankings
- Analytics Pages → Test APIs: requests progress
- Admin Pages → Content APIs: manages content
- Content APIs → Database Connector: connects
- Content APIs → User Records: checks admin role
- Content APIs → Question Sets: creates and edits
- Database Connector → MongoDB: connects
