How it is built
This page is the repository’s docs/architecture.md,
for anyone who wants to read or change the code.
boilerRomM shows a RomM library inside Steam’s Big Picture UI, downloads what you pick, installs the emulators that run it, and makes each installed game behave like a Steam game: a library entry, a row in Settings > Storage, Uninstall, and Steam’s Downloads page while it downloads.
Principles
- RomM is the catalogue. The game list is fetched from RomM; the plugin keeps no copy of it.
- The install ledger decides a game’s state. One record per game on this device (
installs.json), with the files RomM listed and their sizes. The disk is only ever checked against it, so “installed” means every file is there in full, and a download cut off by a restart continues afterwards. - One state, one event. The backend owns one snapshot (
App.state()); every command returns it and every change pushes it asboilerromm_state. Download progress goes out separately (boilerromm_progress). - Steam is touched in one place. Everything that reaches into Steam lives in
src/steam, acts only on our own games and can be undone. See src/steam/README.md. - Nothing secret typed on the device. Pairing uses RomM’s device code flow; the token lives in a 0600 file.
Backend (main.py, py_modules/boilerromm/)
main.py is the list of calls the frontend can make; each forwards to App. Nothing under py_modules/ imports
decky, so the package runs in tests.
| Where | Owns |
|---|---|
app.py |
App: builds the rest, takes its commands from the four commands.py classes below, and resets everything |
core.py |
Core, the base of the commands.py classes: declares what App builds so they are type-checked against it, and emits the events |
settings.py, jsonfile.py |
the settings file (server, token, device id, ROM folder, SteamGridDB key) and the one atomic JSON writer |
romm/ |
client.py the RomM client, pairing.py the device code flow, library.py platforms and games; commands.py: server address, pairing, connection check, library refresh |
games/ |
ledger.py the install records and their check against the disk, install.py where a game lives on disk, downloads.py the queue (one at a time, per-file .part with resume), shortcuts.py which Steam shortcut belongs to which game, video.py trailer streams (runs the vendored yt_dlp from py_modules/, found by this file’s depth); commands.py: what is installed, download, remove, storage |
sgdb/ |
client.py SteamGridDB, artwork.py its cache and prefetch, signin.py and cdp.py “Sign in with Steam” for the key; commands.py: the key, a game’s art and icon |
emulators/ |
one class per emulator boilerRomM installs and runs itself (base.py is the shape they share), with releases.py, sevenzip.py, progress.py for fetching a build and inifile.py, xmlfile.py for editing its config; commands.py: install, firmware, and the launch script of a game |
Decky Loader’s Python is a trimmed one: it has no xml package, for one. A module that the tests import fine can
still be missing on the device.
Files on the device, all under Decky’s settings and runtime folders for the plugin: settings.json,
installs.json, shortcuts.json, sgdb/ (art cache), icons/, and boilerromm-launch, which every Steam
shortcut runs with the game’s id; it runs launch/<id>.sh, the emulator command the backend wrote for that game.
The same runtime folder holds roms/, bios/, saves/, states/ and emulators/. These paths, and the plugin’s name they derive from, must not change: existing shortcuts and
records depend on them.
Frontend (src/)
| Folder | What lives there | May import |
|---|---|---|
api.ts, state.ts |
the backend’s calls, events and types; hooks for the latest state and progress | @decky/api |
domain/ |
pure logic: status and actions, formatting, the store’s catalogue, routes | types from api.ts |
steam/ |
every hook into Steam, behind steam/index.ts |
@decky/* only |
app/ |
use cases joining the backend and Steam: start-up, download, remove, shortcut repair | api, domain, steam |
ui/kit/ |
shared components, tokens, art, backdrops, focus, video | domain, api types |
ui/store/, ui/game/, ui/settings/, ui/setup/ |
the store pages, the game page, the settings pages, first-run setup | kit, domain, app, api |
index.tsx |
registers the routes and the panel, starts and stops app |
ui, app |
Checks
pnpm typecheck && pnpm test && pnpm build # frontend: types, tests/{steam,domain,app}, bundleuv run ruff check py_modules/boilerromm main.py tests && uv run ty check && uv run pytest # backendtests/test_contract.py fails when the frontend and backend disagree on a call name, an event name or the keys
of the state.