Skip to content
SF.
fr
All work

AI & development · Personal project

Galactic Reigns

Migrating an entire backend with AI agents

Period
Since August 2025
Role
Design, development and operations, solo
Stack
NestJS · TypeScript · Prisma · PostgreSQL · Vue 3 · Pinia · Phaser · Tailwind 4 · WebSockets (soketi) · MinIO (S3) · Docker
Links
galactic-reigns.com
Galactic Reigns artwork: a warship orbiting a planet
24
business domains migrated
≈ 2,600
test cases
1,000+
commits

The project

Galactic Reigns is a free real-time space strategy MMO that I've been building solo since August 2025 (1,000+ commits). Players claim a homeworld, build an economy and send fleets across a procedurally generated universe; journeys keep going even when the tab is closed.

The game is in production, in an invite-only closed beta. NestJS / TypeScript backend in a modular clean architecture, Prisma and PostgreSQL; Vue 3, Pinia, Phaser and Tailwind 4 front end; real-time updates over WebSockets; S3 object storage.

Migrating the backend from Laravel to NestJS with AI agents

The first version of the backend was written in Laravel. I migrated it to NestJS with a chain of AI agents, under my supervision, one business domain at a time.

  1. 01

    Scout

    An agent reads the domain's PHP code and writes a specification.

  2. 02

    Port

    An agent ports the domain to TypeScript, layer by layer, with its tests.

  3. 03

    Verify

    Types, tests, architecture rules and conventions, with a bounded repair loop.

  4. 04

    Adversarial review

    Three angles: behaviour, module boundaries, fidelity to the original.

  5. 05

    Synthesis

    A summary, with gameplay decisions escalated to a human.

The old code as an oracle

Extractors read the PHP code and produce reference datasets (golden masters): planet taxonomy, game settings, building costs, research… The new code is tested against these references, which are never generated by the code they check.

Mechanics beat prompts

Instructions given to agents ("don't invent", "write independent tests") drift as soon as nothing enforces them. Automated barriers hold: types, dependency rules between layers, conventions that forbid non-deterministic calls outside adapters, golden masters. So every recurring agent mistake was turned into an automated check rather than another instruction.

The adversarial review is still essential: it catches about 8 divergences per domain on average that automated checks miss. And gameplay decisions stay human.

Outcome

The migration is complete: all 24 business domains of the game (fleets, combat, trade, alliances, territories…) run in production on the new backend, covered by around 2,600 test cases.

« Mechanics beat prompts. »
Galactic Reigns galaxy map
Galactic Reigns galaxy map

More work

Got a project in mind?

Describe what you need in a few lines: I'll get back to you with a first analysis and next steps.

Let's talk about your project