Technologies
stationdoku is a project made in my spare time. Here are the building blocks that run it, from the server to your browser.
The server
-
Python
The language of the whole server: grid generation, answer checking, score calculation.
-
FastAPI
Serves the pages and the API that your browser queries during the game, fully asynchronously.
-
Django
Describes the database and its migrations, and provides the admin interface.
-
Pydantic
Validates and describes the data exchanged with your browser.
-
Jinja
The templates of the HTML pages, like this one.
-
PostgreSQL
The database: stations, the daily grid and their answers, games, friends and, if you add them, your passkeys (their public part only) and the hash of your password, never the password itself.
Live friends
When friends play the daily grid at the same time as you, a small separate server tells you live, over a WebSocket connection that stays open as long as the page is visible. It reads no database and doesn't know your ID: only a ticket signed by the main server.
-
Rust
The language of this server: fast and lean, it keeps many connections open with very little memory.
-
Tokio
Rust's asynchronous engine, with Axum on top for WebSockets.
-
Redis
Remembers who is playing which grid right now and notifies the server of arrivals and departures. Nothing is written to disk: after a restart, browsers announce themselves again.
-
Lua
The small scripts run inside Redis, so that an arrival or a departure is recorded in one go.
In your browser
-
TypeScript
The code for the grid, the leaderboard and friends, with no framework: one small script per page.
-
esbuild
Bundles and minifies the scripts and stylesheets on each release.
-
Node.js
Only used to build the scripts: it doesn't run on the server.
-
PWA
stationdoku installs like an app, tells you when you're offline and can remind you to play with a notification.
The Archivo, Inter and Space Grotesk fonts are hosted on the site, under a free license (OFL): your browser contacts no font service.
Hosting and deployment
-
OVHcloud
The site runs on an OVHcloud machine, in Paris.
-
Debian
The operating system of the machine and of the containers.
-
Docker
Each building block runs in its own container. A new version starts next to the old one, which only stops once its replacement is ready: no downtime.
-
Caddy
Receives all requests, handles HTTPS and HTTP/3, compresses responses and doesn't write IP addresses in its logs.
-
GitHub Actions
On each change, the checks and tests, then automatic deployment if they pass.
-
Sentry
Reports server and browser errors, without personal data.
-
Umami
The audience measurement, cookie-free, which never receives your ID.
The database is backed up every hour.
Development tools
-
uv
Installs Python and the dependencies in a few seconds.
-
Ruff
Checks and formats the Python code.
-
pytest
The server's tests, rerun on each change against a real PostgreSQL database.
Typing is checked everywhere: mypy in strict mode for Python, tsc for TypeScript, Clippy for Rust.
The data
Stations, lines and their ridership come from the open data of Île-de-France Mobilités (ODbL license), and the outlines of the arrondissements from Paris Data.
-
Wikidata
The coordinates of parks and places of power, for the distance criteria.
Approximate location of devices, on the account page: database IP Geolocation by DB-IP (DB-IP Lite, CC BY 4.0), read on our own server.
Logos: Simple Icons (CC0). Trademarks belong to their respective owners.