Find a file
GeorgeWebberley bae91380a0
All checks were successful
ci/woodpecker/release/woodpecker Pipeline was successful
Fixed card width during rocket takeoff
2026-01-29 16:59:30 +01:00
app Added labels and versioning 2026-01-29 15:51:38 +01:00
components Fixed card width during rocket takeoff 2026-01-29 16:59:30 +01:00
config Added next rocket data 2026-01-28 20:39:18 +01:00
lib Added correct timezone 2026-01-29 13:22:51 +01:00
public Initial commit from Create Next App 2026-01-28 14:53:17 +01:00
scripts Changed ISS API 2026-01-29 11:04:41 +01:00
types Added next rocket data 2026-01-28 20:39:18 +01:00
.dockerignore slimming down container 2026-01-29 07:34:40 +01:00
.gitignore Finished adding worker and woodpecker ci 2026-01-28 17:37:10 +01:00
.woodpecker.yaml Removed double tags from deploy 2026-01-29 15:57:32 +01:00
docker-compose.yaml Added correct timezone 2026-01-29 11:19:12 +01:00
Dockerfile Added labels and versioning 2026-01-29 15:51:38 +01:00
eslint.config.mjs Initial commit from Create Next App 2026-01-28 14:53:17 +01:00
next.config.ts Put down initial structure of background and cards 2026-01-28 15:20:04 +01:00
package-lock.json Finished adding worker and woodpecker ci 2026-01-28 17:37:10 +01:00
package.json Finished adding worker and woodpecker ci 2026-01-28 17:37:10 +01:00
postcss.config.mjs Initial commit from Create Next App 2026-01-28 14:53:17 +01:00
README.md Finalised moon phases and iss 2026-01-28 20:11:44 +01:00
space_data.db Finished adding worker and woodpecker ci 2026-01-28 17:37:10 +01:00
tsconfig.json Initial commit from Create Next App 2026-01-28 14:53:17 +01:00
Worker.Dockerfile Attempt 3 at fixing dockerfile 2026-01-29 07:45:53 +01:00

🛰️ Mission Control: ISS Tracker

A production-grade, full-stack dashboard for tracking the International Space Station in real-time. This project combines orbital mechanics (SGP4 propagation), a background worker architecture, and a resilient Next.js frontend.

🚀 The Stack

  • Frontend: Next.js 15 (App Router) + Tailwind CSS + Lucide Icons
  • Backend/Worker: Node.js + satellite.js (Orbital Physics)
  • Database: SQLite (better-sqlite3)
  • Infrastructure: Docker & Docker Compose
  • CI/CD: Woodpecker CI
  • Deployment: Hetzner VPS + Caddy (Reverse Proxy)

🏗️ Architecture

The system is split into two distinct services that share a persistent SQLite volume:

  1. The Worker (iss-worker):
    • Fetches Two-Line Element (TLE) data from CelesTrak.
    • Performs SGP4 propagation to calculate ISS coordinates.
    • Determines upcoming "Pass Windows" (AOS to LOS) relative to a fixed ground station.
    • Updates the shared database with the next two valid passes.
  2. The Web App (mc-web):
    • Server-side queries the database for the next future pass.
    • Calculates real-time "T-Minus" countdowns.
    • Triggers a "Live" state when the ISS is above the horizon.
    • Uses router.refresh() with a useRef lock to transition between passes without page reloads.

🛠️ Key Technical Solutions

Orbital Propagation

Instead of relying on 3rd-party APIs for pass predictions, this project runs its own physics engine. Using satellite.js, it calculates the elevation of the ISS relative to the observer's latitude and longitude.

Self-Healing Database

The database includes an automatic migration layer in lib/db.ts. On startup, the application inspects the SQLite schema and applies necessary ALTER TABLE commands, ensuring seamless updates during CI/CD deployments without manual intervention.

Resilient Synchronization

To prevent infinite refresh loops in the Next.js frontend, the EventCard component implements a "Refresh & Quiet" logic. It uses a useRef to ensure that only one server-side data sync is requested per orbital event.

📦 Deployment

Docker Multi-Platform Build

The images are explicitly built for the linux/amd64 architecture to ensure compatibility with Node.js native modules (like better-sqlite3) on the Hetzner VPS.

docker buildx build --platform linux/amd64 -t mission-control-web .

Woodpecker CI

The pipeline is automated via .woodpecker.yaml, handling the build, registry push, and remote deployment via Docker Compose.

🚦 Getting Started

  • Clone the repo
  • Install dependencies: npm install
  • Run the worker: npx tsx scripts/update-space.ts
  • Start the dashboard: npm run dev

Ground Station Coordinates: 55.6761° N, 12.5683° E