# om-singh-d/question-paper-generation-system architecture

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

- Interactive diagram: https://gitdiagram.com/om-singh-d/question-paper-generation-system
- Repository: https://github.com/om-singh-d/question-paper-generation-system

## Overview

EduAssess AI is an exam-paper authoring platform: users configure papers, upload syllabus material, and receive generated papers with rubrics and outcome/Bloom analytics. The clearest evidenced backend workflow is syllabus upload through parsing/chunking into vector search, and paper generation through retrieval, question validation, rubric creation, and PDF rendering. The frontend contains dashboard, generation, preview, document, and analytics surfaces, but their UI-to-API wiring is not shown in the excerpts. The separate structured syllabus parser is present, but its integration is not evidenced.

Main entry points: [`backend/main.py`](https://github.com/om-singh-d/question-paper-generation-system/blob/main/backend/main.py) (Core API), [`backend/services/agent_engine.py`](https://github.com/om-singh-d/question-paper-generation-system/blob/main/backend/services/agent_engine.py) (Question agent workflow), [`backend/models.py`](https://github.com/om-singh-d/question-paper-generation-system/blob/main/backend/models.py) (Academic models), [`backend/services/vector_store.py`](https://github.com/om-singh-d/question-paper-generation-system/blob/main/backend/services/vector_store.py) (Vector search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend"]
  node_dashboard["Dashboard<br/>[page.tsx]"]
  node_documents["Documents<br/>[page.tsx]"]
  node_generation_ui["Generation UI<br/>[page.tsx]"]
  node_preview["Paper preview<br/>[page.tsx]"]
  node_analytics_ui["Analytics view<br/>[AnalyticsView.tsx]"]
end

subgraph group_api["API and orchestration"]
  node_upload_proxy["Upload proxy<br/>[route.ts]"]
  node_generate_proxy["Generation proxy<br/>[route.ts]"]
  node_status_api["Paper status API<br/>[route.ts]"]
  node_analytics_api["Analytics API<br/>[route.ts]"]
  node_backend["Core API<br/>[main.py]"]
  node_models["Academic models<br/>[models.py]"]
  node_database[("PostgreSQL<br/>[database.py]")]
end

subgraph group_content["Syllabus processing"]
  node_document_service["Document ingestion"]
  node_document_parser["Structured syllabus parser<br/>[document_parser.py]"]
  node_vector_store[("Vector search<br/>[vector_store.py]")]
end

subgraph group_generation["Paper generation"]
  node_agent_engine["Question agent workflow<br/>[agent_engine.py]"]
  node_pdf_generator["PDF renderer<br/>[pdf_generator.py]"]
end

node_user(("User"))
node_qdrant[("Qdrant")]
node_ollama["Ollama LLM"]

node_upload_proxy -->|"forwards upload"| node_backend
node_generate_proxy -->|"forwards blueprint"| node_backend
node_backend -->|"queues ingestion"| node_document_service
node_document_service -->|"upserts chunks"| node_vector_store
node_backend -->|"invokes generation"| node_agent_engine
node_agent_engine -->|"retrieves context"| node_vector_store
node_agent_engine -->|"requests generation"| node_ollama
node_backend -->|"renders paper"| node_pdf_generator
node_vector_store -->|"reads and writes vectors"| node_qdrant
node_document_parser -->|"stores parsed syllabus"| node_database
node_document_parser -->|"creates records"| node_models
node_backend -->|"uses sessions"| node_database
node_backend -->|"queries models"| node_models
node_models -->|"uses base"| node_database

click node_dashboard "https://github.com/om-singh-d/question-paper-generation-system/blob/main/frontend/app/dashboard/page.tsx"
click node_documents "https://github.com/om-singh-d/question-paper-generation-system/blob/main/frontend/app/documents/page.tsx"
click node_generation_ui "https://github.com/om-singh-d/question-paper-generation-system/blob/main/frontend/app/generation/page.tsx"
click node_preview "https://github.com/om-singh-d/question-paper-generation-system/blob/main/frontend/app/preview/page.tsx"
click node_analytics_ui "https://github.com/om-singh-d/question-paper-generation-system/blob/main/frontend/components/AnalyticsView.tsx"
click node_upload_proxy "https://github.com/om-singh-d/question-paper-generation-system/blob/main/frontend/app/api/upload-syllabus/route.ts"
click node_generate_proxy "https://github.com/om-singh-d/question-paper-generation-system/blob/main/frontend/app/api/generate-paper/route.ts"
click node_status_api "https://github.com/om-singh-d/question-paper-generation-system/blob/main/frontend/app/api/paper-status/%5BpaperId%5D/route.ts"
click node_analytics_api "https://github.com/om-singh-d/question-paper-generation-system/blob/main/frontend/app/api/analytics/%5BpaperId%5D/route.ts"
click node_backend "https://github.com/om-singh-d/question-paper-generation-system/blob/main/backend/main.py"
click node_models "https://github.com/om-singh-d/question-paper-generation-system/blob/main/backend/models.py"
click node_database "https://github.com/om-singh-d/question-paper-generation-system/blob/main/backend/database.py"
click node_document_service "https://github.com/om-singh-d/question-paper-generation-system/blob/main/backend/services/document_service.py"
click node_document_parser "https://github.com/om-singh-d/question-paper-generation-system/blob/main/backend/services/document_parser.py"
click node_vector_store "https://github.com/om-singh-d/question-paper-generation-system/blob/main/backend/services/vector_store.py"
click node_agent_engine "https://github.com/om-singh-d/question-paper-generation-system/blob/main/backend/services/agent_engine.py"
click node_pdf_generator "https://github.com/om-singh-d/question-paper-generation-system/blob/main/backend/services/pdf_generator.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_dashboard,node_documents,node_generation_ui,node_preview,node_analytics_ui,node_user toneBlue
class node_upload_proxy,node_generate_proxy,node_status_api,node_analytics_api,node_backend,node_models,node_database,node_qdrant toneAmber
class node_document_service,node_document_parser,node_vector_store toneMint
class node_agent_engine,node_pdf_generator toneRose
class node_ollama toneIndigo
```

## Components

### Frontend

- [Dashboard](https://github.com/om-singh-d/question-paper-generation-system/blob/main/frontend/app/dashboard/page.tsx): `frontend/app/dashboard/page.tsx`
- [Documents](https://github.com/om-singh-d/question-paper-generation-system/blob/main/frontend/app/documents/page.tsx): `frontend/app/documents/page.tsx`
- [Generation UI](https://github.com/om-singh-d/question-paper-generation-system/blob/main/frontend/app/generation/page.tsx): `frontend/app/generation/page.tsx`
- [Paper preview](https://github.com/om-singh-d/question-paper-generation-system/blob/main/frontend/app/preview/page.tsx): `frontend/app/preview/page.tsx`
- [Analytics view](https://github.com/om-singh-d/question-paper-generation-system/blob/main/frontend/components/AnalyticsView.tsx): `frontend/components/AnalyticsView.tsx`

### API and orchestration

- [Upload proxy](https://github.com/om-singh-d/question-paper-generation-system/blob/main/frontend/app/api/upload-syllabus/route.ts): `frontend/app/api/upload-syllabus/route.ts`
- [Generation proxy](https://github.com/om-singh-d/question-paper-generation-system/blob/main/frontend/app/api/generate-paper/route.ts): `frontend/app/api/generate-paper/route.ts`
- [Paper status API](https://github.com/om-singh-d/question-paper-generation-system/blob/main/frontend/app/api/paper-status/%5BpaperId%5D/route.ts): `frontend/app/api/paper-status/[paperId]/route.ts`
- [Analytics API](https://github.com/om-singh-d/question-paper-generation-system/blob/main/frontend/app/api/analytics/%5BpaperId%5D/route.ts): `frontend/app/api/analytics/[paperId]/route.ts`
- [Core API](https://github.com/om-singh-d/question-paper-generation-system/blob/main/backend/main.py): `backend/main.py`
- [Academic models](https://github.com/om-singh-d/question-paper-generation-system/blob/main/backend/models.py): `backend/models.py`
- [PostgreSQL](https://github.com/om-singh-d/question-paper-generation-system/blob/main/backend/database.py): `backend/database.py`

### Syllabus processing

- [Document ingestion](https://github.com/om-singh-d/question-paper-generation-system/blob/main/backend/services/document_service.py): `backend/services/document_service.py`
- [Structured syllabus parser](https://github.com/om-singh-d/question-paper-generation-system/blob/main/backend/services/document_parser.py): `backend/services/document_parser.py`
- [Vector search](https://github.com/om-singh-d/question-paper-generation-system/blob/main/backend/services/vector_store.py): `backend/services/vector_store.py`

### Paper generation

- [Question agent workflow](https://github.com/om-singh-d/question-paper-generation-system/blob/main/backend/services/agent_engine.py): `backend/services/agent_engine.py`
- [PDF renderer](https://github.com/om-singh-d/question-paper-generation-system/blob/main/backend/services/pdf_generator.py): `backend/services/pdf_generator.py`

### Other components

- **User**
- **Qdrant**
- **Ollama LLM**

## Connections

- Upload proxy → Core API: forwards upload (evidence: `frontend/app/api/upload-syllabus/route.ts`)
- Generation proxy → Core API: forwards blueprint (evidence: `frontend/app/api/generate-paper/route.ts`)
- Core API → Document ingestion: queues ingestion (evidence: `backend/main.py`)
- Document ingestion → Vector search: upserts chunks (evidence: `backend/services/document_service.py`)
- Core API → Question agent workflow: invokes generation (evidence: `backend/main.py`)
- Question agent workflow → Vector search: retrieves context (evidence: `backend/services/agent_engine.py`)
- Question agent workflow → Ollama LLM: requests generation (evidence: `backend/services/agent_engine.py`)
- Core API → PDF renderer: renders paper (evidence: `backend/main.py`)
- Vector search → Qdrant: reads and writes vectors (evidence: `backend/services/vector_store.py`)
- Structured syllabus parser → PostgreSQL: stores parsed syllabus (evidence: `backend/services/document_parser.py`)
- Structured syllabus parser → Academic models: creates records (evidence: `backend/services/document_parser.py`)
- Core API → PostgreSQL: uses sessions (evidence: `backend/main.py`)
- Core API → Academic models: queries models (evidence: `backend/main.py`)
- Academic models → PostgreSQL: uses base (evidence: `backend/models.py`)
