ttc-alerts-svelte Svelte Themes

Ttc Alerts Svelte

rideTO PWA

Real-time Toronto Transit Commission service alerts progressive web app.

Live URLs:


šŸ“š Documentation

Document Purpose
APP_IMPLEMENTATION.md Start Here - File inventory, status, architecture
SIMPLIFIED_ALERT_SYSTEM.md v235+ alert-based architecture, is_active logic
ETA_SYSTEM.md Real-time ETA: NTAS API, NextBus, Line 5/6 fallback
DATA_POLLING_FREQUENCIES.md Data refresh rates, cron jobs, API sources
IMPLEMENTATION_PLAN.md Feature roadmap & phase progress
DESIGN_SYSTEM.md UI design tokens, colors, typography
alert-categorization-and-threading.md Edge Function logic, data flow
CODEBASE_ACTION_PLAN.md Code optimization (completed)
SECURITY_AUDIT.md Security review findings

Reference Docs

Document Purpose
TTC-ROUTE-CONFLICTS.md Route number conflicts (39/939, etc.)
TTC-BUS-ROUTES.md Bus route reference
TTC-STREETCAR-ROUTES.md Streetcar route reference
ROUTE_BADGE_STYLES.md Route badge color system

Tech Stack

Layer Technology
Frontend Svelte 5 + TypeScript + Tailwind CSS + shadcn-svelte
Typography Lexend (dyslexic-friendly)
Backend Supabase (PostgreSQL + Edge Functions + Realtime)
Hosting Cloudflare Pages
Data Sources TTC Live Alerts API, TTC GTFS

Getting Started

Prerequisites

  • Node.js 18+
  • npm

Installation

# Clone repository
git clone https://github.com/shabanmohd/ttc-alerts-svelte.git
cd ttc-alerts-svelte

# Install dependencies
npm install

# Set up environment variables
cp .env.example .env
# Edit .env with your Supabase credentials

Development

# Start dev server
npm run dev

# With translation file watching
npm run dev:watch

# Type checking
npm run check

Building

# Production build
npm run build

# Preview production build
npm run preview

Project Structure

src/
ā”œā”€ā”€ lib/
│   ā”œā”€ā”€ components/      # UI components
│   │   ā”œā”€ā”€ alerts/      # Alert display components
│   │   ā”œā”€ā”€ dialogs/     # Modal dialogs
│   │   ā”œā”€ā”€ eta/         # ETA feature components
│   │   ā”œā”€ā”€ layout/      # Header, nav, sidebar
│   │   ā”œā”€ā”€ stops/       # Stop search & bookmarks
│   │   └── ui/          # shadcn-svelte base components
│   ā”œā”€ā”€ data/            # Static data (routes, stops)
│   ā”œā”€ā”€ i18n/            # Internationalization (en/fr)
│   ā”œā”€ā”€ services/        # API clients, storage
│   ā”œā”€ā”€ stores/          # Svelte stores
│   ā”œā”€ā”€ types/           # TypeScript types
│   └── utils/           # Utility functions
ā”œā”€ā”€ routes/              # SvelteKit pages
└── app.html             # HTML template

supabase/
ā”œā”€ā”€ functions/           # Edge Functions
│   ā”œā”€ā”€ poll-alerts/     # Alert polling & threading
│   ā”œā”€ā”€ get-eta/         # ETA predictions
│   ā”œā”€ā”€ scrape-maintenance/  # Maintenance scraping
│   └── submit-feedback/     # Feedback form handler
└── migrations/          # Database migrations

static/
ā”œā”€ā”€ data/                # GTFS data files
ā”œā”€ā”€ icons/               # PWA icons
└── manifest.json        # PWA manifest

Environment Variables

# Required
VITE_SUPABASE_URL=https://xxx.supabase.co
VITE_SUPABASE_ANON_KEY=xxx

# Optional (for DeepL translations)
DEEPL_API_KEY=xxx

Contributing

  1. Check APP_IMPLEMENTATION.md for current status
  2. See IMPLEMENTATION_PLAN.md for roadmap
  3. Follow patterns in DESIGN_SYSTEM.md

License

MIT

Top categories

Loading Svelte Themes