deckgl_tracksolid/compose/.env.example
David Kiania 47c86c9d7a Add deckgl trips visualization stack
Initial implementation of the public trips dashboard:

- db/migrations/001..005: read-only viz_anon role + thin trips_viz_v1
  view + three SECURITY DEFINER RPCs (trips_for_day, trips_for_range,
  list_cost_centres). Builds path on demand from position_history;
  coalesces missing cost_centre to 'Unassigned'. Smoke-tested against
  staging: 982 trips / 13 cost centres for 2026-04-29.

- compose/: PostgREST v12 service + trips_web Caddy service. CORS
  allow-listed to the web FQDN; viz_anon role is the only authorization.

- web/: Vite + React + TS SPA. deck.gl TripsLayer animated over
  PathLayer (whole route in low opacity), Mapbox GL dark base map,
  Zustand store, TanStack Query for fetching. Sidebar = date controls
  + cost-centre multi-select + vehicle drilldown. Timebar = scrubber
  with 1x/10x/60x/600x speeds. tsc + vite build clean.

- README + design doc updated to match the verified schema (path lives
  in tracksolid.position_history, vehicle key is imei, no down-sampling
  needed at observed volume).
2026-05-01 01:13:57 +03:00

22 lines
926 B
Text

# Trips visualization stack — copy to compose/.env (gitignored) for local dev,
# or set these in the Coolify resource's Environment Variables tab for prod.
# --- Database (read-only role created by db/migrations/001_viz_anon_role.sql) ---
VIZ_DATA_USER=viz_anon
VIZ_DATA_PASSWORD=replace-me-with-the-password-from-ALTER-ROLE
# Host where tracksolid_db is reachable.
# Local Mac dev: stage.rahamafresh.com
# Coolify prod : host.docker.internal (the Coolify host's gateway)
VIZ_DB_HOST=host.docker.internal
VIZ_DB_PORT=5433
VIZ_DB_NAME=tracksolid_db
# --- PostgREST public URL (for OpenAPI links + CORS preflight reflection) ---
PGRST_PUBLIC_URL=https://api.trips.rahamafresh.com
# --- Web app ---
TRIPS_WEB_URL=https://trips.rahamafresh.com
VITE_API_URL=https://api.trips.rahamafresh.com
# Reuse DEKART_MAPBOX_TOKEN from the existing Dekart stack — same token is fine.
VITE_MAPBOX_TOKEN=pk.xxxxxxxxxxxxxxxxxxxxxxx