# prudhviyarraguntla2007-sys/online_exam architecture

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

- Interactive diagram: https://gitdiagram.com/prudhviyarraguntla2007-sys/online_exam
- Repository: https://github.com/prudhviyarraguntla2007-sys/online_exam

## Overview

This is a console-based exam platform, with two overlapping implementations: the SQLite-backed `main.cpp` version and the in-memory version in `new_main.cpp`/`new_main.cpp.cpp`. The principal workflow is role-based entry, exam authoring and publication, student attempts, saved results, and analytics. The excerpts establish the controller entry point, exam/result concepts, analytics, and SQLite use, but omit much of the wiring; unverified subsystem links are dashed. The database files are present, but the excerpts do not establish which file the program opens.

Main entry points: [`main.cpp`](https://github.com/prudhviyarraguntla2007-sys/online_exam/blob/main/main.cpp) (System controller), [`sqlite3.h`](https://github.com/prudhviyarraguntla2007-sys/online_exam/blob/main/sqlite3.h) (SQLite API), [`database.db`](https://github.com/prudhviyarraguntla2007-sys/online_exam/blob/main/database.db) (Database files)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_runtime["System controller<br/>[main.cpp]"]
end

subgraph group_identity["Users and roles"]
  node_auth["Authentication<br/>[main.cpp]"]
  node_student["Student workflows<br/>[main.cpp]"]
  node_admin["Admin workflows<br/>[main.cpp]"]
  node_teacher["Teacher workflows<br/>[main.cpp]"]
end

subgraph group_exams["Exam lifecycle"]
  node_examservice["Exam service<br/>[main.cpp]"]
  node_exam["Exam and timing<br/>[main.cpp]"]
  node_question["Question content<br/>[main.cpp]"]
end

subgraph group_results["Results and persistence"]
  node_result["Exam results<br/>[main.cpp]"]
  node_analytics["Class analytics<br/>[main.cpp]"]
  node_database["SQLite database access<br/>[main.cpp]"]
  node_sqliteapi["SQLite API<br/>[sqlite3.h]"]
  node_dbfile[("Database files<br/>[database.db]")]
end

node_operator(("Console user"))

node_operator -->|"starts"| node_runtime
node_runtime -.->|"routes roles"| node_auth
node_runtime -.->|"routes roles"| node_admin
node_runtime -.->|"routes roles"| node_student
node_runtime -.->|"routes roles"| node_teacher
node_admin -.->|"manages exams"| node_examservice
node_teacher -.->|"manages exams"| node_examservice
node_student -.->|"uses exams"| node_examservice
node_examservice -.->|"manages"| node_exam
node_exam -.->|"contains"| node_question
node_examservice -.->|"saves results"| node_result
node_admin -.->|"views analytics"| node_analytics
node_database -->|"calls API"| node_sqliteapi
node_database -.->|"reads or writes"| node_dbfile

click node_runtime "https://github.com/prudhviyarraguntla2007-sys/online_exam/blob/main/main.cpp"
click node_auth "https://github.com/prudhviyarraguntla2007-sys/online_exam/blob/main/main.cpp"
click node_student "https://github.com/prudhviyarraguntla2007-sys/online_exam/blob/main/main.cpp"
click node_admin "https://github.com/prudhviyarraguntla2007-sys/online_exam/blob/main/main.cpp"
click node_teacher "https://github.com/prudhviyarraguntla2007-sys/online_exam/blob/main/main.cpp"
click node_examservice "https://github.com/prudhviyarraguntla2007-sys/online_exam/blob/main/main.cpp"
click node_exam "https://github.com/prudhviyarraguntla2007-sys/online_exam/blob/main/main.cpp"
click node_question "https://github.com/prudhviyarraguntla2007-sys/online_exam/blob/main/main.cpp"
click node_result "https://github.com/prudhviyarraguntla2007-sys/online_exam/blob/main/main.cpp"
click node_analytics "https://github.com/prudhviyarraguntla2007-sys/online_exam/blob/main/main.cpp"
click node_database "https://github.com/prudhviyarraguntla2007-sys/online_exam/blob/main/main.cpp"
click node_sqliteapi "https://github.com/prudhviyarraguntla2007-sys/online_exam/blob/main/sqlite3.h"
click node_dbfile "https://github.com/prudhviyarraguntla2007-sys/online_exam/blob/main/database.db"

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_runtime,node_operator toneBlue
class node_auth,node_student,node_admin,node_teacher toneAmber
class node_examservice,node_exam,node_question toneMint
class node_result,node_analytics,node_database,node_sqliteapi,node_dbfile toneRose
```

## Components

### Application entry

- [System controller](https://github.com/prudhviyarraguntla2007-sys/online_exam/blob/main/main.cpp): `main.cpp`

### Users and roles

- [Authentication](https://github.com/prudhviyarraguntla2007-sys/online_exam/blob/main/main.cpp): `main.cpp`
- [Student workflows](https://github.com/prudhviyarraguntla2007-sys/online_exam/blob/main/main.cpp): `main.cpp`
- [Admin workflows](https://github.com/prudhviyarraguntla2007-sys/online_exam/blob/main/main.cpp): `main.cpp`
- [Teacher workflows](https://github.com/prudhviyarraguntla2007-sys/online_exam/blob/main/main.cpp): `main.cpp`

### Exam lifecycle

- [Exam service](https://github.com/prudhviyarraguntla2007-sys/online_exam/blob/main/main.cpp): `main.cpp`
- [Exam and timing](https://github.com/prudhviyarraguntla2007-sys/online_exam/blob/main/main.cpp): `main.cpp`
- [Question content](https://github.com/prudhviyarraguntla2007-sys/online_exam/blob/main/main.cpp): `main.cpp`

### Results and persistence

- [Exam results](https://github.com/prudhviyarraguntla2007-sys/online_exam/blob/main/main.cpp): `main.cpp`
- [Class analytics](https://github.com/prudhviyarraguntla2007-sys/online_exam/blob/main/main.cpp): `main.cpp`
- [SQLite database access](https://github.com/prudhviyarraguntla2007-sys/online_exam/blob/main/main.cpp): `main.cpp`
- [SQLite API](https://github.com/prudhviyarraguntla2007-sys/online_exam/blob/main/sqlite3.h): `sqlite3.h`
- [Database files](https://github.com/prudhviyarraguntla2007-sys/online_exam/blob/main/database.db): `database.db`

### Other components

- **Console user**

## Connections

- Console user → System controller: starts (evidence: `main.cpp`)
- System controller → Authentication: routes roles (evidence: `main.cpp`)
- System controller → Admin workflows: routes roles (evidence: `main.cpp`)
- System controller → Student workflows: routes roles (evidence: `main.cpp`)
- System controller → Teacher workflows: routes roles (evidence: `main.cpp`)
- Admin workflows → Exam service: manages exams (evidence: `main.cpp`)
- Teacher workflows → Exam service: manages exams (evidence: `main.cpp`)
- Student workflows → Exam service: uses exams (evidence: `main.cpp`)
- Exam service → Exam and timing: manages (evidence: `main.cpp`)
- Exam and timing → Question content: contains (evidence: `main.cpp`)
- Exam service → Exam results: saves results (evidence: `main.cpp`)
- Admin workflows → Class analytics: views analytics (evidence: `main.cpp`)
- SQLite database access → SQLite API: calls API (evidence: `main.cpp`)
- SQLite database access → Database files: reads or writes
