Skip to content

bigkrys/fleet-console

Repository files navigation

Fleet Console — spin up, observe, spin down: containers on Railway, with a live deployment state machine and streaming logs

Built as a take-home for Railway's Senior Full-Stack Engineer (Product) role — and as an opinion about what container operations should feel like: launching a container is a process, not an event, and the UI's job is to make that process legible in real time.

01 — What it does

  • Launch a container from any public Docker image into your Railway project (via serviceCreate on the Railway public GraphQL API) — with an optimistic provisioning card the instant you click
  • Watch every deployment walk its lifecycle — QUEUED → BUILDING → DEPLOYING → LIVE — on a live timeline with per-stage elapsed time, streamed over SSE. Stages that don't happen are marked skipped, never faked (image deploys have no build phase)
  • Stream build + runtime logs in one merged, severity-colored panel
  • Trace each service's recent state transitions in a mini event feed
  • Stop / Redeploy / Delete with one click

02 — Architecture

Browser ──(GraphQL)──▶ /api/graphql   Yoga BFF: own domain schema, not a proxy
   ▲                        │
   │ SSE                    ▼
/api/stream/fleet      lib/railway.ts ──▶ Railway public GraphQL API
/api/stream/logs/:id        (typed client, single choke point)

The BFF exposes a small domain schema (fleet, launchService, stopDeployment, …) instead of proxying Railway's. State changes flow one way: mutations go through GraphQL; live state comes back through SSE streams that poll Railway server-side and push diffs — clients never poll.

03 — Run it

cp .env.example .env.local   # fill in the three values below
npm install
npm run dev                  # http://localhost:3300
Variable Where to get it
FLEET_API_TOKEN Railway → Account Settings → Tokens
FLEET_PROJECT_ID from your project URL: railway.com/project/<PROJECT_ID>
FLEET_ENVIRONMENT_ID same URL: ?environmentId=<ENVIRONMENT_ID>

The FLEET_* prefix is deliberate: Railway injects reserved RAILWAY_* variables into every deployment, which would shadow same-named config.

Point it at a throwaway empty project — Fleet Console creates and deletes real services inside it. A good demo lineup: chentex/random-logger (chatty logs), traefik/whoami (fast to LIVE), and a broken tag like busybox:no-such-tag to see the FAILED path.

04 — Docs and decisions

  • docs/ERD.md — engineering requirement document: idea → defined tasks → implementation → monitoring its success
  • docs/DECISIONS.md — five architecture decisions and their trade-offs, plus what I'd build next: Temporal-owned deploy workflows, agent-supervised quality gates, and a fleet canvas.

About

Spin up, observe, spin down — containers on Railway. GraphQL BFF over the Railway public API, live deployment state machine + logs streamed via SSE.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors