# sullaspqr/osztv-dual architecture

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

- Interactive diagram: https://gitdiagram.com/sullaspqr/osztv-dual
- Repository: https://github.com/sullaspqr/osztv-dual

## Overview

OSZTV is a topic-based practice quiz for software-development and testing students. The workflow is topic selection and quiz setup, randomized question delivery, answer submission and backend scoring, then answer explanations and a shareable QR result; the public result omits email. The backend also exposes health and topic-list endpoints. The sampled source shows the main API and React flows; README statements support documented capabilities, while finer UI and unsampled implementation details are not inferred.

Main entry points: [`frontend/src/main.jsx`](https://github.com/sullaspqr/osztv-dual/blob/main/frontend/src/main.jsx) (Quiz interface), [`backend/server.js`](https://github.com/sullaspqr/osztv-dual/blob/main/backend/server.js) (Answer scoring), [`backend/data/questions.json`](https://github.com/sullaspqr/osztv-dual/blob/main/backend/data/questions.json) (Question bank), [`backend/data/attempts.json`](https://github.com/sullaspqr/osztv-dual/blob/main/backend/data/attempts.json) (Attempt records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Quiz experience"]
  node_quiz_ui["Quiz interface<br/>[main.jsx]"]
  node_qr_encoder["QR encoding<br/>[main.jsx]"]
  node_review["Answer review<br/>[main.jsx]"]
  node_qr_result_page["QR result page<br/>[main.jsx]"]
end

subgraph group_quiz_api["Quiz API"]
  node_api["Express API<br/>[server.js]"]
  node_topic_catalog["Topic catalog<br/>[server.js]"]
  node_quiz_builder["Quiz selection<br/>[server.js]"]
  node_answer_scoring["Answer scoring<br/>[server.js]"]
  node_frontend_hosting["Frontend hosting<br/>[server.js]"]
end

subgraph group_persistence["Quiz data"]
  node_question_bank[("Question bank<br/>[questions.json]")]
  node_attempt_store[("Attempt records<br/>[attempts.json]")]
  node_result_store[("Result records<br/>[results.json]")]
end

subgraph group_results["Results and sharing"]
  node_public_result["Public result endpoint<br/>[server.js]"]
end

node_student(("Student"))

node_student -->|"uses"| node_quiz_ui
node_quiz_ui -->|"loads topics"| node_topic_catalog
node_quiz_ui -->|"starts quiz"| node_quiz_builder
node_api -->|"routes requests"| node_topic_catalog
node_topic_catalog -->|"counts topics"| node_question_bank
node_quiz_builder -->|"selects questions"| node_question_bank
node_quiz_builder -->|"saves attempt"| node_attempt_store
node_quiz_ui -->|"submits answers"| node_answer_scoring
node_answer_scoring -->|"reads answer key"| node_attempt_store
node_answer_scoring -->|"saves result"| node_result_store
node_answer_scoring -->|"returns explanations"| node_review
node_quiz_ui -->|"encodes result link"| node_qr_encoder
node_quiz_ui -->|"loads shared result"| node_public_result
node_public_result -->|"reads result"| node_result_store
node_api -->|"serves frontend"| node_frontend_hosting
node_student -->|"opens QR link"| node_qr_result_page

click node_quiz_ui "https://github.com/sullaspqr/osztv-dual/blob/main/frontend/src/main.jsx"
click node_qr_encoder "https://github.com/sullaspqr/osztv-dual/blob/main/frontend/src/main.jsx"
click node_api "https://github.com/sullaspqr/osztv-dual/blob/main/backend/server.js"
click node_topic_catalog "https://github.com/sullaspqr/osztv-dual/blob/main/backend/server.js"
click node_quiz_builder "https://github.com/sullaspqr/osztv-dual/blob/main/backend/server.js"
click node_answer_scoring "https://github.com/sullaspqr/osztv-dual/blob/main/backend/server.js"
click node_public_result "https://github.com/sullaspqr/osztv-dual/blob/main/backend/server.js"
click node_question_bank "https://github.com/sullaspqr/osztv-dual/blob/main/backend/data/questions.json"
click node_attempt_store "https://github.com/sullaspqr/osztv-dual/blob/main/backend/data/attempts.json"
click node_result_store "https://github.com/sullaspqr/osztv-dual/blob/main/backend/data/results.json"
click node_review "https://github.com/sullaspqr/osztv-dual/blob/main/frontend/src/main.jsx"
click node_qr_result_page "https://github.com/sullaspqr/osztv-dual/blob/main/frontend/src/main.jsx"
click node_frontend_hosting "https://github.com/sullaspqr/osztv-dual/blob/main/backend/server.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_quiz_ui,node_qr_encoder,node_review,node_qr_result_page toneBlue
class node_api,node_topic_catalog,node_quiz_builder,node_answer_scoring,node_frontend_hosting toneAmber
class node_question_bank,node_attempt_store,node_result_store toneMint
class node_public_result toneRose
class node_student toneIndigo
```

## Components

### Quiz experience

- [Quiz interface](https://github.com/sullaspqr/osztv-dual/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`
- [QR encoding](https://github.com/sullaspqr/osztv-dual/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`
- [Answer review](https://github.com/sullaspqr/osztv-dual/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`
- [QR result page](https://github.com/sullaspqr/osztv-dual/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`

### Quiz API

- [Express API](https://github.com/sullaspqr/osztv-dual/blob/main/backend/server.js): `backend/server.js`
- [Topic catalog](https://github.com/sullaspqr/osztv-dual/blob/main/backend/server.js): `backend/server.js`
- [Quiz selection](https://github.com/sullaspqr/osztv-dual/blob/main/backend/server.js): `backend/server.js`
- [Answer scoring](https://github.com/sullaspqr/osztv-dual/blob/main/backend/server.js): `backend/server.js`
- [Frontend hosting](https://github.com/sullaspqr/osztv-dual/blob/main/backend/server.js): `backend/server.js`

### Quiz data

- [Question bank](https://github.com/sullaspqr/osztv-dual/blob/main/backend/data/questions.json): `backend/data/questions.json`
- [Attempt records](https://github.com/sullaspqr/osztv-dual/blob/main/backend/data/attempts.json): `backend/data/attempts.json`
- [Result records](https://github.com/sullaspqr/osztv-dual/blob/main/backend/data/results.json): `backend/data/results.json`

### Results and sharing

- [Public result endpoint](https://github.com/sullaspqr/osztv-dual/blob/main/backend/server.js): `backend/server.js`

### Other components

- **Student**

## Connections

- Student → Quiz interface: uses (evidence: `README.md`)
- Quiz interface → Topic catalog: loads topics (evidence: `frontend/src/main.jsx`)
- Quiz interface → Quiz selection: starts quiz (evidence: `frontend/src/main.jsx`)
- Express API → Topic catalog: routes requests (evidence: `backend/server.js`)
- Topic catalog → Question bank: counts topics (evidence: `backend/server.js`)
- Quiz selection → Question bank: selects questions (evidence: `backend/server.js`)
- Quiz selection → Attempt records: saves attempt (evidence: `backend/server.js`)
- Quiz interface → Answer scoring: submits answers (evidence: `frontend/src/main.jsx`)
- Answer scoring → Attempt records: reads answer key (evidence: `backend/server.js`)
- Answer scoring → Result records: saves result (evidence: `backend/server.js`)
- Answer scoring → Answer review: returns explanations (evidence: `backend/server.js`)
- Quiz interface → QR encoding: encodes result link (evidence: `frontend/src/main.jsx`)
- Quiz interface → Public result endpoint: loads shared result (evidence: `frontend/src/main.jsx`)
- Public result endpoint → Result records: reads result (evidence: `backend/server.js`)
- Express API → Frontend hosting: serves frontend (evidence: `README.md`)
- Student → QR result page: opens QR link (evidence: `README.md`)
