Inspiration
Raids are the only built-in way streamers collaborate on Twitch, and they leak. A raid lands, chat fills with "hi raiders", and a few minutes later most of those viewers are gone. Raid trains chain raids across many channels for hours, but nothing tracks the journey, nothing rewards the viewers who ride it, and no host ever finds out whether anyone actually stayed.
We wanted to make riding a raid train feel like a trip worth taking. So we gamified it: every host is a planet in a shared night sky, every raid draws a route to the next stop, and every viewer who checks in collects stamps in a passport and medals for the whole train. Staying is the game.
What it does
- Arrival: when a raid lands, the host's OBS overlay greets the riders and our bot asks them to type
!checkin. Every check-in is a stamp, and the Arrived counter climbs live on stream. - Stay reveal: ten minutes in, Raidway checks who is still in chat and shows "X of Y stayed" on the overlay.
- Next stop: when the host raids on, the overlay sends riders to the next station, and riders who check in again earn Rode on.
- Recap: when the train ends, its page turns into a recap with medals, and every train counts toward the records board.
- Passport: riders keep their stations, stamps and medals at a public passport page. Hosts get a plot card showing how many riders they welcomed and how many stayed.
Medals reward riding the whole train, not just showing up:
- Full Ride: checked in at every station.
- Conductor: the most stations on the train, with at least two.
- Local and Patron: followed or supported at two or more stations.
How we built it
Codex was our main builder. We planned the project as a roadmap of small features, each with its own spec and tickets, and Codex implemented them one ticket at a time. We used other AI assistants as code reviewers, checking each branch against our repo standards and against what the spec asked for. The design base was also made with Codex: it produced the reference boards for every view, and we applied them as the last feature once everything else worked.
The stack:
- Backend: TypeScript on Node 22, Fastify, and SQLite through Drizzle, all in one long-running process that owns the Twitch webhooks, the pollers and the live event streams.
- Twitch: EventSub webhooks for raids, follows, cheers and subs, a chat bot over the EventSub WebSocket for
!checkin, Get Chatters for the minute-ten observation, and Get Streams to tell when a train has ended. - Frontend: Vue and Vite as a multi-page build. The OBS overlay is its own entry, so it loads fast and imports nothing the sky map needs. Everything updates over Server-Sent Events.
- Testing: admin simulation endpoints accept the exact EventSub payloads Twitch sends, so the tests, the Twitch CLI and the real webhooks all go through the same handler. That let us run whole raid trains in tests with a fake clock.
The stats are built to be honest. Arrived counts riders who checked in, not the raid's viewer count. If Twitch can't tell us who is still in chat, Stayed is shown as unknown, never zero. The best retention record is summed over the set $O$ of stations where Stayed was actually observed:
$$ \text{retention} = \frac{\sum_{s \in O} \text{Stayed}s}{\sum{s \in O} \text{Arrived}s}, \qquad \text{with } \sum{s \in O} \text{Arrived}_s \ge 10 $$
The floor of ten keeps a one-of-one station from taking the record.
Challenges we ran into
Time. This was a weekend hackathon with a Monday deadline, and we also had to deploy, enroll real channels and shoot a live demo with two streamers and their riders. Every feature had to fit that window, so we kept a strict cut line and dropped anything that wasn't ready.
Deciding the main features. We started with far more ideas than time: minigames, automatic clips, scheduled lines, an open network of unclaimed channels. Choosing the core loop (check in, stay, ride on, earn medals) and cutting the rest was the hardest call. Several of those ideas now sit under "Later" on the roadmap.
How it looks. We built every feature as plain colored squares on a grid first and held the visual design until the features worked. The first concept was an isometric world of plots. When we finally applied the skin, we switched to a night sky of planets, where planet size grows with trains ridden and conductors get rings. Applying it to every view on the final day without changing what any view shows took a lot of care.
What we learned
- Twitch tells you less than you'd expect. It doesn't say who raided, so we count who checked in. A raid only fires its event if the raid message shows up in chat, so a host who hides raid messages produces no station. Some events arrive twice, so every handler has to tolerate duplicates.
- Tooling assumptions break. We planned to use WebSockets for everything, then found that the library ties each subscription to one user's socket, so one connection couldn't watch other channels. We moved raids to webhooks and kept the WebSocket only for the chat bot.
- AI builds faster with tight specs. Codex worked best when each ticket was small and had a clear test, and a separate AI reviewer caught drift from the spec that the builder missed.
- Function before form. Holding back the design until the features were green meant the design pass never blocked the demo.
What's next
Arrival clips, letting hosts customize their planet, a departures board that shows where a train is right now so viewers can hop on, and lifetime passport ranks that stations can greet.
Built With
- codex
- vue