Orrery 1: The Campaign App That Wanted to Be a Platform
/ 11 min read
Table of Contents
I was sorting my app’s modules into two columns. Left column: things that only make sense for Starfinder. Right column: things that would work for any tabletop game if I squinted a little. I expected the left column to win. It’s a Starfinder app. That is the entire pitch.
The right column was longer.
That was the moment I stopped building a campaign app and started, mostly by accident, building a platform. This post is the story of how that happened, the first wrong turn I almost took, and why I decided not to fight the result. It’s the first in a series about Orrery, the platform that fell out of it, and the technology underneath.
What MercNet Is
I run a Starfinder campaign. Starfinder is a science-fantasy tabletop RPG: starships, laser pistols, a galaxy full of corporations that would like a word about your credit balance. I pour a lot of time into worldbuilding and lore, and in-person groups are notorious for meeting infrequently. Every session started with me and my players scratching our heads over which NPC that was, or what the small print on a gig had said three weeks ago. Add the handouts, the group chat, and a spreadsheet for everyone’s money, and I wanted one place where all of it was indexed and reachable, not just by me but by the players.
It also had to work for everyone at the table. We meet in person, but someone occasionally has to call in, and I run other campaigns that are fully digital. A tool that lives on a phone works for all three, including the player who doesn’t own a computer.
So I built MercNet. In the fiction, MercNet is the operating system that runs on every comms unit, station billboard and starship computer in the setting. Out of the fiction, it’s a web app with four faces:
- The GM console on my laptop: every tool, the in-world clock, who’s online.
- The comms device: each player opens the site on their phone and gets a home screen, a dock, badges, and notifications. It installs like an app. It feels like their character’s phone, which is the point.
- The ship computer: the same apps in a bridge-console skin, for a shared screen.
- The billboard: a signed-out kiosk on the TV that rotates ads, news and job postings, and takes pushes from me.
The apps are what you’d expect from a galaxy’s operating system: messaging (where I can speak as any NPC), a wiki of everything the party has learned, a job board, a news feed, a store, a credit ledger, quests, a session logbook, a timeline, and a tactical battle map. A cheerful purple planet named Cosmo delivers every notification, because a notification with a face lands better than a toast.
The feature I’m proudest of is the one nobody sees. Every piece of content is tagged GM-only, party, or specific players, and the server filters every query. A player’s device never receives a hidden row. Not “hidden in the UI”. Never sent. Revealing something to the party is a real event: the people who just gained access get a notification, with Cosmo commentary. Secrets in a tabletop game are the whole game, so the visibility system is the foundation everything else sits on.
The Honest History
This is the third MercNet. The first was a Flutter app. The second was a mobile-only React app with no real back end. The one I’m describing is a web app with a Node server, SQLite under it, and a React client that runs on anything with a browser, and at the time of writing it is one week old. I’ve been burning it at both ends, and I had help: an AI agent team did most of the typing while I did the deciding. That workflow gets its own post, because it deserves one and because it changes what “a week” means.
I don’t have clean post-mortems for the first two. What I remember is that each one was built for the campaign rather than as a thing, and when the campaign’s needs shifted, the app didn’t bend. It broke, and I started over. Which is roughly the setup for the problem this post is about, except this time I noticed before the break.
The Two Columns
What made the sort possible at all was a decision I made early for boring reasons: every module in MercNet has the same anatomy. A catalog entry that names it. A server file that mounts its routes. A web folder with a manifest the launcher discovers on its own. Visibility filtering, create-read-update-delete routes, and live updates to every connected device all come from shared plumbing; a module writes a row, announces what kind of thing changed, and every screen showing that kind of thing refetches. No socket code in any module. I did this because I was adding a module a day and didn’t want to think about it.
The side effect: because every module is shaped the same, I could line all thirty-odd up and ask one question of each. Does this know what game it’s for?
The right column, the one that doesn’t care: messaging, the wiki, news, the wallet, quests, sessions, the billboard, settings. A second group needs a hook or two from the rules but is otherwise generic: the job board (it wants to know what a hard difficulty check is), the store, the timeline (it wants a calendar), the crafting workbench.
The left column, the Starfinder half: the character sheet and everything it computes, the combat tracker, the bestiary, starships, mechs. And a small pile of modules that aren’t even Starfinder. They’re this campaign. One player’s cult. Another player’s nanite swarm. A homebrew lab. Those belong to my table and nobody else’s.
Then the battle map, which I’d assumed was the most Starfinder thing in the app. I went through it file by file. Geometry, hex grids, fog of war, line of sight, lighting, elevation, regions, saved stages, map imports from two other tools: none of it knows a single rule. By my count the map engine is about eighty percent neutral. The twenty percent that leaks is specific and findable: the five-ten-five diagonal rule for movement, a flat +4 for cover, a range penalty, hit points and stamina points baked into the token’s view model, and starships, which are a rules system unto themselves.
That’s the finding I wrote down, and it’s the sentence this whole project hangs on:
The plumbing is generic in mechanism but closed in shape.
The mechanism didn’t care which game. The shapes did. The module catalog is a static array. The set of entity kinds
the live system knows about is a TypeScript union of forty-eight string literals. The clock service, which advances the
in-world date, imports three specific modules by name to tell them the day moved. Skills are a union type, and that
union reaches into hazards, projects, hirelings, the workbench and one player’s cult module. The combat tracker’s
combatant has hit points, stamina, resolve, and two armor classes as named fields, and the map’s token view copies that
struct. The character sheet’s compute function owns inventory, and the store, consumables, the combat tracker and two
campaign modules all read inventory through it.
Three threads. Pull any one and five modules move. None of them were mistakes when I wrote them. They were the fastest correct thing for a Starfinder app. They’re just not the shape of a platform.
The Wrong Turn
My first instinct was the obvious one: fork it. Copy the repository, rip Starfinder out, rename everything, and build the second game on the clean copy.
I got as far as thinking it through before I caught the problem. My table plays on this app every week. A fork means two codebases, and I know exactly how that goes: the one with real players gets the bug fixes, the fork gets the good intentions, and in a month they’ve diverged enough that porting anything is a chore I avoid. The fork rots. I’ve watched this happen on systems I’d rather not name, and I’ve done it to myself before (see: the first two MercNets).
There was a second, smaller reason. Renaming the package scope across five hundred-odd import lines is pure noise until something is actually published under the new name. A big-bang rename produces an enormous diff that proves nothing.
What I Decided Instead
Same repository. A strangler refactor in place, in phases, where every phase merges to main with the live app behaving identically. The table never notices. Each phase gets a parity test: run the old Starfinder code path and the new contract-based path on the same fixture and assert the numbers match. When the static lists are gone, the parity tests go with them.
The contracts are three. A game system owns rules: dice conventions, vocabulary, the character sheet’s build and compute, the combat model, the map’s movement and cover rules, the calendar. A skin owns look and words: the product name, what each app is called, the palette, the narrator (Cosmo, or nobody), the device names. And the module registry opens up: a module declares its own tables, entity kinds, clock hooks and snapshot placement, instead of being hard-wired into five central lists.
Rule for the contracts: a skin carries no rules and a system carries no branding. The content audit test enforces the boring version of this, failing the build if a setting name or a real person’s name shows up in a directory that will become a platform package.
For the proof system I picked Draw Steel, on purpose, because it’s the game furthest from Starfinder that I’d actually want to run. Two ten-sided dice with tiered results instead of a d20. No armor class at all. Stamina and Recoveries instead of hit points. Five characteristics. If the seams fit Draw Steel, they fit. If I’d picked Pathfinder, which shares Starfinder’s bones, I’d have proven nothing and found out two games later.
Where it stands as I write this: the hygiene phase is done, the seams phase is done, the file moves are done, and the map decoupling (the risky one, the one with the three threads) is underway. Draw Steel doesn’t exist yet. This post will be wrong about some detail by the time you read it, and I’m fine with that. The repo is private for now, since I may take this commercial, so this series shows the design decisions rather than dumping code.
Why Orrery
An orrery is a mechanical model of the solar system: a brass sun at the center, planets on arms, gears underneath so that turning a crank moves every world in its proper orbit. I picked the name because that is precisely the shape I ended up with. A core that provides the gravity (visibility, live updates, the registry, the map engine, devices and roles) and any number of worlds set on top of it: a Starfinder world named MercNet, a Draw Steel world with a different skin, whatever comes after. Each one orbits the same center, and the center doesn’t know or care what they’re called.
MercNet keeps its name. It becomes “MercNet, powered by Orrery”, and working out exactly which identifiers belong to the product and which belong to the platform turned out to be its own interesting problem, with its own rule. That’s a later post.
What I’d Take From This
If you build the same thing three times, the third one is trying to tell you something. I didn’t set out to build a platform. I set out to stop rebuilding a campaign app. Those turned out to be the same goal.
Uniform module anatomy is what made the question answerable. I adopted it to save effort. It paid off by letting me audit thirty modules in an afternoon. If your modules are all shaped differently, you can’t even ask which ones are generic.
Check your union types. “Generic in mechanism, closed in shape” is the kind of debt that’s invisible until you want a second instance of anything. Static arrays and string-literal unions feel like type safety. They’re also a list of places where the platform is secretly one product.
Don’t fork a thing you’re using. The strangler approach is slower and every phase has to land clean. It’s also the only version where the people already relying on the system keep getting fixes.
The build is green. There are three threads still tying the map to one game, and a proof system that doesn’t exist yet. Succeeded with errors. On to the next one.
Next in the series: the day I burned most of a month’s CI minutes, and what the pipeline looks like now.