Transit Planner is an AI-powered urban transit design tool for city planners. Draw proposed subway, LRT, or bus routes on a live map of Toronto β then watch a council of six Claude agents debate your route in real time, stress-testing it for cost, ridership, community impact, and political risk.
No spreadsheets. No guesswork. Just a map, your cursor, and six AIs arguing about your decisions.
- Interactive map β draw, edit, and delete transit lines on a live Mapbox map of Toronto's full TTC network
- AI route generation β describe a corridor and the AI assistant proposes a route, snapping to real TTC stops
- AI map assistant β ask spatial questions ("where are the network gaps?") and get answers drawn directly on the map
- 6-agent council β structured multi-turn deliberation streams live via SSE as agents debate, rebut, and vote
- Transit simulation β ridership gravity model, travel time scoring, and equity metrics for any proposed network
- Population & traffic layers β PostGIS-backed heatmaps of density, ridership demand, and road congestion
- Street view β preview any proposed stop location at street level
- Timetable view β schedule visualisation for planned routes
- Agent voice β ElevenLabs TTS reads agent quotes aloud during deliberation
Each council run is a structured 6-turn debate:
| Agent | Role | Model |
|---|---|---|
| Alex Chen | Ridership Planner β advocates for equity and high-density corridors | Sonnet |
| Jordan Park | Infrastructure Analyst β scrutinises cost and construction feasibility | Sonnet |
| Margaret Thompson | NIMBY Resident β raises community and neighbourhood concerns | Haiku |
| Devon Walsh | PR Director β evaluates political risk and public perception | Haiku |
| Alex & Jordan | Joint Rebuttal β synthesised response to critique | Sonnet |
| Planning Commission | Final verdict with binding route modifications | Sonnet |
Agents use tool calls to query real TTC stop data and enforce planning rules: 800m minimum station spacing, no gaps over 1500m, and transfer stations must justify connections to existing lines.
| Layer | Technology |
|---|---|
| Framework | Next.js 15 (App Router), React 19, TypeScript |
| Styling | Tailwind CSS 4 |
| Mapping | Mapbox GL, Mapbox GL Draw |
| 3D | Three.js / React Three Fiber |
| AI | Anthropic Claude (Haiku 4.5 + Sonnet) Β· Gemini (optional) |
| Auth | Auth0 via NextAuth v5 |
| Database | Supabase + PostGIS |
| Voice | ElevenLabs TTS |
| Deployment | Docker, Vercel |
- Node.js 20+
- Mapbox public token
- Anthropic API key for the AI council
- Supabase project with PostGIS (population and ridership layers)
git clone https://github.com/evanzyang91/transit-planner.git
cd transit-planner
npm install
# Copy and fill in environment variables
cp .env.example web/.env.local
# Start the dev server (from repo root or web/)
npm run devApp runs at http://localhost:3000. Navigate to /map for the planner.
All commands can be run from the repo root or web/:
npm run dev # Next.js + Turbopack
npm run build # Production build
npm run lint # ESLint
npm run typecheck # TypeScript
npm run format:write # PrettierSet these in web/.env.local:
# Required
NEXT_PUBLIC_MAPBOX_TOKEN=pk.ey...
ANTHROPIC_API_KEY=sk-ant-...
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_KEY=your_service_role_key
AUTH_SECRET= # openssl rand -base64 32
# Optional
ELEVENLABS_KEY= # agent voice TTS
GEMINI_API_KEY= # alternative AI provider
AI_PROVIDER=anthropic # "anthropic" (default) or "gemini"
DISCORD_WEBHOOK_URL= # fallback/general Discord notifications
DISCORD_REGULAR_VISITS_WEBHOOK_URL= # regular visit notifications
DISCORD_REFERRAL_VISITS_WEBHOOK_URL= # referral visit notifications
DISCORD_BUG_REPORTS_WEBHOOK_URL= # bug report feedback notificationstransit-planner/
βββ web/
β βββ src/
β βββ app/
β β βββ map/ # Main planner page
β β βββ timetable/ # Route schedule view
β β βββ docs/ # Documentation + AI chat
β β βββ api/ # API routes (council, simulation, AI, data)
β βββ server/ # Council orchestration, AI providers, Supabase
β βββ lib/ # Shared utilities
βββ can_pop.geojson # Canadian population dataset (90MB)
βββ Dockerfile.web
βββ docker-compose.yml
βββ vercel.json
PRs are welcome. For anything beyond small fixes, open an issue first.
