Skip to content

About

Real-time ship tracking on a dark-themed map. AIS vessel positions worldwide with heading indicators and vessel details.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

ShipTracker

Real-time ship tracking on a dark-themed map. Displays AIS vessel positions worldwide with rotated heading indicators and detailed vessel information on click.

Inspired by the now-defunct shipradar24.xyz.

Features

  • Full-screen dark map (OpenStreetMap basemap, inverted to dark)
  • Ship markers rotated to heading, colored by type (cargo, tanker, passenger, etc.)
  • Real-time position updates via AISStream.io WebSocket
  • Click any ship for details: name, MMSI, IMO, type, speed, course, destination, dimensions
  • Automatic fallback to Digitraffic.fi (Baltic region) if AISStream is unavailable

Quick Start

npm install
cp .env.example .env
# Add your AISStream API key to .env (free at https://aisstream.io)
npm run dev

Open http://localhost:5173.

Data Sources

Source Coverage Auth Protocol
AISStream.io Global Free API key WebSocket (proxied via Vite/nginx to force HTTP/1.1)
Digitraffic.fi Baltic Sea None REST (30s polling)

AISStream's server negotiates HTTP/2 via ALPN, but doesn't support WebSocket-over-HTTP/2 (RFC 8441). Browsers hang at readyState=0. The app proxies through Vite (dev) or nginx (prod) to force HTTP/1.1 upstream.

Docker

docker build --build-arg VITE_AISSTREAM_API_KEY=<your-key> -t shiptracker .
docker run -p 8080:80 shiptracker

Testing

npm test          # Run all tests
npm run coverage  # Run with coverage (80% threshold)

Tech Stack

  • Vite + vanilla TypeScript
  • Leaflet + leaflet-rotatedmarker
  • Vitest + jsdom (84 tests, 99% statement coverage)
  • nginx:alpine (production)

License

Data: Digitraffic (CC 4.0 BY), AISStream. Map tiles: OpenStreetMap.

About

Real-time ship tracking on a dark-themed map. AIS vessel positions worldwide with heading indicators and vessel details.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages