# palasuhas/eib-quiz architecture

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

- Interactive diagram: https://gitdiagram.com/palasuhas/eib-quiz
- Repository: https://github.com/palasuhas/eib-quiz

## Overview

EIB Quiz is a browser-based German/English citizenship-test practice app covering questions from Germany’s states, with illustrated questions and offline support. The principal workflow is a learner using the app to practice questions and receive answer feedback; the service worker supports loading those resources online or from cache. The sampled files show the worker’s caching behavior and the question/i18n data formats, but not the app’s runtime code or its request wiring, so those links are marked unverified. The repository also contains data-curation tools, which are not part of the runtime map.

Main entry points: [`sw.js`](https://github.com/palasuhas/eib-quiz/blob/main/sw.js) (Service worker), [`index.html`](https://github.com/palasuhas/eib-quiz/blob/main/index.html) (Question practice), [`questions.json`](https://github.com/palasuhas/eib-quiz/blob/main/questions.json) (Question bank), [`tools/i18n-source.mjs`](https://github.com/palasuhas/eib-quiz/blob/main/tools/i18n-source.mjs) (i18n data reader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_practice["Quiz experience"]
  node_webapp["Quiz app<br/>[index.html]"]
  node_question_flow["Question practice<br/>[index.html]"]
  node_answer_feedback["Answer feedback<br/>[index.html]"]
end

subgraph group_content["Quiz content"]
  node_question_data["Question bank<br/>[questions.json]"]
  node_illustrations["Question images"]
  node_translations["Translations"]
end

subgraph group_offline["Offline delivery"]
  node_service_worker["Service worker<br/>[sw.js]"]
  node_cache[("Browser cache")]
end

subgraph group_i18n_tools["Language data access"]
  node_i18n_source["i18n data reader<br/>[i18n-source.mjs]"]
end

node_learner(("Learner"))
node_network(("Web network"))

node_learner -.->|"uses"| node_webapp
node_webapp -.->|"hosts"| node_question_flow
node_question_flow -.->|"loads questions"| node_question_data
node_question_flow -.->|"shows images"| node_illustrations
node_question_flow -.->|"checks answers"| node_answer_feedback
node_webapp -.->|"loads language data"| node_translations
node_service_worker -->|"reads and writes"| node_cache
node_service_worker -->|"fetches requests"| node_network
node_service_worker -->|"caches responses"| node_question_data
node_service_worker -->|"caches responses"| node_translations
node_i18n_source -->|"reads literals"| node_webapp
node_i18n_source -->|"reads questions"| node_question_data

click node_webapp "https://github.com/palasuhas/eib-quiz/blob/main/index.html"
click node_question_flow "https://github.com/palasuhas/eib-quiz/blob/main/index.html"
click node_answer_feedback "https://github.com/palasuhas/eib-quiz/blob/main/index.html"
click node_question_data "https://github.com/palasuhas/eib-quiz/blob/main/questions.json"
click node_illustrations "https://github.com/palasuhas/eib-quiz/tree/main/img"
click node_translations "https://github.com/palasuhas/eib-quiz/tree/main/i18n"
click node_service_worker "https://github.com/palasuhas/eib-quiz/blob/main/sw.js"
click node_i18n_source "https://github.com/palasuhas/eib-quiz/blob/main/tools/i18n-source.mjs"

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_webapp,node_question_flow,node_answer_feedback toneBlue
class node_question_data,node_illustrations,node_translations toneAmber
class node_service_worker,node_cache toneMint
class node_i18n_source toneRose
class node_learner,node_network toneIndigo
```

## Components

### Quiz experience

- [Quiz app](https://github.com/palasuhas/eib-quiz/blob/main/index.html): `index.html`
- [Question practice](https://github.com/palasuhas/eib-quiz/blob/main/index.html): `index.html`
- [Answer feedback](https://github.com/palasuhas/eib-quiz/blob/main/index.html): `index.html`

### Quiz content

- [Question bank](https://github.com/palasuhas/eib-quiz/blob/main/questions.json): `questions.json`
- [Question images](https://github.com/palasuhas/eib-quiz/tree/main/img): `img`
- [Translations](https://github.com/palasuhas/eib-quiz/tree/main/i18n): `i18n`

### Offline delivery

- [Service worker](https://github.com/palasuhas/eib-quiz/blob/main/sw.js): `sw.js`
- **Browser cache**

### Language data access

- [i18n data reader](https://github.com/palasuhas/eib-quiz/blob/main/tools/i18n-source.mjs): `tools/i18n-source.mjs`

### Other components

- **Learner**
- **Web network**

## Connections

- Learner → Quiz app: uses
- Quiz app → Question practice: hosts
- Question practice → Question bank: loads questions
- Question practice → Question images: shows images
- Question practice → Answer feedback: checks answers
- Quiz app → Translations: loads language data
- Service worker → Browser cache: reads and writes (evidence: `sw.js`)
- Service worker → Web network: fetches requests (evidence: `sw.js`)
- Service worker → Question bank: caches responses (evidence: `sw.js`)
- Service worker → Translations: caches responses (evidence: `sw.js`)
- i18n data reader → Quiz app: reads literals (evidence: `tools/i18n-source.mjs`)
- i18n data reader → Question bank: reads questions (evidence: `tools/i18n-source.mjs`)
