# alithw/trr2_tn architecture

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

- Interactive diagram: https://gitdiagram.com/alithw/trr2_tn
- Repository: https://github.com/alithw/trr2_tn

## Overview

TRR2_TN is a browser-based multiple-choice revision app for Discrete Mathematics II. A learner opens the locally served app, which loads practice and exam question data; the app supports question browsing, search, practice/exam modes, answer feedback and detailed explanations. It also remembers quiz state and offers shuffling and keyboard navigation. The sampled source shows data loading and quiz behavior in app.js, and static-file serving in server.js. Other README-listed capabilities are represented within the app node; unsampled HTML and styling are not expanded into separate runtime components.

Main entry points: [`app.js`](https://github.com/alithw/trr2_tn/blob/master/app.js) (Quiz engine), [`server.js`](https://github.com/alithw/trr2_tn/blob/master/server.js) (Static HTTP server), [`index.html`](https://github.com/alithw/trr2_tn/blob/master/index.html) (Web app shell), [`questions.json`](https://github.com/alithw/trr2_tn/blob/master/questions.json) (Practice questions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_serving["Local serving"]
  node_server["Static HTTP server<br/>[server.js]"]
end

subgraph group_quiz["Quiz experience"]
  node_shell["Web app shell<br/>[index.html]"]
  node_engine["Quiz engine<br/>[app.js]"]
end

subgraph group_content["Question data"]
  node_practice["Practice questions<br/>[questions.json]"]
  node_exam["Exam questions"]
end

node_learner(("Learner"))

node_learner -->|"opens app"| node_server
node_server -->|"serves files"| node_shell
node_learner -->|"answers and navigates"| node_engine
node_engine -->|"loads practice data"| node_practice
node_engine -->|"loads exam data"| node_exam

click node_server "https://github.com/alithw/trr2_tn/blob/master/server.js"
click node_shell "https://github.com/alithw/trr2_tn/blob/master/index.html"
click node_engine "https://github.com/alithw/trr2_tn/blob/master/app.js"
click node_practice "https://github.com/alithw/trr2_tn/blob/master/questions.json"
click node_exam "https://github.com/alithw/trr2_tn/blob/master/exam_questions.json"

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_server toneBlue
class node_shell,node_engine toneAmber
class node_practice,node_exam toneMint
class node_learner toneIndigo
```

## Components

### Local serving

- [Static HTTP server](https://github.com/alithw/trr2_tn/blob/master/server.js): `server.js`

### Quiz experience

- [Web app shell](https://github.com/alithw/trr2_tn/blob/master/index.html): `index.html`
- [Quiz engine](https://github.com/alithw/trr2_tn/blob/master/app.js): `app.js`

### Question data

- [Practice questions](https://github.com/alithw/trr2_tn/blob/master/questions.json): `questions.json`
- [Exam questions](https://github.com/alithw/trr2_tn/blob/master/exam_questions.json): `exam_questions.json`

### Other components

- **Learner**

## Connections

- Learner → Static HTTP server: opens app (evidence: `README.md`)
- Static HTTP server → Web app shell: serves files (evidence: `server.js`)
- Learner → Quiz engine: answers and navigates (evidence: `app.js`)
- Quiz engine → Practice questions: loads practice data (evidence: `app.js`)
- Quiz engine → Exam questions: loads exam data (evidence: `app.js`)
