# ultimatevirus/skydive-theorie architecture

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

- Interactive diagram: https://gitdiagram.com/ultimatevirus/skydive-theorie
- Repository: https://github.com/ultimatevirus/skydive-theorie

## Overview

Skydive-theorie is a Flask e-learning site for Dutch KNVvL A/B skydiving theory. Learners choose an exam or focused practice, answer stored or dynamically generated weather questions, and receive immediate scoring and topic feedback. The app also serves learning resources and contact/status pages, with optional access gating. The sampled app excerpt confirms routing and service imports but omits most handlers, so workflow edges beyond those explicitly documented are limited; METAR/TAF background refresh and persistence are represented where excerpts support them.

Main entry points: [`app.py`](https://github.com/ultimatevirus/skydive-theorie/blob/main/app.py) (Flask routes and sessions), [`db.py`](https://github.com/ultimatevirus/skydive-theorie/blob/main/db.py) (Database connections and sync), [`metar.py`](https://github.com/ultimatevirus/skydive-theorie/blob/main/metar.py) (METAR retrieval and grading), [`taf.py`](https://github.com/ultimatevirus/skydive-theorie/blob/main/taf.py) (TAF retrieval and grading)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Flask routes and sessions<br/>[app.py]"]
  node_translations["UI translations<br/>[translations.py]"]
end

subgraph group_learning["Study and assessment"]
  node_exam["Exam and practice flow<br/>[app.py]"]
  node_questions["Question selection"]
  node_quiz["Scoring and grouping<br/>[quiz.py]"]
  node_learning_pages["Learning resources<br/>[learn.html]"]
end

subgraph group_weather["Weather exercises"]
  node_metar_exercise["METAR exercise<br/>[app.py]"]
  node_metar_engine["METAR retrieval and grading<br/>[metar.py]"]
  node_taf_exercise["TAF exercise<br/>[app.py]"]
  node_taf_engine["TAF retrieval and grading<br/>[taf.py]"]
end

subgraph group_services["Support services"]
  node_access["Access gate"]
  node_contact["Contact delivery and limits<br/>[contact_service.py]"]
  node_background["Background service runner"]
  node_status["Service health monitor<br/>[system_status.py]"]
end

subgraph group_storage["Persistence"]
  node_database[("SQLite database<br/>[data.db]")]
  node_db_helpers["Database connections and sync<br/>[db.py]"]
end

node_learner(("Learner"))
node_knmi{{"KNMI services"}}
node_smtp{{"SMTP server"}}

node_learner -->|"requests pages"| node_app
node_app -->|"checks access"| node_access
node_app -->|"uses contact service"| node_contact
node_app -->|"routes practice"| node_exam
node_exam -->|"selects questions"| node_questions
node_questions -->|"uses quiz helpers"| node_quiz
node_app -->|"scores attempts"| node_quiz
node_learner -->|"reads resources"| node_learning_pages
node_app -->|"routes METAR practice"| node_metar_exercise
node_metar_exercise -->|"gets and grades METAR"| node_metar_engine
node_app -.->|"routes TAF practice"| node_taf_exercise
node_taf_exercise -->|"gets and grades TAF"| node_taf_engine
node_background -->|"starts refresh loop"| node_metar_engine
node_background -->|"starts refresh loop"| node_taf_engine
node_background -->|"starts monitoring"| node_status
node_metar_engine -->|"fetches weather data"| node_knmi
node_taf_engine -->|"fetches forecast data"| node_knmi
node_status -->|"checks availability"| node_knmi
node_contact -->|"sends messages"| node_smtp
node_app -->|"translates interface"| node_translations
node_app -->|"shows service status"| node_status
node_questions -.->|"opens database connections"| node_db_helpers
node_metar_engine -->|"uses shared SQLite"| node_db_helpers
node_taf_engine -.->|"uses shared SQLite"| node_db_helpers
node_status -->|"uses shared SQLite"| node_db_helpers
node_db_helpers -->|"reads and writes"| node_database
node_access -.->|"stores throttling"| node_database
node_contact -.->|"stores usage limits"| node_database

click node_app "https://github.com/ultimatevirus/skydive-theorie/blob/main/app.py"
click node_access "https://github.com/ultimatevirus/skydive-theorie/blob/main/access_gate_service.py"
click node_contact "https://github.com/ultimatevirus/skydive-theorie/blob/main/contact_service.py"
click node_exam "https://github.com/ultimatevirus/skydive-theorie/blob/main/app.py"
click node_questions "https://github.com/ultimatevirus/skydive-theorie/blob/main/question_repository.py"
click node_quiz "https://github.com/ultimatevirus/skydive-theorie/blob/main/quiz.py"
click node_learning_pages "https://github.com/ultimatevirus/skydive-theorie/blob/main/templates/learn.html"
click node_metar_exercise "https://github.com/ultimatevirus/skydive-theorie/blob/main/app.py"
click node_metar_engine "https://github.com/ultimatevirus/skydive-theorie/blob/main/metar.py"
click node_taf_exercise "https://github.com/ultimatevirus/skydive-theorie/blob/main/app.py"
click node_taf_engine "https://github.com/ultimatevirus/skydive-theorie/blob/main/taf.py"
click node_background "https://github.com/ultimatevirus/skydive-theorie/blob/main/background_services.py"
click node_status "https://github.com/ultimatevirus/skydive-theorie/blob/main/system_status.py"
click node_translations "https://github.com/ultimatevirus/skydive-theorie/blob/main/translations.py"
click node_database "https://github.com/ultimatevirus/skydive-theorie/blob/main/data.db"
click node_db_helpers "https://github.com/ultimatevirus/skydive-theorie/blob/main/db.py"

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_app,node_translations toneBlue
class node_exam,node_questions,node_quiz,node_learning_pages toneAmber
class node_metar_exercise,node_metar_engine,node_taf_exercise,node_taf_engine,node_smtp toneMint
class node_access,node_contact,node_background,node_status toneRose
class node_database,node_db_helpers,node_learner,node_knmi toneIndigo
```

## Components

### Web application

- [Flask routes and sessions](https://github.com/ultimatevirus/skydive-theorie/blob/main/app.py): `app.py`
- [UI translations](https://github.com/ultimatevirus/skydive-theorie/blob/main/translations.py): `translations.py`

### Study and assessment

- [Exam and practice flow](https://github.com/ultimatevirus/skydive-theorie/blob/main/app.py): `app.py`
- [Question selection](https://github.com/ultimatevirus/skydive-theorie/blob/main/question_repository.py): `question_repository.py`
- [Scoring and grouping](https://github.com/ultimatevirus/skydive-theorie/blob/main/quiz.py): `quiz.py`
- [Learning resources](https://github.com/ultimatevirus/skydive-theorie/blob/main/templates/learn.html): `templates/learn.html`

### Weather exercises

- [METAR exercise](https://github.com/ultimatevirus/skydive-theorie/blob/main/app.py): `app.py`
- [METAR retrieval and grading](https://github.com/ultimatevirus/skydive-theorie/blob/main/metar.py): `metar.py`
- [TAF exercise](https://github.com/ultimatevirus/skydive-theorie/blob/main/app.py): `app.py`
- [TAF retrieval and grading](https://github.com/ultimatevirus/skydive-theorie/blob/main/taf.py): `taf.py`

### Support services

- [Access gate](https://github.com/ultimatevirus/skydive-theorie/blob/main/access_gate_service.py): `access_gate_service.py`
- [Contact delivery and limits](https://github.com/ultimatevirus/skydive-theorie/blob/main/contact_service.py): `contact_service.py`
- [Background service runner](https://github.com/ultimatevirus/skydive-theorie/blob/main/background_services.py): `background_services.py`
- [Service health monitor](https://github.com/ultimatevirus/skydive-theorie/blob/main/system_status.py): `system_status.py`

### Persistence

- [SQLite database](https://github.com/ultimatevirus/skydive-theorie/blob/main/data.db): `data.db`
- [Database connections and sync](https://github.com/ultimatevirus/skydive-theorie/blob/main/db.py): `db.py`

### Other components

- **Learner**
- **KNMI services**
- **SMTP server**

## Connections

- Learner → Flask routes and sessions: requests pages (evidence: `README.md`)
- Flask routes and sessions → Access gate: checks access (evidence: `app.py`)
- Flask routes and sessions → Contact delivery and limits: uses contact service (evidence: `app.py`)
- Flask routes and sessions → Exam and practice flow: routes practice (evidence: `README.md`)
- Exam and practice flow → Question selection: selects questions (evidence: `app.py`)
- Question selection → Scoring and grouping: uses quiz helpers (evidence: `question_repository.py`)
- Flask routes and sessions → Scoring and grouping: scores attempts (evidence: `app.py`)
- Learner → Learning resources: reads resources (evidence: `README.md`)
- Flask routes and sessions → METAR exercise: routes METAR practice (evidence: `README.md`)
- METAR exercise → METAR retrieval and grading: gets and grades METAR (evidence: `app.py`)
- Flask routes and sessions → TAF exercise: routes TAF practice (evidence: `app.py`)
- TAF exercise → TAF retrieval and grading: gets and grades TAF (evidence: `app.py`)
- Background service runner → METAR retrieval and grading: starts refresh loop (evidence: `background_services.py`)
- Background service runner → TAF retrieval and grading: starts refresh loop (evidence: `background_services.py`)
- Background service runner → Service health monitor: starts monitoring (evidence: `background_services.py`)
- METAR retrieval and grading → KNMI services: fetches weather data (evidence: `metar.py`)
- TAF retrieval and grading → KNMI services: fetches forecast data (evidence: `taf.py`)
- Service health monitor → KNMI services: checks availability (evidence: `system_status.py`)
- Contact delivery and limits → SMTP server: sends messages (evidence: `contact_service.py`)
- Flask routes and sessions → UI translations: translates interface (evidence: `app.py`)
- Flask routes and sessions → Service health monitor: shows service status (evidence: `app.py`)
- Question selection → Database connections and sync: opens database connections
- METAR retrieval and grading → Database connections and sync: uses shared SQLite (evidence: `metar.py`)
- TAF retrieval and grading → Database connections and sync: uses shared SQLite
- Service health monitor → Database connections and sync: uses shared SQLite (evidence: `system_status.py`)
- Database connections and sync → SQLite database: reads and writes (evidence: `db.py`)
- Access gate → SQLite database: stores throttling
- Contact delivery and limits → SQLite database: stores usage limits
