feat: wire build/test infra, trips API, and enriched journey stops

- Add tsconfig.json (server) + client/tsconfig.{json,app.json,node.json}
  so typecheck and tsc -b actually work.
- Fix npm test to run Playwright (was running vitest on Playwright specs);
  typecheck now covers both server and client.
- Mount routes before app.listen, add error handler, mount optional
  @tonycodes/auth-express middleware when AUTH_SECRET is set.
- Add /api/trips (GET/POST/PATCH/DELETE) backed by an in-memory store
  that gracefully degrades when DATABASE_URL is unset.
- Add prisma/seed.ts skeleton and server/types/express.d.ts for req.auth.
- Rewrite Grok prompt for combo-aware planning: charge+eat,
  stay+destination-charging, eat+viewpoint, etc., with amenities,
  cuisine, priceLevel, duration, day titles and trip highlights.
- Extend Stop schema + normalization to preserve all enrichment fields.
- New StopCard component renders combo pill, description, meta row
  (charge / stop / battery / cuisine / £-level) and amenity icons;
  map popups show the same enriched detail; timeline gains day titles
  and a HIGHLIGHTS sidebar.
- Fix server TS errors (vehicle accepted as string | {name,rangeKm},
  JSON parse results typed).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-19 10:32:53 +01:00
parent d516e93323
commit 89b24d4c34
24 changed files with 1263 additions and 243 deletions
+28 -7
View File
@@ -1,19 +1,40 @@
# Tesla Roadtrip - Environment Configuration
# Copy this file to .env and fill in the values
# === REQUIRED: xAI API Key for real Grok responses ===
# === xAI API Key (used for production deploys and when FORCE_XAI_API=true) ===
# Get one at https://console.x.ai
# This is NOT needed for normal local development (we prefer your personal Grok CLI)
XAI_API_KEY=xai-YourKeyHere
# === Optional: App configuration ===
# === App configuration ===
APP_URL=http://localhost:5173
API_URL=http://localhost:3000
# === Optional: Auth service (from auth.tony.codes) ===
# Only needed if testing authenticated features locally
# === Auth service (from auth.tony.codes) ===
# Only needed if testing authenticated user features locally
# AUTH_SECRET=your-auth-secret-here
# AUTH_URL=https://auth.tony.codes
# === Optional: Force local grok CLI (advanced) ===
# Set to false to always use xAI API instead of local CLI
# GROK_ENABLED=true
# =====================================================================
# Grok Provider Control (NEW)
# =====================================================================
#
# By default on your machine we prefer the LOCAL PERSONAL GROK CLI
# (~/.grok/bin/grok) authenticated with YOUR account (Heavy).
# This is free, uses web_search + high effort, and gives the best
# development experience.
#
# The XAI_API_KEY above is mainly for the deployed site on Dokku.
#
# FORCE_XAI_API=true
# → Ignore the local CLI completely and use the xAI API.
# → Useful when you want to test the exact production code path locally.
# Example: FORCE_XAI_API=true ./scripts/dev.sh
#
# GROK_BIN=/custom/path/to/grok
# → Override the location of the local grok binary (rarely needed).
#
# GROK_ENABLED=false
# → Completely disable the local CLI (forces xAI API or dumb fallback).
#
# =====================================================================