Skip to content

Repository files navigation

Rail Radar

Features

  • Interactive map with 22,000+ railway stations across Italy, Switzerland, Germany, Finland, Belgium, Denmark, the Netherlands, Norway, Sweden, Poland, the United Kingdom, Ireland, France, and Luxembourg
  • Real-time arrivals and departures, where supported by each official source (RFI, SBB, DB, Digitraffic, iRail, Rejseplanen, NS, Entur, Trafiklab, PLK, LDBWS, Irish Rail, SNCF, Mobiliteit.lu)
  • Station search with fuzzy matching
  • Operator directory with network metadata and static coverage maps
  • Trending stations ranked by unique visitors, with both unique and total visit counts available
  • Shareable URLs with map state, saved stations, and recent stations
  • User geolocation support
  • Responsive mobile-friendly design

Project Structure

Directory Description
apps/api Cloudflare Workers API for train data
apps/studio Admin tool for station data management
apps/web TanStack Start frontend and media Worker
packages/data Shared station data and TypeScript types
packages/ui Shared React component library

Quick Start

# Install dependencies
pnpm install

# Run all development apps
pnpm dev

# Run specific app
pnpm --filter=web dev    # Frontend at localhost:3000
pnpm --filter=api dev    # API server
pnpm --filter=studio dev # Admin tool at localhost:3001

Scripts

Command Description
pnpm dev Start all development servers
pnpm --filter=studio dev Start the admin tool at localhost:3001
pnpm build Build all packages
pnpm lint --force Lint all packages
pnpm format Format code with oxfmt
pnpm check-types --force Run TypeScript type checking
pnpm --filter=api cf-typegen Generate API Worker types
pnpm --filter=web cf-typegen Generate web Worker types
pnpm --filter=api deploy Deploy the API Worker to Cloudflare
pnpm --filter=web deploy Build and deploy the web Worker to Cloudflare

Deployment Architecture

The public website runs on Cloudflare Workers using TanStack Start, Vite, and the Cloudflare Vite plugin. The browser assets are deployed with the Worker through Cloudflare Workers Static Assets, while request-time rendering and same-origin /media/* routes run in the Worker. The Hono API is a separate Cloudflare Worker at api.railradar24.com.

The Studio app remains a separate SvelteKit application and uses the Cloudflare adapter for production builds.

Media Delivery

Shared media is served by apps/web on the same origin as the TanStack Start frontend. Repo-owned media such as flags, operator logos, screenshots, and static social images is served under /assets/* through Cloudflare Workers Static Assets. Generated images and R2-backed station photos use same-origin /media/* routes; curated photos live in an EU Cloudflare R2 bucket and are described by per-station manifests. See the web media delivery documentation for the directory convention, manifest template, image requirements, and upload workflow.

Support

Rail Radar is free to use and independently maintained. If it's useful to you, you can help cover the API calls, hosting, and map tiles that keep it running.

Donate via Polar — one-time, monthly, or yearly support. Also reachable from the in-app /donate page or the "Sponsor" button at the top of this repository.

Contributing

See CONTRIBUTING.md for setup, development workflow, quality checks, and pull request guidelines.

Contributing Station Data

Station data contributions are supported through Rail Radar Studio. For the full workflow, see CONTRIBUTING.md and apps/studio/README.md.

License

This project is licensed under the MIT License - see the LICENSE file.

Acknowledgments

About

Interactive, extensible real-time railway tracker for Europe.

Topics

Resources

Code of conduct

Contributing

Stars

3 stars

Watchers

0 watching

Forks

Sponsor this project

Used by

Contributors

Languages