# harine77/examination_workflow_qp_management_system architecture

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

- Interactive diagram: https://gitdiagram.com/harine77/examination_workflow_qp_management_system
- Repository: https://github.com/harine77/examination_workflow_qp_management_system

## Overview

This is a role-based examination and question-paper workflow: faculty prepare and submit papers, successive reviewers and a panel evaluate them, and the HOD gives final approval or returns finalized papers. The React application provides role-specific screens; Express routes enforce workflow and access rules, with PostgreSQL-backed models and services for mapping, PDF work, and answer-key generation. The README documents capabilities such as scheduling, secure release, audit logging, and notifications, but sampled excerpts do not establish every implementation link or storage detail.

Main entry points: [`frontend/src/App.jsx`](https://github.com/harine77/examination_workflow_qp_management_system/blob/main/frontend/src/App.jsx) (Role-based routes), [`frontend/src/services/api.js`](https://github.com/harine77/examination_workflow_qp_management_system/blob/main/frontend/src/services/api.js) (HTTP API client), [`backend/routes/questionRoutes.js`](https://github.com/harine77/examination_workflow_qp_management_system/blob/main/backend/routes/questionRoutes.js) (Paper and question API), [`backend/models/QuestionPaper.js`](https://github.com/harine77/examination_workflow_qp_management_system/blob/main/backend/models/QuestionPaper.js) (Question papers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_frontend["Role-based routes<br/>[App.jsx]"]
  node_papersui["Paper authoring"]
  node_aipaper["AI paper creation<br/>[AICreatePaper.jsx]"]
  node_reviewui["Scrutinizer review"]
  node_paperread["Paper viewing<br/>[PaperView.jsx]"]
  node_hodui["HOD workflow screens<br/>[HODDashboardV2.jsx]"]
  node_panelui["Panel review screens<br/>[PanelPapers.jsx]"]
  node_api["HTTP API client<br/>[api.js]"]
end

subgraph group_workflow["Paper workflow"]
  node_questionroutes["Paper and question API<br/>[questionRoutes.js]"]
  node_scrutinizeroutes["Scrutinizer workflow API"]
  node_hodroutes["HOD workflow API<br/>[hodRoutes.js]"]
end

subgraph group_services["Analysis and outputs"]
  node_airoutes["AI generation API"]
  node_pdfroutes["PDF API<br/>[pdfRoutes.js]"]
  node_nlp["CO and level mapping<br/>[nlpService.js]"]
  node_answerkey["Answer-key generation"]
  node_pdfservice["PDF processing<br/>[pdfService.js]"]
end

subgraph group_identity["Identity and access"]
  node_authui["Client auth state<br/>[authContext.jsx]"]
  node_authroutes["Authentication routes<br/>[authRoutes.js]"]
  node_guard["JWT and role guards<br/>[authMiddleware.js]"]
end

subgraph group_data["Persistence"]
  node_papers[("Question papers<br/>[QuestionPaper.js]")]
  node_questions[("Questions<br/>[Question.js]")]
  node_courses[("Courses and outcomes<br/>[CourseOutcome.js]")]
  node_users[("User records<br/>[user.js]")]
end

node_faculty(("Faculty / setter"))
node_reviewers(("Reviewers and panel"))
node_hod(("HOD / administrator"))
node_postgres[("PostgreSQL")]
node_ollama["Ollama model service"]

node_faculty -->|"uses"| node_frontend
node_reviewers -->|"uses"| node_frontend
node_hod -->|"uses"| node_frontend
node_frontend -->|"provides auth"| node_authui
node_frontend -->|"routes to"| node_papersui
node_frontend -->|"routes to"| node_aipaper
node_frontend -->|"routes to"| node_reviewui
node_frontend -->|"routes to"| node_paperread
node_frontend -->|"routes to"| node_hodui
node_frontend -->|"routes to"| node_panelui
node_authui -->|"authenticates via"| node_authroutes
node_papersui -.->|"submits requests"| node_api
node_aipaper -->|"sends requests"| node_api
node_reviewui -->|"sends requests"| node_api
node_hodui -->|"sends requests"| node_api
node_panelui -.->|"sends requests"| node_api
node_api -.->|"calls API"| node_questionroutes
node_authroutes -->|"uses accounts"| node_users
node_questionroutes -->|"applies access"| node_guard
node_scrutinizeroutes -->|"applies access"| node_guard
node_hodroutes -->|"applies access"| node_guard
node_questionroutes -->|"reads and updates"| node_papers
node_questionroutes -->|"stores questions"| node_questions
node_questionroutes -->|"analyzes questions"| node_nlp
node_scrutinizeroutes -->|"advances review"| node_papers
node_hodroutes -->|"finalizes papers"| node_papers
node_hodroutes -->|"generates key"| node_answerkey
node_airoutes -->|"applies access"| node_guard
node_pdfroutes -->|"delegates PDF work"| node_pdfservice
node_pdfroutes -->|"loads paper data"| node_papers
node_nlp -->|"uses outcomes"| node_courses
node_answerkey -.->|"requests generation"| node_ollama
node_papers -.->|"persists through ORM"| node_postgres
node_questions -.->|"persists through ORM"| node_postgres
node_courses -.->|"persists through ORM"| node_postgres
node_users -.->|"persists through ORM"| node_postgres

click node_frontend "https://github.com/harine77/examination_workflow_qp_management_system/blob/main/frontend/src/App.jsx"
click node_authui "https://github.com/harine77/examination_workflow_qp_management_system/blob/main/frontend/src/context/authContext.jsx"
click node_papersui "https://github.com/harine77/examination_workflow_qp_management_system/blob/main/frontend/src/components/QuestionPaperCreator.jsx"
click node_aipaper "https://github.com/harine77/examination_workflow_qp_management_system/blob/main/frontend/src/pages/AICreatePaper.jsx"
click node_reviewui "https://github.com/harine77/examination_workflow_qp_management_system/blob/main/frontend/src/pages/Scrutinizerdashboard.jsx"
click node_paperread "https://github.com/harine77/examination_workflow_qp_management_system/blob/main/frontend/src/pages/PaperView.jsx"
click node_hodui "https://github.com/harine77/examination_workflow_qp_management_system/blob/main/frontend/src/pages/HODDashboardV2.jsx"
click node_panelui "https://github.com/harine77/examination_workflow_qp_management_system/blob/main/frontend/src/pages/PanelPapers.jsx"
click node_api "https://github.com/harine77/examination_workflow_qp_management_system/blob/main/frontend/src/services/api.js"
click node_authroutes "https://github.com/harine77/examination_workflow_qp_management_system/blob/main/backend/routes/authRoutes.js"
click node_guard "https://github.com/harine77/examination_workflow_qp_management_system/blob/main/backend/middleware/authMiddleware.js"
click node_questionroutes "https://github.com/harine77/examination_workflow_qp_management_system/blob/main/backend/routes/questionRoutes.js"
click node_scrutinizeroutes "https://github.com/harine77/examination_workflow_qp_management_system/blob/main/backend/routes/ScrutinizerRoutes.js"
click node_hodroutes "https://github.com/harine77/examination_workflow_qp_management_system/blob/main/backend/routes/hodRoutes.js"
click node_airoutes "https://github.com/harine77/examination_workflow_qp_management_system/blob/main/backend/routes/aiGenerateRoutes.js"
click node_pdfroutes "https://github.com/harine77/examination_workflow_qp_management_system/blob/main/backend/routes/pdfRoutes.js"
click node_nlp "https://github.com/harine77/examination_workflow_qp_management_system/blob/main/backend/services/nlpService.js"
click node_answerkey "https://github.com/harine77/examination_workflow_qp_management_system/blob/main/backend/services/ollamaAnswerKeyService.js"
click node_pdfservice "https://github.com/harine77/examination_workflow_qp_management_system/blob/main/backend/services/pdfService.js"
click node_papers "https://github.com/harine77/examination_workflow_qp_management_system/blob/main/backend/models/QuestionPaper.js"
click node_questions "https://github.com/harine77/examination_workflow_qp_management_system/blob/main/backend/models/Question.js"
click node_courses "https://github.com/harine77/examination_workflow_qp_management_system/blob/main/backend/models/CourseOutcome.js"
click node_users "https://github.com/harine77/examination_workflow_qp_management_system/blob/main/backend/models/user.js"

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_frontend,node_papersui,node_aipaper,node_reviewui,node_paperread,node_hodui,node_panelui,node_api,node_reviewers toneBlue
class node_questionroutes,node_scrutinizeroutes,node_hodroutes,node_postgres toneAmber
class node_airoutes,node_pdfroutes,node_nlp,node_answerkey,node_pdfservice toneMint
class node_authui,node_authroutes,node_guard toneRose
class node_papers,node_questions,node_courses,node_users,node_faculty,node_hod,node_ollama toneIndigo
```

## Components

### Web application

- [Role-based routes](https://github.com/harine77/examination_workflow_qp_management_system/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Paper authoring](https://github.com/harine77/examination_workflow_qp_management_system/blob/main/frontend/src/components/QuestionPaperCreator.jsx): `frontend/src/components/QuestionPaperCreator.jsx`
- [AI paper creation](https://github.com/harine77/examination_workflow_qp_management_system/blob/main/frontend/src/pages/AICreatePaper.jsx): `frontend/src/pages/AICreatePaper.jsx`
- [Scrutinizer review](https://github.com/harine77/examination_workflow_qp_management_system/blob/main/frontend/src/pages/Scrutinizerdashboard.jsx): `frontend/src/pages/Scrutinizerdashboard.jsx`
- [Paper viewing](https://github.com/harine77/examination_workflow_qp_management_system/blob/main/frontend/src/pages/PaperView.jsx): `frontend/src/pages/PaperView.jsx`
- [HOD workflow screens](https://github.com/harine77/examination_workflow_qp_management_system/blob/main/frontend/src/pages/HODDashboardV2.jsx): `frontend/src/pages/HODDashboardV2.jsx`
- [Panel review screens](https://github.com/harine77/examination_workflow_qp_management_system/blob/main/frontend/src/pages/PanelPapers.jsx): `frontend/src/pages/PanelPapers.jsx`
- [HTTP API client](https://github.com/harine77/examination_workflow_qp_management_system/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### Paper workflow

- [Paper and question API](https://github.com/harine77/examination_workflow_qp_management_system/blob/main/backend/routes/questionRoutes.js): `backend/routes/questionRoutes.js`
- [Scrutinizer workflow API](https://github.com/harine77/examination_workflow_qp_management_system/blob/main/backend/routes/ScrutinizerRoutes.js): `backend/routes/ScrutinizerRoutes.js`
- [HOD workflow API](https://github.com/harine77/examination_workflow_qp_management_system/blob/main/backend/routes/hodRoutes.js): `backend/routes/hodRoutes.js`

### Analysis and outputs

- [AI generation API](https://github.com/harine77/examination_workflow_qp_management_system/blob/main/backend/routes/aiGenerateRoutes.js): `backend/routes/aiGenerateRoutes.js`
- [PDF API](https://github.com/harine77/examination_workflow_qp_management_system/blob/main/backend/routes/pdfRoutes.js): `backend/routes/pdfRoutes.js`
- [CO and level mapping](https://github.com/harine77/examination_workflow_qp_management_system/blob/main/backend/services/nlpService.js): `backend/services/nlpService.js`
- [Answer-key generation](https://github.com/harine77/examination_workflow_qp_management_system/blob/main/backend/services/ollamaAnswerKeyService.js): `backend/services/ollamaAnswerKeyService.js`
- [PDF processing](https://github.com/harine77/examination_workflow_qp_management_system/blob/main/backend/services/pdfService.js): `backend/services/pdfService.js`

### Identity and access

- [Client auth state](https://github.com/harine77/examination_workflow_qp_management_system/blob/main/frontend/src/context/authContext.jsx): `frontend/src/context/authContext.jsx`
- [Authentication routes](https://github.com/harine77/examination_workflow_qp_management_system/blob/main/backend/routes/authRoutes.js): `backend/routes/authRoutes.js`
- [JWT and role guards](https://github.com/harine77/examination_workflow_qp_management_system/blob/main/backend/middleware/authMiddleware.js): `backend/middleware/authMiddleware.js`

### Persistence

- [Question papers](https://github.com/harine77/examination_workflow_qp_management_system/blob/main/backend/models/QuestionPaper.js): `backend/models/QuestionPaper.js`
- [Questions](https://github.com/harine77/examination_workflow_qp_management_system/blob/main/backend/models/Question.js): `backend/models/Question.js`
- [Courses and outcomes](https://github.com/harine77/examination_workflow_qp_management_system/blob/main/backend/models/CourseOutcome.js): `backend/models/CourseOutcome.js`
- [User records](https://github.com/harine77/examination_workflow_qp_management_system/blob/main/backend/models/user.js): `backend/models/user.js`

### Other components

- **Faculty / setter**
- **Reviewers and panel**
- **HOD / administrator**
- **PostgreSQL**
- **Ollama model service**

## Connections

- Faculty / setter → Role-based routes: uses (evidence: `README.md`)
- Reviewers and panel → Role-based routes: uses (evidence: `README.md`)
- HOD / administrator → Role-based routes: uses (evidence: `README.md`)
- Role-based routes → Client auth state: provides auth (evidence: `frontend/src/App.jsx`)
- Role-based routes → Paper authoring: routes to (evidence: `frontend/src/App.jsx`)
- Role-based routes → AI paper creation: routes to (evidence: `frontend/src/App.jsx`)
- Role-based routes → Scrutinizer review: routes to (evidence: `frontend/src/App.jsx`)
- Role-based routes → Paper viewing: routes to (evidence: `frontend/src/App.jsx`)
- Role-based routes → HOD workflow screens: routes to (evidence: `frontend/src/App.jsx`)
- Role-based routes → Panel review screens: routes to (evidence: `frontend/src/App.jsx`)
- Client auth state → Authentication routes: authenticates via (evidence: `frontend/src/context/authContext.jsx`)
- Paper authoring → HTTP API client: submits requests
- AI paper creation → HTTP API client: sends requests (evidence: `frontend/src/pages/AICreatePaper.jsx`)
- Scrutinizer review → HTTP API client: sends requests (evidence: `frontend/src/pages/Scrutinizerdashboard.jsx`)
- HOD workflow screens → HTTP API client: sends requests (evidence: `frontend/src/pages/HODDashboardV2.jsx`)
- Panel review screens → HTTP API client: sends requests
- HTTP API client → Paper and question API: calls API
- Authentication routes → User records: uses accounts (evidence: `backend/routes/authRoutes.js`)
- Paper and question API → JWT and role guards: applies access (evidence: `backend/routes/questionRoutes.js`)
- Scrutinizer workflow API → JWT and role guards: applies access (evidence: `backend/routes/ScrutinizerRoutes.js`)
- HOD workflow API → JWT and role guards: applies access (evidence: `backend/routes/hodRoutes.js`)
- Paper and question API → Question papers: reads and updates (evidence: `backend/routes/questionRoutes.js`)
- Paper and question API → Questions: stores questions (evidence: `backend/routes/questionRoutes.js`)
- Paper and question API → CO and level mapping: analyzes questions (evidence: `backend/routes/questionRoutes.js`)
- Scrutinizer workflow API → Question papers: advances review (evidence: `backend/routes/ScrutinizerRoutes.js`)
- HOD workflow API → Question papers: finalizes papers (evidence: `backend/routes/hodRoutes.js`)
- HOD workflow API → Answer-key generation: generates key (evidence: `backend/routes/hodRoutes.js`)
- AI generation API → JWT and role guards: applies access (evidence: `backend/routes/aiGenerateRoutes.js`)
- PDF API → PDF processing: delegates PDF work (evidence: `backend/routes/pdfRoutes.js`)
- PDF API → Question papers: loads paper data (evidence: `backend/routes/pdfRoutes.js`)
- CO and level mapping → Courses and outcomes: uses outcomes (evidence: `backend/services/nlpService.js`)
- Answer-key generation → Ollama model service: requests generation
- Question papers → PostgreSQL: persists through ORM
- Questions → PostgreSQL: persists through ORM
- Courses and outcomes → PostgreSQL: persists through ORM
- User records → PostgreSQL: persists through ORM
