- dark tokens move from prefers-color-scheme to :root[data-theme="dark"];
light is the default for everyone regardless of OS preference
- choice persisted in localStorage (artiot-theme), applied to <html> at
module load so the login screen themes before first paint
- Account page gains an Appearance section with a squared slide switch;
meta theme-color follows the active theme
- Chakra Petch replaces Archivo for all UI type (Plex Mono demoted to data:
ids, timestamps, tabular numbers); brand set in 700 italic caps
- every corner squared; signature chamfer cut (echoing the typeface) on gun
bays, login plate and solid buttons; lamps stay round (physical lamps)
- phones: nav becomes a fixed bottom tab bar with safe-area padding, tables
collapse into labeled stacked rows (data-label), bigger touch targets
- desktop nav as underline tabs; inline styles in Account moved to classes
- Dockerfile: node:24-alpine builds frontend/dist, python:3.13-slim runs
backend.main as uid 1000 under tini; state on /data via env overrides
- compose.yaml: raw 9000:9000 for the charger's hardcoded ws:// dial-in,
Traefik labels for the panel, everything Komodo-tunable (ARTIOT_TAG/HOST,
TRAEFIK_NETWORK, entrypoint, certresolver), curl healthcheck
- .gitea/workflows/build.yml: build -> 65-check smoke gate in the image ->
push :main + :sha to git.infra.msai.al/art/charging_station -> HMAC-signed
Komodo stack redeploy (polymarket-bot pattern; same secret names)
- journal.py: events.jsonl path overridable via BACKEND_EVENTS (mirrors
BACKEND_DB) so containers journal onto the data volume
- routes.py: unauthenticated GET /api/health for Docker/Traefik/Komodo probes
- backend/smoke_test.py: the 65-check suite promoted from the scratchpad;
temp-dir DB + journal, runs anywhere via python -m backend.smoke_test
'app token of <name>' synthetic allowlist entries are gone: decide()
recognizes a user's personal idTag directly, enforces the user's own
charger:<cp>:<gun> scopes at the charger-side gate, and attributes the
session (who=user, method=app). charger_start no longer auto-enrolls;
PUT /api/allowlist/<user-tag> returns 400; stale entries auto-drop at
startup. Zero-user open mode still authorizes 'app-remote' for
bootstrap. Smoke: 63 checks.
- backend keeps the latest meter sample per active transaction in memory
and ships it as active_transactions[tx].telemetry on /api/status
(Transaction.Begin snapshots skipped: taken before the BMS is read)
- Battery component: fill + color sweep red (empty) -> blue (half) ->
green (full) per the owner's spec; aria meter semantics
- charging bays show the gauge, a prominent kW readout, and delivered
kWh / voltage / current rows; hint while awaiting the first sample
- smoke: 60 checks (telemetry rides /api/status)
The charger sends Voltage/Current.Import in every MeterValues frame but
we only stored energy/power/SoC. samples now also record voltage_v,
current_a and the OCPP context (Sample.Periodic vs Transaction.Begin/End
snapshots, which are legitimately all-zero). Existing dbs migrate via
ALTER TABLE on open.
uvicorn waits for connections to drain on SIGINT; the JC-6620 never
hangs up, so shutdown blocked until a second (force) Ctrl+C.
timeout_graceful_shutdown=3 closes the socket and exits; the charger
redials within seconds.
- non-admins now see ONLY their own sessions in /api/sessions (own app
starts + own linked cards); gun scopes grant control, not visibility;
admins see everything
- Account page shows the logged-in user's permissions in plain words
(Administrator badge, or the guns/relays they control), built solely
from data already visible to them
- Start button arms only when the gun reports Preparing (cable in the
car); idle unplugged gun shows an explanatory hint instead
- keep owner's app rename to 'Art IoT'
- smoke test: 59 checks (gun-scoped user sees no foreign sessions)
- Control renders every gun declared in the chargers registry, even when
the charger is offline or has not reported that connector yet (state
shows Offline / No status yet in gray)
- owner-specified state language: gray = idle, pulsing blue = cable in
the socket (Preparing), green = charging; suspended/finishing = steady
blue; fault = red
- POST /api/me/password (requires current password) + /account page,
username in the topbar links to it
- smoke test: 58 checks (password change round-trip incl. old-password
invalidation)
Frontend rewrite (frontend/, replacing backend/static/):
- Vite + TypeScript + React 19, React Router 7, zustand, TanStack Query 5
- dev: vite proxy /api -> :9000; prod: npm run build -> dist/, served by
the backend with SPA fallback
- pages: Control (gun bays w/ scope+readiness-gated start/stop, relays),
History (who/via/gun/when/duration/kWh audit), Cards (pending review,
enrolled, rejected), Users (permission checkbox matrix)
- self-contained: fonts bundled, no CDN; light/dark; reduced-motion safe
Backend:
- learn mode removed: unknown cards are always refused and queued in
pending_cards; admin approves (name + owner + gun restrictions in one
step) or rejects (denied_cards, silent, un-rejectable); pending count
rides /api/status as the notification signal
- sessions record the auth method (card tap vs in-app button) for audit
- GET /api/permissions: grantable-permission catalog driving the UI matrix
- SPA static serving with path-traversal guard; 503 hint when not built
Smoke test: 54 checks incl. approve/reject round-trips over a fake charge
point and method audit assertions.
backend.db (renamed from sessions.db) now holds everything: the sessions
and samples tables plus a settings table with the app-state sections
(users, allowlist, relays, chargers, learn_mode, session_secret) as JSON
blobs. All mutations go through the API/panel and take effect immediately;
there is no config file and no hand-edit-then-restart ambiguity.
- legacy config.json auto-imports into the db on first start (renamed to
config.json.migrated as a backup)
- new admin endpoints: PUT/DELETE /api/relays/{name} (how tinytuya wizard
results are registered now) and PUT /api/chargers/{cp_id} (panel labels)
- BACKEND_DB env override so tests run on an isolated temp database
- smoke test: 45 checks, real db verified untouched
- Allowlist entries take "user": <username> — sessions started with that
card attribute to the person, and the owner sees their card's history
even without gun-wide permissions (ownership looked up live)
- "guns": ["eu092025:2"] (fnmatch) replaces the charger-blind
"connectors": [2] restriction — safe with multiple chargers
- New "chargers" config section provides per-charger/per-gun display
names; the panel no longer hardcodes the Anfu gun labels
- Panel admin tab: owner dropdown + guns field on card entries
- Smoke test: 42 checks, incl. retroactive history visibility after
linking a card and rejection of links to unknown users
One FastAPI process on port 9000 (the charger's hardcoded URL), replacing
discovering/station.py for production:
- csms.py: OCPP 1.6J handlers ported from the proven discovery code; the
decide() gate now supports per-gun RFID restriction ("connectors": [2])
enforced at StartTransaction
- users.py: username/password auth (PBKDF2), stateless HMAC sessions
(cookie + bearer, 30 days), fnmatch permission scopes
(charger:<cp>:<gun>, relay:<name>, admin) and a user CLI
- relays.py: local tinytuya control of the SmartLife/Tuya WiFi relays
(no cloud; needs one-time id/local-key extraction via tinytuya wizard)
- store.py: SQLite consumption tracking — who charged, when, how many kWh,
per-minute energy/power/SoC samples; tx ids survive restarts
- routes.py: /api/* with per-scope checks, allowlist/user CRUD, runtime
learn-mode flip, session history with visibility rules
- static/: self-contained vanilla-JS PWA — login, per-gun start/stop gated
by scope + gun readiness, relay toggles, history, admin tab
config.json (password hashes, session secret, Tuya keys) and sessions.db
are gitignored; config.example.json documents the shape. Covered by a
37-check smoke test incl. a fake charge point over the real WS route.
station.py is now one FastAPI/uvicorn process owning port 9000: the OCPP 1.6J
WebSocket (catch-all path) plus an HTTP control API (status, events, tags,
probe, remote start/stop, trigger, unlock, setconfig). Adds the events.jsonl
journal and auto-interrogation on connect.
Includes the captures from the 2026-07-09 live test session: full
GetConfiguration dump of eu092025, real charging transactions on both guns
(RFID + remote start/stop), and the negative Autocharge/MacEnabled results.
Cards A/B + app-remote enrolled in station_config.json.
- Created initial wiki structure with CLAUDE.md schema, index.md, and log.md.
- Ingested findings and requirements document into the wiki.
- Added concepts for authorization methods, network topology, OCPP protocol, and troubleshooting.
- Documented entities including the Anfu charger, JC-6620 controller, and CSMS toolkit.
- Established configuration files for Obsidian app settings and workspace layout.
- Implemented core plugins and appearance settings for the wiki.