No description
  • Python 60.9%
  • TypeScript 29.9%
  • JavaScript 3.7%
  • CSS 2.7%
  • HTML 2.3%
  • Other 0.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jason Artemis Winstanley df82cb6b11
Some checks failed
CI / backend (push) Has been cancelled
CI / frontend (push) Has been cancelled
fix(mcp): address PAT review minors
- verifier round-trip test for a PAT before/after revocation; real bearer
  path test for token management
- user row locked (FOR UPDATE) before the live-token cap check
- OAuth connections report expires_at null (1 h access expiry isn't the
  connection's end); reserved client id raises RegistrationError
- Settings: token rows show created date; reveal panel repeats the server
  URL + Bearer hint, clears when that token is revoked, and reports a
  failed clipboard write; field styles reuse ui/Pill fieldClasses

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-14 19:11:37 +00:00
.github/workflows Add CI workflow, request metrics, live-batch polling, and archived departure time 2026-09-03 06:04:37 +00:00
.impeccable Initial commit of Skyewatch 2026-07-28 19:58:59 +00:00
backend fix(mcp): address PAT review minors 2026-11-14 19:11:37 +00:00
docs/superpowers docs: MCP personal access tokens design + plan 2026-11-14 17:37:13 +00:00
frontend fix(mcp): address PAT review minors 2026-11-14 19:11:37 +00:00
raildata-sftp Initial commit of Skyewatch 2026-07-28 19:58:59 +00:00
.gitignore chore: ignore agent worktrees and plan workspaces 2026-10-26 12:17:13 +00:00
CLAUDE.md fix(mcp): serve /mcp directly instead of redirecting to /mcp/ 2026-11-14 17:37:13 +00:00
compose.yml feat: Android app — Capacitor project, Docker build, signed-in APK download 2026-10-29 17:23:39 +00:00
DESIGN.md Initial commit of Skyewatch 2026-07-28 19:58:59 +00:00
HANDOFF.md Baseline: pre-existing uncommitted work (telegram contacts, auth/share/admin changes, nginx fix) 2026-10-22 03:03:29 +00:00
PRODUCT.md Initial commit of Skyewatch 2026-07-28 19:58:59 +00:00
README.md fix: 1 MB request-body limit at Caddy; NUL-byte paths 404 2026-10-26 17:49:10 +00:00

Train Tracker

Train Tracker is a full-stack web app for monitoring UK railway services in real time. Add a train by headcode and see its live status, delays, current location, and per-stop calling points — glanceable enough to answer "is my train OK?" at a glance, with richer detail (timelines, delay history, disruption context) available for anyone who wants to dig in.

Features

  • Add trains by headcode, Service UID, or station departure board search — with live status, delay, current location, and platform.
  • Per-stop timelines showing booked vs. actual times all the way along a service's route.
  • Recurring trains for a regular commute, with bank-holiday-aware exceptions.
  • Journey planning — direct and interchange routes from the local timetable, with live delay data factored into whether a connection is actually catchable.
  • Notifications via Discord DM, Telegram, and Web Push — delays, cancellations, boarding/arrival, off-route alerts.
  • Punctuality stats and an archive of past journeys.
  • Household view — see other household members' trains for today.
  • Public share links for a single tracked train, no login required.
  • Disruption dashboard (TfL + National Rail), when configured.
  • Discord bot integration — slash commands, DM notifications, OAuth login.

Architecture

Caddy (TLS)
    ↓
FastAPI (Python 3.12, also serves the built React 18 + Vite SPA)
    + SQLAlchemy
    ↕ psycopg2
PostgreSQL 16

Live data comes primarily from a locally-ingested CIF full timetable feed (Rail Data Marketplace), overlaid with Darwin Push Port real-time movement events consumed continuously via Kafka — not the Realtime Trains (RTT) API, which is used only as a fallback when the local data has no match. See CLAUDE.md for the full data-pipeline design.

An MCP (Model Context Protocol) server is also exposed, so an AI assistant can look up live train status, search departures, plan journeys, and manage tracked trains on the user's behalf.

Running it

Requires Docker Compose. Copy .env.example (if present) or otherwise populate a .env file with the required credentials — see CLAUDE.md's Environment Variables section for the full list (database password, JWT secret, RTT/Darwin/NROD/Discord/Telegram/Web Push credentials, etc.).

docker compose up           # start the full stack (db, backend, frontend, raildata-sftp)
docker compose build        # rebuild images after a code change

The raildata-sftp service receives the daily CIF timetable push from Rail Data Marketplace; the backend watches for new files and ingests them automatically.

Frontend only

cd frontend
npm install
npm run dev      # Vite dev server, proxies /api → localhost:8000
npm run build    # TypeScript check + production build

Backend only

cd backend
alembic upgrade head
uvicorn app.main:app --host 0.0.0.0 --port 8000

Contributing / development notes

See CLAUDE.md for the full architecture write-up, data pipeline design, backend/frontend file structure, and the conventions this codebase follows (timezone handling, sync-vs-async DB access, JSON column mutation, etc.) — required reading before making non-trivial changes.