How lsf-wesel-rheinhausen/lsf-fliegerlager-webapp works
Purpose and runtime
Fliegerlager-Abrechnung is a Docker-oriented Django 5.2 / Python 3.13 application for managing club flying camps: participants, pricing, bookings, expenses, payments, shifts, meal orders, and auditable settlements. It serves both staff administration and participant kiosk/PWA interfaces. Primary Django entry points are src/manage.py, src/config/wsgi.py, and src/config/asgi.py; production uses Gunicorn configuration in src/config/gunicorn_config.py.
Application composition and routing
The domain is concentrated in one Django app, billing. Project settings, middleware, global routes, SSO, persistence migration, and web-push key handling are the framework boundary in:
• src/config/settings.py
• src/config/urls.py
• src/config/middleware.py
Feature routes and request handlers are primarily:
• src/billing/urls.py
• src/billing/views.py
• src/billing/admin.py
Server-rendered Django templates and small static JavaScript/CSS assets implement the UI rather than a separate frontend application.
Core domain and settlement pipeline
The relational domain models camps, participants/families, price rules, charges, payments, expenses, meal signups/orders, shifts, and versioned settlement runs. Its central persistence contract is:
• src/billing/models.py
• src/billing/migrations/0021_settlementrun_versioned_snapshots.py
• src/billing/migrations/0065_payment_soft_delete_audit.py
Staff create/import operational records; pricing and settlement services calculate participant and camp-level results; settlement runs retain immutable snapshots and feed CSV, Excel, and PDF exports. Business orchestration and file interchange are centered in:
• src/billing/services.py
• src/billing/importers.py
• src/billing/exporters.py
Participant kiosk, meals, and shift workflows
A separate participant-facing kiosk operates under kiosk-specific access and security rules: common camp PIN, personal PIN/session access, active-camp isolation, and action auditing. Relevant boundaries are:
• src/billing/kiosk_access.py
• src/billing/kiosk_security.py
• src/billing/kiosk_access_views.py
Kiosk flows expose meal bookings, attendance/profile activity, family/partner permissions, and self-service shift selection/exchange. Their presentation layer begins at:
• src/templates/billing/kiosk_base.html
• src/templates/billing/kiosk_home.html
• src/templates/billing/kiosk_shifts.html
Identity, authorization, and communications
Django groups implement Admin and Bearbeiter authorization, supplemented by superuser access. Authentication supports password login, optional passkeys, trusted-header Authelia SSO, and controlled account recovery:
• src/billing/auth.py
• src/billing/permissions.py
• src/config/sso.py
Notification delivery crosses external boundaries: encrypted/configured SMTP email and web-push subscriptions. Worker commands process queued delivery/recovery work:
• src/billing/email_delivery.py
• src/billing/notifications.py
• src/billing/management/commands/run_push_worker.py
Infrastructure, persistence, and deployment updates
Development may use SQLite, while Docker deployments and concurrent kiosk use require PostgreSQL. Compose runs the application plus an isolated updater; production images are published to GHCR. Deployment artifacts are:
• docker-compose.yml
• Dockerfile
• Dockerfile.updater
The app requests updates through an internal agent. That agent uses Portainer’s API—not a Docker socket—to redeploy, backs up PostgreSQL, records image digests for rollback, and health-checks the resulting service:
• deployment_agent.py
• src/billing/deployment_updates.py
• scripts/postgres-backup.sh
PWA and operational boundaries
The PWA supplies install/offline UX and push integration but explicitly avoids caching sensitive application data. Its server/static boundary is:
• src/billing/pwa_views.py
• src/templates/billing/service_worker.js
• src/static/billing/pwa.js
Security-sensitive deployment behavior includes HTTPS cookies/redirects, host/CSRF controls, guarded Gunicorn request parsing, trusted-proxy SSO, kiosk throttling, and environment-provided secrets.
Components 21
Django application
- Django entry points · HTTP and ASGI/WSGI application entry points.
src/manage.py - Project boundary · Settings, middleware, global routes, SSO, and persistence setup.
src/config/settings.py - Staff routes & views
src/billing/views.py - Django admin
src/billing/admin.py - Billing domain · Camps, people, pricing, charges, payments, meals, shifts, and settlements.
src/billing/models.py - Settlement snapshots · Versioned immutable settlement records.
src/billing/migrations/0021_settlementrun_versioned_snapshots.py - Pricing & settlement
src/billing/services.py - Import & exports · Operational imports plus CSV, Excel, and PDF settlement output.
src/billing/exporters.py - Identity & authorization · Password, passkeys, trusted-header SSO, recovery, and group permissions.
src/billing/auth.py
Participant kiosk
- Kiosk access control · PIN/session access, active-camp isolation, throttling, and audit rules.
src/billing/kiosk_access.py - Kiosk workflows · Meals, attendance, profiles, family permissions, and shifts.
src/billing/kiosk_access_views.py - Kiosk templates
src/templates/billing/kiosk_home.html
Notifications & PWA
- Email & push delivery · SMTP delivery and web-push subscriptions.
src/billing/notifications.py - Push worker · Processes queued push delivery and recovery work.
src/billing/management/commands/run_push_worker.py - PWA boundary · Offline/install UX without caching sensitive application data.
src/billing/pwa_views.py
Deployment updates
- Docker Compose · Runs the application and isolated updater.
docker-compose.yml - Update requests · App-side requests to the internal deployment agent.
src/billing/deployment_updates.py - Deployment agent · Uses Portainer API for redeploy, backup, rollback digest, and health checks.
deployment_agent.py
Other components
- SQLite / PostgreSQL · PostgreSQL is required for concurrent Docker kiosk deployments.
- Staff browser UI
- Portainer API · Redeploys without Docker socket access.
Connections 21
- Django entry points → Project boundary: loads
- Project boundary → Staff routes & views: routes
- Project boundary → Identity & authorization: configures
- Staff browser UI → Staff routes & views: requests
- Staff routes & views → Identity & authorization: authorizes
- Staff routes & views → Pricing & settlement: orchestrates
- Django admin → Billing domain: manages
- Pricing & settlement → Billing domain: calculates from
- Pricing & settlement → Import & exports: produces results for
- Billing domain → Settlement snapshots: versioned by
- Billing domain → SQLite / PostgreSQL: persists
- Kiosk templates → Kiosk workflows: uses
- Kiosk workflows → Kiosk access control: enforces access
- Kiosk workflows → Pricing & settlement: books and selects
- Kiosk workflows → Billing domain: reads and writes
- Email & push delivery → Push worker: queued delivery
- PWA boundary → Email & push delivery: push integration
- Update requests → Deployment agent: requests update
- Docker Compose → Deployment agent: isolates
- Deployment agent → Portainer API: redeploys via
- Deployment agent → SQLite / PostgreSQL: backs up PostgreSQL