Document codebase: comments, per-area READMEs, deployment guide

Readability pass across all four areas of the stack. Comments explain why
rather than what, concentrated at the points where behaviour is non-obvious:
concurrency, caching, auth, scraping and nginx templating.

Backend: doc comments on every exported declaration across handlers,
services, models and resolvers. Resolver commentary lives inside function
bodies so gqlgen does not strip it on regeneration; schema files use #
comments rather than description blocks so introspection output is
unchanged. Extracted the duplicated auth-cookie blocks into helpers.

Frontend: header comments on every component, store and view, including
STATUS: notes marking which of the parallel/legacy views are still live.
Documented the non-reactive animation-state pattern, the homeData hub and
the WebSocket stale-socket guard. Removed a few dead imports and named the
reconnect-backoff and poll-interval constants.

Python: module and function docstrings covering the Travelodge scraping
contract, the deadline threading, the two-executor concurrency and the
NDJSON streaming protocol.

Infra: header blocks on every compose file, nginx template, Dockerfile and
entrypoint, covering the config selection, envsubst allow-lists, rate-limit
semantics and volume persistence. Hoisted the duplicated envsubst variable
list in nginx/entrypoint.sh.

New: backend/README.md, python/README.md, DEPLOYMENT.md, .env.example,
backend/graph/doc.go. Refreshed vue/README.md. Corrected CLAUDE.md, which
stated a 24h access token where main.go sets 7 days.

No behaviour change. go build/vet, vite build, py_compile and docker
compose config all pass.

Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
2026-09-16 15:57:48 +01:00
co-authored by Claude Opus 5
parent a1102b4aa1
commit 64df70e5d2
183 changed files with 4691 additions and 204 deletions
+38
View File
@@ -1,3 +1,41 @@
# =============================================================================
# stream.liq.template — liquidsoap source script for the internet radio.
#
# RENDERED BY icecast2/entrypoint.sh with bare envsubst into
# /etc/liquidsoap/stream.liq at container start. Every VAR placeholder below comes from
# ./.env; an unset one silently becomes an empty string.
#
# WHAT IT BUILDS, bottom of the fallback chain upward:
# blank() - digital silence; the last resort so the mount is never dropped.
# music - the fallback playlist read from the /music bind mount
# (./icecast2/fallback_music on the host). reload_mode="watch"
# means adding or removing an MP3 on the host is picked up live,
# with no container restart.
# live - a *harbor* input: liquidsoap itself listens on
# LIQUIDSOAP_HARBOR_PORT and accepts an incoming source
# connection. This is the "go live" path — a broadcasting client
# on the LAN/internet connects with ICECAST_SOURCE_PASSWORD and
# starts talking. It is the one reason icecast2 publishes a host
# port in docker-compose.yml.
#
# fallback(track_sensitive=false, [live, music, blank()])
# Picks the first available source in list order, so a live DJ pre-empts
# the playlist automatically. track_sensitive=false is the important flag:
# it makes the switch happen IMMEDIATELY rather than politely waiting for
# the current track to finish — otherwise going live could take minutes.
#
# amplify(0.7, ...) - a fixed -3dB or so trim, because the fallback MP3s are
# mastered loud and were clipping against the live input.
#
# OUTPUT
# Pushes to icecast on localhost (same container) at ICECAST_MOUNT, which is
# what nginx exposes at /radio/. fallible=true tells liquidsoap this output
# is allowed to fail and be retried, instead of aborting the script — that is
# what makes the `sleep 2` startup race in the entrypoint survivable.
#
# settings.server.telnet := false — the liquidsoap control socket is off; there
# is no interactive way to poke the running stream.
# =============================================================================
settings.server.telnet := false
music = playlist("/music", mode="randomize", reload_mode="watch")