In shortI built it and maintain it. Five Next.js sites talk to one server, and the hard part is not generation but keeping the sites out of each other's data. Contract tests check that.

An AI image and video generation service that runs on five separate sites. Each has its own domain, and there is one server behind all of them. Legally the service is not mine. I built it and maintain it, someone else operates it. That is why there are no domains or current brand names here.

Where it started

The first version was a mini app for VK and Telegram. I created the repo for that line on October 5, 2025. VKUI and a Telegram user context are still in the code from those days.

Early version: animate-a-photo screen with upload and generation settings

Early version, before the split into five sites. The current UI looks different.

Later the one product turned into five sites, each built around its own generation use case. On November 28, 2026 I restarted the history in a clean repo. Since then it has 46 commits and 13 PRs, 12 of them merged. The README notes that main matches what actually runs on the server, checked on November 28.

One server, five sites

The server is Express and PostgreSQL, 75 files and 24,468 lines in server/src. The frontends are Next.js 16 and React 19, all five on the same versions.

The server figures out which site a request belongs to from its domain. projectContext holds a “domain -> project key” map, and the key is then carried through AsyncLocalStorage. Any code further down the request knows its project without passing it as an argument through ten functions. There are six keys, one more than the number of sites: miniapps is left over from the mini app days.

The split of users and money lives in the database schema, not just in application code. users and user_identities have a project NOT NULL column, and uniqueness is on account + project. If someone signs in with the same VK account or the same phone number on two sites, the database sees two different users.

Payments go through CloudPayments and Robokassa.

What the tests check

The worst thing that could happen here is an admin of one site seeing users or payments of another. There is a dedicated contract test that checks the admin panel of one site cannot open another. The server has 14 contract tests in total. Besides the admin panel they cover auth on user routes, support split by project and the generation fallback. Some of them run through test:* npm scripts, the rest are run by hand with node.

Generation goes through several providers. There is a provider selection policy and a fallback for when the main one has trouble.

The weak spot: the web frontends have no test framework, and there is no CI at all.

Android client

Kotlin, Jetpack Compose, Material 3, 56 files and 12,068 lines. It is being prepared for RuStore and is not published yet.

Sign-in is Yandex ID following RFC 8252: Chrome Custom Tabs, PKCE with S256, no WebView. The token is stored encrypted with AES-256-GCM, the key sits in Android Keystore. Payments go through CloudPayments with a handoff to the bank via SBP, the Russian instant payment system. PKCE, JWT validation, OAuth callback parsing and price calculation have unit tests, 15 in the app overall.

Who wrote the code

Of the 46 commits in the new history, 33 are mine, 7 are from a second developer and 6 were made by the Codex agent. I work with AI agents, and here it shows right in the commit log.

All five sites returned 200 when I checked on December 4, 2026.