Shipped · v0.4.5
Project — 06 · app · windows

Iterum

An aim trainer that lives on your own PC. Walk real routes, clear the angles and train against bots; your drills, scores and settings never leave the computer. The game inside is a web aim trainer; Iterum is the desktop shell around it, which opens no port, refuses every connection and changes the game without editing a byte of it. Iterum is Latin for “once more”: the same drill, again.

the lobby: a drill picked for today, eleven maps, 104 drills
  • 104 drillson 11 maps plus a range: pre-aim routes, retakes, site holds, anti-flash, tracking and grid shooting.
  • 0 portsthe game is served inside the app at app://iterum; nothing on the PC or the network can reach it.
  • 6 layersbetween the game and the internet. A badge in the lobby counts what they blocked.
  • 1 signed doora daily update check, Ed25519-signed, that sends nothing and can be switched off.
The idea

Train offline, on your own PC

Good aim trainers live in the browser and on someone else's server: an account, a connection, and a game bundle too big for anyone to read. Iterum takes one of those games and makes it a desktop app that keeps working with the cable pulled, keeps everything on the machine, and can prove it.

  • Real routes, not just dots: pre-aim the angles of a site in order, hold one while bots peek, retake, play through flashes, or warm up on grids and tracking.
  • Enemy rank from Iron to Radiant, with separate records per rank, so a score means something.
  • Progress: a trend per drill, your weakest drills, and a plan of five drills for today.
  • Your own drills in the Studio, backups of settings, drills and history, and English or Vietnamese, switched live.
  • Same game in the browser. The site builds a web copy from the desktop build, so /play is the app without the installer.
A look around

Lobby, drill, results

a grid drill on the range: score, time and hit rate up top
  • Today's drill leads the lobby: picked from your weak spots, with what it trains and one button to start.
  • Maps as stages: each of the eleven maps is a card with its drill count; filters for pre-aim, angle holding, anti-flash and scenarios narrow the list.
  • The Studio places bots, target zones, walls and smokes on a top-down map, previews them in 3D, and a saved drill gets a share code and a card like the built-in ones.
  • “Sealed · N blocked” sits in the lobby bar; open it to see what the guard stopped.
Architecture

A shell that answers for the internet

architecture · diagram
 Electron main process (main.js)
 ┌────────────────────────────────────────────────────────────┐
 │ offline-guard.cjs     loaded first, closes every way out   │
 │                                                            │
 │ app:// handler        protocol.handle, no port             │
 │   /aim         ──▶ game page                               │
 │   /studio/     ──▶ the drill editor                        │
 │   /data/...    ──▶ drill list, scenes (rank + shuffle)     │
 │   /api/local/  ──▶ account, ranking: local answers         │
 │   anything else ─▶ app/site/ first, then base/             │
 │                                                            │
 │ updater.cjs ── one GET, Ed25519 ──▶ iterum.nhaajt.com      │
 └──────────────▲─────────────────────────────▲───────────────┘
                │ app://iterum                │ IPC, checked
 ┌──────────────┴─────────────────────────────┴───────────────┐
 │ window: sandbox, contextIsolation, no Node                 │
 │   game bundle (as shipped) + CSS and scripts the shell adds│
 │   preload.js ──▶ window.__aimDesktop  (the only door)      │
 └────────────────────────────────────────────────────────────┘
  • main.jsOpens the window and answers app://iterum itself: game files from app/site/ over base/, and the routes the old online service used to answer, from local files.
  • offline-guard.cjsRuns before anything else and closes every exit; counts each blocked attempt for the lobby badge.
  • preload.jsThe page's only way to the main process: a short, fixed list of functions on window.__aimDesktop.
  • Injected UIThe lobby bar, progress plan, backups, offline shield, translations and the look, added as CSS and scripts at load. The game bundle stays byte for byte as shipped.
  • scenarios/Drills as JSON, checked by a build script into one training set; the main process merges them, and Studio drills, into the game's own list.
  • iterum-siteA Cloudflare Worker with the downloads in R2, the signed manifest, and the web copy at /play, cross-origin isolated so the game's worker thread can use SharedArrayBuffer.
Sealed

Don't trust the game, close the exits

The game bundle is minified third-party code, far too large to review. So instead of trusting it, the guard makes the outside unreachable, in layers that each work on their own:

  1. No names resolve. Chromium is told MAP * ~NOTFOUND: not a host, not even localhost. Background networking, sync and proxies are off, and WebRTC can't use UDP.
  2. Request filter. Anything that isn't app://iterum or an in-memory scheme is cancelled: every http, https, ws and file address.
  3. Content-Security-Policy naming only app://iterum, added to every response.
  4. Two permissions: pointer lock and fullscreen, for app pages only. Other downloads, external links and navigation away are refused.
  5. Main-process networking replaced: fetch, http and https refuse every host, loopback included.
  6. Checked IPC. Every message must come from the top frame of an app://iterum page, under 32 MB each and 1 GB a run; the wrapper sits on ipcMain itself, so no handler can forget.

