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).
16 lines
393 B
Docker
16 lines
393 B
Docker
FROM node:20-alpine AS build
|
|
WORKDIR /app
|
|
RUN corepack enable
|
|
COPY package.json pnpm-lock.yaml* ./
|
|
RUN pnpm install --frozen-lockfile || pnpm install
|
|
COPY . .
|
|
ARG VITE_API_URL
|
|
ARG VITE_MAPBOX_TOKEN
|
|
ENV VITE_API_URL=${VITE_API_URL}
|
|
ENV VITE_MAPBOX_TOKEN=${VITE_MAPBOX_TOKEN}
|
|
RUN pnpm build
|
|
|
|
FROM caddy:2.8-alpine
|
|
COPY Caddyfile /etc/caddy/Caddyfile
|
|
COPY --from=build /app/dist /srv
|
|
EXPOSE 8080
|