# techverse26/exam-question-generator architecture

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

- Interactive diagram: https://gitdiagram.com/techverse26/exam-question-generator
- Repository: https://github.com/techverse26/exam-question-generator

## Overview

EXAM MASTER is a school-oriented examination management app centered on building, storing, previewing, and exporting question papers. Users authenticate, select an institution, compose papers from question editors or the question bank, then preview and export them; separate capabilities include templates, answer keys, imports, analytics, team/academic management, AI generation, and subscriptions. The graph combines documented routes and README capabilities with sampled service and rendering relationships. Unsampled feature internals are represented by their exact existing paths; optional integrations are marked dashed where implementation wiring was not shown.

Main entry points: [`src/routes/AppRoutes.jsx`](https://github.com/techverse26/exam-question-generator/blob/main/src/routes/AppRoutes.jsx) (Routes and guards), [`src/pages/QuestionBuilder/index.jsx`](https://github.com/techverse26/exam-question-generator/blob/main/src/pages/QuestionBuilder/index.jsx) (Paper builder), [`src/preview/paperModel.js`](https://github.com/techverse26/exam-question-generator/blob/main/src/preview/paperModel.js) (Paper document model), [`src/firebase/config.js`](https://github.com/techverse26/exam-question-generator/blob/main/src/firebase/config.js) (Firebase services)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application access"]
  node_routes["Routes and guards<br/>[AppRoutes.jsx]"]
  node_auth["Authentication"]
  node_authstate["User and institution state<br/>[authStore.js]"]
  node_common["Shared UI and language"]
  node_i18n["Bengali translations<br/>[bn.js]"]
end

subgraph group_authoring["Paper authoring"]
  node_builder["Paper builder<br/>[index.jsx]"]
  node_editors["Question editors"]
  node_richtext["Rich text editor<br/>[RichTextEditor.jsx]"]
  node_bank["Question bank<br/>[index.jsx]"]
  node_templates["Templates and design<br/>[templates.js]"]
  node_types["Question type registry<br/>[questionTypes.js]"]
  node_import["Import and export screen<br/>[index.jsx]"]
  node_ai["AI question generation<br/>[index.jsx]"]
end

subgraph group_rendering["Preview and export"]
  node_preview["Paged paper preview<br/>[PaperViewer.jsx]"]
  node_model["Paper document model<br/>[paperModel.js]"]
  node_document["Paper rendering<br/>[PaperDocument.jsx]"]
  node_export["Print and file export"]
end

subgraph group_data["Persistence and services"]
  node_questiondata["Question data service<br/>[questionService.js]"]
  node_paperdata["Paper data service<br/>[paperService.js]"]
  node_db["Firestore helpers<br/>[db.js]"]
  node_firebase["Firebase services<br/>[config.js]"]
end

subgraph group_operations["Institution operations"]
  node_ai_function["AI function"]
  node_ops["Institution and academic tools"]
  node_analytics["Analytics and notifications"]
  node_plans["Plans and payments<br/>[index.jsx]"]
  node_payment_function["Payment function<br/>[sslcommerz.js]"]
end

node_user(("Teacher or admin"))

node_user -->|"opens app"| node_routes
node_routes -->|"routes to"| node_auth
node_routes -->|"routes to"| node_builder
node_routes -->|"routes to"| node_bank
node_routes -->|"routes to"| node_import
node_routes -->|"routes to"| node_ai
node_authstate -->|"hydrates from"| node_auth
node_authstate -->|"observes auth"| node_firebase
node_builder -->|"loads and saves"| node_paperdata
node_builder -->|"opens editors"| node_editors
node_builder -->|"shows preview"| node_preview
node_builder -->|"picks questions"| node_bank
node_editors -->|"edits content"| node_richtext
node_bank -.->|"queries questions"| node_questiondata
node_questiondata -->|"uses helpers"| node_db
node_paperdata -->|"uses helpers"| node_db
node_db -->|"uses Firestore"| node_firebase
node_preview -->|"renders pages"| node_document
node_document -->|"builds model"| node_model
node_model -->|"uses question blocks"| node_types
node_model -->|"applies design"| node_templates
node_builder -->|"configures design"| node_templates
node_import -->|"imports questions"| node_questiondata
node_import -->|"exports papers"| node_paperdata
node_export -->|"formats paper"| node_model
node_ai -.->|"requests generation"| node_ai_function
node_plans -.->|"starts payment"| node_payment_function
node_ops -.->|"uses Firebase"| node_firebase
node_analytics -.->|"uses Firebase"| node_firebase
node_common -->|"uses translations"| node_i18n

click node_routes "https://github.com/techverse26/exam-question-generator/blob/main/src/routes/AppRoutes.jsx"
click node_auth "https://github.com/techverse26/exam-question-generator/tree/main/src/pages/Authentication"
click node_authstate "https://github.com/techverse26/exam-question-generator/blob/main/src/store/authStore.js"
click node_builder "https://github.com/techverse26/exam-question-generator/blob/main/src/pages/QuestionBuilder/index.jsx"
click node_editors "https://github.com/techverse26/exam-question-generator/tree/main/src/editors"
click node_richtext "https://github.com/techverse26/exam-question-generator/blob/main/src/components/editor/RichTextEditor.jsx"
click node_bank "https://github.com/techverse26/exam-question-generator/blob/main/src/pages/QuestionBank/index.jsx"
click node_questiondata "https://github.com/techverse26/exam-question-generator/blob/main/src/services/questionService.js"
click node_paperdata "https://github.com/techverse26/exam-question-generator/blob/main/src/services/paperService.js"
click node_db "https://github.com/techverse26/exam-question-generator/blob/main/src/services/db.js"
click node_firebase "https://github.com/techverse26/exam-question-generator/blob/main/src/firebase/config.js"
click node_templates "https://github.com/techverse26/exam-question-generator/blob/main/src/constants/templates.js"
click node_types "https://github.com/techverse26/exam-question-generator/blob/main/src/constants/questionTypes.js"
click node_preview "https://github.com/techverse26/exam-question-generator/blob/main/src/preview/PaperViewer.jsx"
click node_model "https://github.com/techverse26/exam-question-generator/blob/main/src/preview/paperModel.js"
click node_document "https://github.com/techverse26/exam-question-generator/blob/main/src/preview/PaperDocument.jsx"
click node_export "https://github.com/techverse26/exam-question-generator/tree/main/src/export"
click node_import "https://github.com/techverse26/exam-question-generator/blob/main/src/pages/ImportExport/index.jsx"
click node_ai "https://github.com/techverse26/exam-question-generator/blob/main/src/pages/AI/index.jsx"
click node_ai_function "https://github.com/techverse26/exam-question-generator/blob/main/functions/src/ai/generateQuestions.js"
click node_ops "https://github.com/techverse26/exam-question-generator/tree/main/src/pages/Institution"
click node_analytics "https://github.com/techverse26/exam-question-generator/tree/main/src/pages/Analytics"
click node_plans "https://github.com/techverse26/exam-question-generator/blob/main/src/pages/Subscription/index.jsx"
click node_payment_function "https://github.com/techverse26/exam-question-generator/blob/main/functions/src/payments/sslcommerz.js"
click node_common "https://github.com/techverse26/exam-question-generator/tree/main/src/components/common"
click node_i18n "https://github.com/techverse26/exam-question-generator/blob/main/src/i18n/bn.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_routes,node_auth,node_authstate,node_common,node_i18n toneBlue
class node_builder,node_editors,node_richtext,node_bank,node_templates,node_types,node_import,node_ai toneAmber
class node_preview,node_model,node_document,node_export toneMint
class node_questiondata,node_paperdata,node_db,node_firebase toneRose
class node_ai_function,node_ops,node_analytics,node_plans,node_payment_function,node_user toneIndigo
```

## Components

### Application access

- [Routes and guards](https://github.com/techverse26/exam-question-generator/blob/main/src/routes/AppRoutes.jsx): `src/routes/AppRoutes.jsx`
- [Authentication](https://github.com/techverse26/exam-question-generator/tree/main/src/pages/Authentication): `src/pages/Authentication`
- [User and institution state](https://github.com/techverse26/exam-question-generator/blob/main/src/store/authStore.js): `src/store/authStore.js`
- [Shared UI and language](https://github.com/techverse26/exam-question-generator/tree/main/src/components/common): `src/components/common`
- [Bengali translations](https://github.com/techverse26/exam-question-generator/blob/main/src/i18n/bn.js): `src/i18n/bn.js`

### Paper authoring

- [Paper builder](https://github.com/techverse26/exam-question-generator/blob/main/src/pages/QuestionBuilder/index.jsx): `src/pages/QuestionBuilder/index.jsx`
- [Question editors](https://github.com/techverse26/exam-question-generator/tree/main/src/editors): `src/editors`
- [Rich text editor](https://github.com/techverse26/exam-question-generator/blob/main/src/components/editor/RichTextEditor.jsx): `src/components/editor/RichTextEditor.jsx`
- [Question bank](https://github.com/techverse26/exam-question-generator/blob/main/src/pages/QuestionBank/index.jsx): `src/pages/QuestionBank/index.jsx`
- [Templates and design](https://github.com/techverse26/exam-question-generator/blob/main/src/constants/templates.js): `src/constants/templates.js`
- [Question type registry](https://github.com/techverse26/exam-question-generator/blob/main/src/constants/questionTypes.js): `src/constants/questionTypes.js`
- [Import and export screen](https://github.com/techverse26/exam-question-generator/blob/main/src/pages/ImportExport/index.jsx): `src/pages/ImportExport/index.jsx`
- [AI question generation](https://github.com/techverse26/exam-question-generator/blob/main/src/pages/AI/index.jsx): `src/pages/AI/index.jsx`

### Preview and export

- [Paged paper preview](https://github.com/techverse26/exam-question-generator/blob/main/src/preview/PaperViewer.jsx): `src/preview/PaperViewer.jsx`
- [Paper document model](https://github.com/techverse26/exam-question-generator/blob/main/src/preview/paperModel.js): `src/preview/paperModel.js`
- [Paper rendering](https://github.com/techverse26/exam-question-generator/blob/main/src/preview/PaperDocument.jsx): `src/preview/PaperDocument.jsx`
- [Print and file export](https://github.com/techverse26/exam-question-generator/tree/main/src/export): `src/export`

### Persistence and services

- [Question data service](https://github.com/techverse26/exam-question-generator/blob/main/src/services/questionService.js): `src/services/questionService.js`
- [Paper data service](https://github.com/techverse26/exam-question-generator/blob/main/src/services/paperService.js): `src/services/paperService.js`
- [Firestore helpers](https://github.com/techverse26/exam-question-generator/blob/main/src/services/db.js): `src/services/db.js`
- [Firebase services](https://github.com/techverse26/exam-question-generator/blob/main/src/firebase/config.js): `src/firebase/config.js`

### Institution operations

- [AI function](https://github.com/techverse26/exam-question-generator/blob/main/functions/src/ai/generateQuestions.js): `functions/src/ai/generateQuestions.js`
- [Institution and academic tools](https://github.com/techverse26/exam-question-generator/tree/main/src/pages/Institution): `src/pages/Institution`
- [Analytics and notifications](https://github.com/techverse26/exam-question-generator/tree/main/src/pages/Analytics): `src/pages/Analytics`
- [Plans and payments](https://github.com/techverse26/exam-question-generator/blob/main/src/pages/Subscription/index.jsx): `src/pages/Subscription/index.jsx`
- [Payment function](https://github.com/techverse26/exam-question-generator/blob/main/functions/src/payments/sslcommerz.js): `functions/src/payments/sslcommerz.js`

### Other components

- **Teacher or admin**

## Connections

- Teacher or admin → Routes and guards: opens app (evidence: `src/routes/AppRoutes.jsx`)
- Routes and guards → Authentication: routes to (evidence: `src/routes/AppRoutes.jsx`)
- Routes and guards → Paper builder: routes to (evidence: `src/routes/AppRoutes.jsx`)
- Routes and guards → Question bank: routes to (evidence: `src/routes/AppRoutes.jsx`)
- Routes and guards → Import and export screen: routes to (evidence: `src/routes/AppRoutes.jsx`)
- Routes and guards → AI question generation: routes to (evidence: `src/routes/AppRoutes.jsx`)
- User and institution state → Authentication: hydrates from (evidence: `src/store/authStore.js`)
- User and institution state → Firebase services: observes auth (evidence: `src/store/authStore.js`)
- Paper builder → Paper data service: loads and saves (evidence: `src/pages/QuestionBuilder/index.jsx`)
- Paper builder → Question editors: opens editors (evidence: `src/pages/QuestionBuilder/index.jsx`)
- Paper builder → Paged paper preview: shows preview (evidence: `src/pages/QuestionBuilder/index.jsx`)
- Paper builder → Question bank: picks questions (evidence: `src/pages/QuestionBuilder/index.jsx`)
- Question editors → Rich text editor: edits content (evidence: `src/editors/MCQEditor/index.jsx`)
- Question bank → Question data service: queries questions
- Question data service → Firestore helpers: uses helpers (evidence: `src/services/questionService.js`)
- Paper data service → Firestore helpers: uses helpers (evidence: `src/services/paperService.js`)
- Firestore helpers → Firebase services: uses Firestore (evidence: `src/services/db.js`)
- Paged paper preview → Paper rendering: renders pages (evidence: `src/preview/PaperDocument.jsx`)
- Paper rendering → Paper document model: builds model (evidence: `src/preview/PaperDocument.jsx`)
- Paper document model → Question type registry: uses question blocks (evidence: `src/preview/paperModel.js`)
- Paper document model → Templates and design: applies design (evidence: `src/preview/paperModel.js`)
- Paper builder → Templates and design: configures design (evidence: `src/pages/QuestionBuilder/index.jsx`)
- Import and export screen → Question data service: imports questions (evidence: `src/pages/ImportExport/index.jsx`)
- Import and export screen → Paper data service: exports papers (evidence: `src/pages/ImportExport/index.jsx`)
- Print and file export → Paper document model: formats paper (evidence: `src/export/docxExport.js`)
- AI question generation → AI function: requests generation (evidence: `README.md`)
- Plans and payments → Payment function: starts payment (evidence: `README.md`)
- Institution and academic tools → Firebase services: uses Firebase (evidence: `README.md`)
- Analytics and notifications → Firebase services: uses Firebase (evidence: `README.md`)
- Shared UI and language → Bengali translations: uses translations (evidence: `src/components/common/Misc.jsx`)