What can reach what: nothing reaches the app, which owns no TCP or UDP socket. The page reaches only app://iterum. The main process makes one kind of request, a GET for the update files, and with automatic updates off, none. tests/offline/run.sh checks all of it against the packaged build: every page probe must fail and the whole process tree must own no listening socket, while playing and in a second launch with no debugging port.

Updates

Update without trusting the site

Each release is a manifest with a detached Ed25519 signature. The private key lives offline, outside every repository, so the website, the Cloudflare account, DNS or anyone on the path can serve files but cannot make an installed copy run their code.

  • Order matters: sizes first (manifest ≤ 16 KB, signature exactly 64 bytes), then the signature over the exact bytes served, and only then the fields.
  • No downgrade, no replay: the version must be strictly newer; the URL must be exactly the release zip on iterum.nhaajt.com; the zip must match the signed size and SHA-256.
  • One narrow channel. The guard hands the updater a single get, once: HTTPS to one host on port 443, three path shapes, no query, no redirects, no cookies, a fixed user agent. The page has no route to it.
  • Quiet: it downloads in the background and installs at the next start; nothing asks the player.
Stack

Electron, a protocol, a key

Shell
Electron with sandbox, contextIsolation and no Node in the page; a custom app:// protocol instead of a local server.
Game
A web aim trainer: Vue 3 for menus, three.js for the 3D, a worker thread for the game loop. Served as shipped; renamed paths are patched at build time and checked by count.
Drills
JSON scenarios checked at build time; a Studio with a top-down editor and a 3D preview.
Languages
English and Vietnamese, three dictionaries (game menus, drills, shell), switched live without a reload.
Updates
Ed25519 over the manifest, SHA-256 over the zip, released by one command that also syncs the web copy.
Site
A Cloudflare Worker, release zips and big maps in R2 served with Range and ETag, COOP/COEP for the web copy.
Install
irm https://iterum.nhaajt.com/install.ps1 | iex downloads the zip, checks its SHA-256 and installs for the current user.
Design decisions

Choices, and what they cost

A protocol, not a port

Serving the game from app://iterum means no other program on the PC, no device on the network and no website in a browser has an address to send to, and it runs beside anything on port 8000.

Trade-off: every route the old service answered has to be answered in the main process.
Layers that don't depend on each other

Name resolution, the request filter, the CSP and the main-process networking each block on their own, so one mistake doesn't open the door.

Trade-off: every new feature that needs the outside, like a credit link, needs its own narrow exception.
Change around the bundle, never inside it

New UI arrives as CSS and scripts at load; the bundle stays byte for byte as shipped, so a fix never means hand-editing minified code.

Trade-off: scripts find the game's elements by their English labels, so translation has to keep textContent reading English.
Signatures over HTTPS

HTTPS proves the server; the signature proves the release. A key that never leaves the author's PC is the only thing an installed copy trusts.

Trade-off: lose the key and every copy must be reinstalled by hand once.
One build, two homes

The web copy is generated from the desktop build through the same handler, so the browser plays the same patched game.

Trade-off: features that need the disk (backups, updates, the shield) hide themselves on the web.
Hard problems

The parts that fought back

  • Proving a negative. “It doesn't connect” is only worth something with a test: the offline suite probes from the page, lists every request, and checks the process tree owns no listening socket and no UDP endpoint.
  • Pretending to be the server. The game still asks for drill lists, scenes, rankings and an account. The main process answers each the way the service did, so built-in and home-made drills get cards, results and history alike.
  • Translating a game you can't edit. Whole text nodes are swapped from dictionaries, CSS content becomes variables, and the bundle's vue-i18n is patched at three asserted anchors; during a round only the menus are touched.
  • Big maps on the web. The largest maps are over 25 MiB, so the site keeps them in R2 by content hash and serves them with ranges and a one-day cache.
  • Moving saved data from the old origin to app://iterum without losing a run: the old origin is answered by the app itself only while the move runs.
Limits

What it doesn’t do

  • Windows 10 and 11, 64-bit, about 2 GB of disk. The browser copy runs anywhere a modern browser does.
  • No online play, leaderboards or community workshop: those were removed with the network.
  • The game data includes third-party maps, weapons and sounds; Iterum is a personal project, not a commercial product.
  • The installer isn't signed, so Windows asks first (More info, then Run anyway).