Files
tavolo/server/packages/tavolo-app
woggioni 517ac6fb46
CI / Build and push docker image (push) Successful in 1m54s
Make the frontend an installable PWA
Add a web app manifest and an install-only service worker (no offline
caching: live state always comes from the server and hashed asset names
change every build), registered from the WASM bundle. The worker must
live at the site root for its scope to cover the app, and Granian only
serves /static and /assets, so tavolo/static.py answers
/manifest.webmanifest and /sw.js from STATIC_DIR with the content types
browsers require; index.html gains the manifest link, icons, theme-color
and Apple standalone meta tags.

Icons are committed under web/assets/icons/ with vector sources and a
make-icons.sh regeneration script, mirroring the card art workflow.
2026-10-15 06:16:11 +08:00
..

tavolo-app

The deployable tavolo application: the composition root wiring tavolo-platform to the tavolo-scopone, tavolo-scopa and tavolo-briscola games.

Contents

  • app.py — assembles the KayaApp (session/OIDC/Tortoise/OpenAPI mixins plus PlatformMixin and the deadline scheduler), registers the ScoponeEngine, ScopaEngine, ScopaQuattroEngine, BriscolaEngine, BriscolaQuattroEngine and BriscolaChiamataEngine with their configured timeouts, and exposes tavolo.app:app for granian.
  • config.py — environment-driven frozen Settings.
  • telemetry.py — the optional OpenTelemetry wiring beyond kaya-otel: meter/tracer/logger providers, the tavolo.active_users/tavolo.ongoing_games gauges (polled from the stores), process/CPython metrics via opentelemetry-instrumentation-system-metrics, Postgres/Redis query spans via the asyncpg/redis instrumentations, and OTLP log export.
  • aerich_config.py — Tortoise ORM configuration consumed by the aerich CLI (migrations live in server/migrations/; aerich itself is configured via the [tool.aerich] section of server/pyproject.toml).
  • logging_config.py — logging setup.
  • static.py — SPA shell hosting for the compiled frontend.

Development (from packages/tavolo-app/)

.venv/bin/python -m mypy --namespace-packages --explicit-package-bases \
  src/tavolo/app.py \
  src/tavolo/config.py \
  src/tavolo/telemetry.py \
  src/tavolo/static.py \
  src/tavolo/aerich_config.py \
  src/tavolo/logging_config.py

End-to-end coverage of the wired stack lives in server/tests/.