Web calculator for Flywheels garage — vehicle lookup, repair lines, and a shared invoice cart.
- Single calculator session with cart and invoice workflow
- Vehicle search from
vehicles.csv— type, prix concess (HT), TTC, explosion, noyade - Repair lines — checkboxes + quantities, Ajouter au panier
- Panier — recap of all added lines, copy invoice, running Total à facturer (top right)
| File | Role |
|---|---|
src/data/vehicles.csv |
Vehicle catalogue (edit this) |
src/data/catalog.json |
Generated bundle (vehicles + repairs + repairByRange) |
| Google Sheet Data (cols G/H) | Repair base price by gamme |
| Google Sheet Calculette | Repair tariffs (via sync) |
- Update
src/data/vehicles.csv(model,priceHT,category,dealership) - Run
pnpm sync-data
pnpm sync-dataRequires network for the sheet export. Vehicles always come from CSV.
Design tokens live in src/index.css — not hardcoded in components.
| Layer | Role |
|---|---|
:root / .dark |
Semantic CSS variables (--fw-surface, --fw-brand, …) |
@theme inline |
Maps tokens → Tailwind utilities (bg-surface, text-brand, …) |
@layer components |
Reusable primitives (.fw-panel, .fw-input, .fw-btn-primary) |
src/lib/ui.ts |
Component class compositions (uses semantic utilities only) |
Modes: Clair (Flywheels poster — teal + cream + red) · Sombre (night garage) · Auto (system).
Toggle in the header; preference stored in localStorage (flywheels-calc-theme).
To adjust brand colors, edit the :root and .dark blocks in index.css once — all UI follows.
pnpm install
pnpm dev # Vite (:5173+) + API (:4783), proxy /api → API
pnpm build # dist/ + dist-server/
pnpm start # production Node server (:3000)Local SQLite: data/flywheels.db (seeded from catalog.json on first boot).
Admin: {origin}/admin — no auth; edits apply immediately to the calculator.
Agent guide: AGENTS.md · Architecture: docs/admin-plan.md
Single Node container — serves dist/ + /api/*, SQLite on volume DATA_DIR (default /app/data).
docker build -t flywheels-calc .
docker run -p 3000:3000 -v flywheels-data:/app/data flywheels-calcDokploy — project Reroll:
| Env | URL | Branch |
|---|---|---|
| Production | https://flywheels-calc.mestryx.dev | main |
| Dev | https://flywheels-calc-dev.mestryx.dev | dev |
Container port 3000, mount volume on /app/data (prod: flywheels-calc-prod-data, dev: flywheels-calc-dev-data). Image ships catalog.json + vehicles.csv for Data sync.