# harshbhagat1803/competitive_exam_preparation_website architecture

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

- Interactive diagram: https://gitdiagram.com/harshbhagat1803/competitive_exam_preparation_website
- Repository: https://github.com/harshbhagat1803/competitive_exam_preparation_website

## Overview

This is a Flask competitive-exam portal with separate student, examiner, and administrator workflows. Students register or sign in, browse learning resources, take randomized subject exams, and view saved results; examiners manage question-bank PDFs and lectures, review feedback, and send recommendations; administrators manage student and examiner accounts. The route modules directly query MySQL, while question-bank PDFs are stored in the static directory. The graph follows the sampled Flask wiring and route code; unsampled template behavior and model usage are not inferred.

Main entry points: [`app.py`](https://github.com/harshbhagat1803/competitive_exam_preparation_website/blob/main/app.py) (Flask application), [`routes/student_routes.py`](https://github.com/harshbhagat1803/competitive_exam_preparation_website/blob/main/routes/student_routes.py) (Student routes), [`routes/examiner_routes.py`](https://github.com/harshbhagat1803/competitive_exam_preparation_website/blob/main/routes/examiner_routes.py) (Examiner routes), [`routes/admin_routes.py`](https://github.com/harshbhagat1803/competitive_exam_preparation_website/blob/main/routes/admin_routes.py) (Administrator routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Web entry"]
  node_flask["Flask application<br/>[app.py]"]
  node_mysql_extension["MySQL connection<br/>[db.py]"]
  node_public_pages["Public pages"]
end

subgraph group_identity["Accounts"]
  node_auth["Login and registration<br/>[auth_routes.py]"]
end

subgraph group_student["Student learning"]
  node_student_routes["Student routes<br/>[student_routes.py]"]
  node_exam_flow["Exam workflow<br/>[student_routes.py]"]
  node_learning_resources["Learning resources<br/>[student_routes.py]"]
  node_results["Exam results<br/>[student_routes.py]"]
  node_student_pages["Student pages"]
end

subgraph group_examiner["Examiner tools"]
  node_examiner_routes["Examiner routes<br/>[examiner_routes.py]"]
  node_question_banks["Question-bank management<br/>[examiner_routes.py]"]
  node_lectures["Lecture management<br/>[examiner_routes.py]"]
  node_feedback_recommendations["Feedback and recommendations<br/>[examiner_routes.py]"]
  node_examiner_pages["Examiner pages"]
end

subgraph group_admin["Administration"]
  node_admin_routes["Administrator routes<br/>[admin_routes.py]"]
  node_account_admin["Account management<br/>[admin_routes.py]"]
  node_admin_pages["Administrator pages"]
end

node_visitor(("Portal user"))
node_mysql_store[("Portal database")]
node_pdf_storage[("Question-bank PDFs")]

node_visitor -->|"requests pages"| node_flask
node_flask -->|"dispatches auth"| node_auth
node_flask -->|"dispatches student"| node_student_routes
node_flask -->|"dispatches examiner"| node_examiner_routes
node_flask -->|"dispatches admin"| node_admin_routes
node_flask -->|"renders pages"| node_public_pages
node_auth -->|"reads and writes"| node_mysql_store
node_student_routes -->|"handles exams"| node_exam_flow
node_student_routes -->|"serves resources"| node_learning_resources
node_student_routes -->|"reads and saves"| node_results
node_exam_flow -->|"reads questions; saves scores"| node_mysql_store
node_learning_resources -->|"reads resources"| node_mysql_store
node_learning_resources -->|"serves PDFs"| node_pdf_storage
node_results -->|"reads results"| node_mysql_store
node_student_routes -->|"renders pages"| node_student_pages
node_examiner_routes -->|"handles uploads"| node_question_banks
node_examiner_routes -->|"handles lectures"| node_lectures
node_examiner_routes -->|"handles feedback"| node_feedback_recommendations
node_question_banks -->|"reads and writes"| node_mysql_store
node_question_banks -->|"stores and deletes"| node_pdf_storage
node_lectures -->|"reads and writes"| node_mysql_store
node_feedback_recommendations -->|"reads and writes"| node_mysql_store
node_examiner_routes -->|"renders pages"| node_examiner_pages
node_admin_routes -->|"handles accounts"| node_account_admin
node_account_admin -->|"reads and writes"| node_mysql_store
node_admin_routes -->|"renders pages"| node_admin_pages
node_flask -->|"initializes connection"| node_mysql_extension
node_mysql_extension -->|"connects"| node_mysql_store

click node_flask "https://github.com/harshbhagat1803/competitive_exam_preparation_website/blob/main/app.py"
click node_auth "https://github.com/harshbhagat1803/competitive_exam_preparation_website/blob/main/routes/auth_routes.py"
click node_student_routes "https://github.com/harshbhagat1803/competitive_exam_preparation_website/blob/main/routes/student_routes.py"
click node_exam_flow "https://github.com/harshbhagat1803/competitive_exam_preparation_website/blob/main/routes/student_routes.py"
click node_learning_resources "https://github.com/harshbhagat1803/competitive_exam_preparation_website/blob/main/routes/student_routes.py"
click node_results "https://github.com/harshbhagat1803/competitive_exam_preparation_website/blob/main/routes/student_routes.py"
click node_student_pages "https://github.com/harshbhagat1803/competitive_exam_preparation_website/tree/main/templates/student"
click node_examiner_routes "https://github.com/harshbhagat1803/competitive_exam_preparation_website/blob/main/routes/examiner_routes.py"
click node_question_banks "https://github.com/harshbhagat1803/competitive_exam_preparation_website/blob/main/routes/examiner_routes.py"
click node_lectures "https://github.com/harshbhagat1803/competitive_exam_preparation_website/blob/main/routes/examiner_routes.py"
click node_feedback_recommendations "https://github.com/harshbhagat1803/competitive_exam_preparation_website/blob/main/routes/examiner_routes.py"
click node_examiner_pages "https://github.com/harshbhagat1803/competitive_exam_preparation_website/tree/main/templates/examiner"
click node_admin_routes "https://github.com/harshbhagat1803/competitive_exam_preparation_website/blob/main/routes/admin_routes.py"
click node_account_admin "https://github.com/harshbhagat1803/competitive_exam_preparation_website/blob/main/routes/admin_routes.py"
click node_admin_pages "https://github.com/harshbhagat1803/competitive_exam_preparation_website/tree/main/templates/admin"
click node_mysql_extension "https://github.com/harshbhagat1803/competitive_exam_preparation_website/blob/main/db.py"
click node_pdf_storage "https://github.com/harshbhagat1803/competitive_exam_preparation_website/tree/main/static/question_pdfs"
click node_public_pages "https://github.com/harshbhagat1803/competitive_exam_preparation_website/tree/main/templates"

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_flask,node_mysql_extension,node_public_pages,node_visitor toneBlue
class node_auth,node_mysql_store,node_pdf_storage toneAmber
class node_student_routes,node_exam_flow,node_learning_resources,node_results,node_student_pages toneMint
class node_examiner_routes,node_question_banks,node_lectures,node_feedback_recommendations,node_examiner_pages toneRose
class node_admin_routes,node_account_admin,node_admin_pages toneIndigo
```

## Components

### Web entry

- [Flask application](https://github.com/harshbhagat1803/competitive_exam_preparation_website/blob/main/app.py): `app.py`
- [MySQL connection](https://github.com/harshbhagat1803/competitive_exam_preparation_website/blob/main/db.py): `db.py`
- [Public pages](https://github.com/harshbhagat1803/competitive_exam_preparation_website/tree/main/templates): `templates`

### Accounts

- [Login and registration](https://github.com/harshbhagat1803/competitive_exam_preparation_website/blob/main/routes/auth_routes.py): `routes/auth_routes.py`

### Student learning

- [Student routes](https://github.com/harshbhagat1803/competitive_exam_preparation_website/blob/main/routes/student_routes.py): `routes/student_routes.py`
- [Exam workflow](https://github.com/harshbhagat1803/competitive_exam_preparation_website/blob/main/routes/student_routes.py): `routes/student_routes.py`
- [Learning resources](https://github.com/harshbhagat1803/competitive_exam_preparation_website/blob/main/routes/student_routes.py): `routes/student_routes.py`
- [Exam results](https://github.com/harshbhagat1803/competitive_exam_preparation_website/blob/main/routes/student_routes.py): `routes/student_routes.py`
- [Student pages](https://github.com/harshbhagat1803/competitive_exam_preparation_website/tree/main/templates/student): `templates/student`

### Examiner tools

- [Examiner routes](https://github.com/harshbhagat1803/competitive_exam_preparation_website/blob/main/routes/examiner_routes.py): `routes/examiner_routes.py`
- [Question-bank management](https://github.com/harshbhagat1803/competitive_exam_preparation_website/blob/main/routes/examiner_routes.py): `routes/examiner_routes.py`
- [Lecture management](https://github.com/harshbhagat1803/competitive_exam_preparation_website/blob/main/routes/examiner_routes.py): `routes/examiner_routes.py`
- [Feedback and recommendations](https://github.com/harshbhagat1803/competitive_exam_preparation_website/blob/main/routes/examiner_routes.py): `routes/examiner_routes.py`
- [Examiner pages](https://github.com/harshbhagat1803/competitive_exam_preparation_website/tree/main/templates/examiner): `templates/examiner`

### Administration

- [Administrator routes](https://github.com/harshbhagat1803/competitive_exam_preparation_website/blob/main/routes/admin_routes.py): `routes/admin_routes.py`
- [Account management](https://github.com/harshbhagat1803/competitive_exam_preparation_website/blob/main/routes/admin_routes.py): `routes/admin_routes.py`
- [Administrator pages](https://github.com/harshbhagat1803/competitive_exam_preparation_website/tree/main/templates/admin): `templates/admin`

### Other components

- **Portal user**
- **Portal database**
- [Question-bank PDFs](https://github.com/harshbhagat1803/competitive_exam_preparation_website/tree/main/static/question_pdfs): `static/question_pdfs`

## Connections

- Portal user → Flask application: requests pages
- Flask application → Login and registration: dispatches auth
- Flask application → Student routes: dispatches student
- Flask application → Examiner routes: dispatches examiner
- Flask application → Administrator routes: dispatches admin
- Flask application → Public pages: renders pages
- Login and registration → Portal database: reads and writes
- Student routes → Exam workflow: handles exams
- Student routes → Learning resources: serves resources
- Student routes → Exam results: reads and saves
- Exam workflow → Portal database: reads questions; saves scores
- Learning resources → Portal database: reads resources
- Learning resources → Question-bank PDFs: serves PDFs
- Exam results → Portal database: reads results
- Student routes → Student pages: renders pages
- Examiner routes → Question-bank management: handles uploads
- Examiner routes → Lecture management: handles lectures
- Examiner routes → Feedback and recommendations: handles feedback
- Question-bank management → Portal database: reads and writes
- Question-bank management → Question-bank PDFs: stores and deletes
- Lecture management → Portal database: reads and writes
- Feedback and recommendations → Portal database: reads and writes
- Examiner routes → Examiner pages: renders pages
- Administrator routes → Account management: handles accounts
- Account management → Portal database: reads and writes
- Administrator routes → Administrator pages: renders pages
- Flask application → MySQL connection: initializes connection
- MySQL connection → Portal database: connects
