75869364b0
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.
1.1 KiB
1.1 KiB
Charging Station Project
Four parts:
backend/— the production FastAPI backend: private OCPP 1.6J CSMS + REST API + Tuya relay control on port 9000. All state inbackend/backend.db(SQLite, gitignored). Run from the repo root:venv\Scripts\python -m backend.main. Documented atwiki/entities/backend.md.frontend/— the React control panel (Vite + TypeScript + React Router + zustand + TanStack Query). Dev:npm run dev(proxies/apito :9000). Prod:npm run build→frontend/dist/, served statically by the backend. Documented atwiki/entities/frontend.md.wiki/— an LLM-maintained knowledge base about the Anfu home charger OCPP integration. Readwiki/CLAUDE.mdbefore touching anything in it — it defines the schema, conventions, and ingest/query/lint workflows.wiki/raw/is immutable source material; never edit it.discovering/— throwaway-ish Python scripts used during discovery (csms.py,rawlisten.py,station.py). Superseded bybackend/for production; kept as diagnostics. Documented atwiki/entities/csms-toolkit.md.