web-app-starter
A production-ready base for web products that keeps getting updates, built for coding agents.


Every new product I start needs the same foundation before it can do anything useful: sign-in, accounts and security settings, an admin area, translations, an audit trail, tests, and a safe way to deploy. I built that foundation once, as a starting point for my own apps. In the first week I was already asking the question that shaped everything after it: when the template gets better, how does an app that was built from it get those improvements?
Most starter kits answer that with "copy it and you're on your own". After a few months the copy has drifted, and every security fix has to be found and applied by hand. I wanted the opposite. Builders should own their app completely and still receive platform updates for years, as reviewed pull requests that have already been tested against their own code.
The second thing I wanted was for coding agents to be able to work in it safely. Early on I set agents a task: work out how suitable this project is for agents to develop and test on their own, and what would make it better. Then I checked every item they came back with myself. Over time it became a product for other builders. The source is public, and production use needs a commercial licence.
- Stack
- Next.js, React, Convex, Better Auth, Bun, Turborepo, Tailwind, shadcn/ui
- Shape
- A platform that upgrades as a whole, around app code the builder owns
- For
- Builders who want a production-ready start and agents that stay inside the lines
- Licence
- Public source; a commercial licence for production use
- Built with
- Coding agents, with me as architect, reviewer and product owner
github.com/tkarakai/web-app-starter (opens in a new tab)
What a real product needs on day one
The reference app is a small software-as-a-service product: people sign up, choose a plan, work in organizations and share projects, tasks and files. It is deliberately ordinary, because builders copy it. Everything around it is the part that usually takes months to build.
- Accounts: email and password, passkeys, two-factor sign-in, session management, and deleting your own account after a grace period that the admin sets.
- Organizations: a personal one at sign-up, invitations and roles, and plans paid for by individuals or by billing organizations. An organization with members always has an owner who can act. That is enforced in the same transaction as every membership change, so banning the last active owner requires naming a successor first.
- An admin app for onboarding, users, organizations, plans, announcements and security policy. Administrators never see an organization's app data.
- An append-only audit trail. Writing to it never blocks the operation being recorded, and the acting user's identity is taken from the verified session rather than from the caller.
- Many languages, including Arabic and Hebrew with mirrored layouts and their own typefaces. The product name is never written into a message file.
- Deployments build each app once, attest it, and promote the same artifact from staging to production. Request-time settings are kept out of the build, so the artifact stays the same across environments.


The builder's app, the platform's code
The repository has an ownership line. Everything under platform/ belongs to the platform and is replaced whole on every upgrade. Everything else belongs to the app. Where the two meet, in a small set of seam files (the app configuration, the database schema, HTTP routes, translations, root scripts), the app adds its entries after the platform's hooks. A zone check in CI fails if anyone edits platform code without recording a patch, with its reason, that the upgrade tool can carry forward. It also fails if a seam has lost a platform hook.
Taking a release starts with a dry run that writes a plan and changes nothing. Applying it replaces the platform files, does a three-way merge on the seams, and runs the release's codemods. Each codemod is checked for idempotence, meaning a second run changes nothing. Then the app's whole test suite runs, including browser tests and an audit of the final lockfile. The app's recorded platform version moves forward only after every check passes. A scheduled workflow does this on its own: a clean upgrade arrives as a ready pull request. Anything that needs a person, such as a seam conflict, a new secret, a data migration or a security advisory, arrives as a draft with a checklist. New major versions are never applied automatically.
Version numbers are written as a promise to downstream apps. "Breaking" includes changes that compile but behave differently. Every release that asks something of an app lists who is affected, the exact command or edit, and the check that turns green when it is done. Those notes are written so a coding agent can carry them out, with no "adjust as needed".


Every release is rehearsed on someone else's app
Before a release I rehearse it in a private lab. Fixtures are real apps adopted from published releases, and one is heavily customized: it removes optional apps, keeps only some languages and adds its own billing code. The real upgrade tool runs against a disposable copy of each fixture. The lab then checks for itself that the app's own code and its choices survived. Release candidates are tagged only inside an isolated clone, so a rehearsal can never move a real tag.
Published tags are immutable, and they go only on commits that already passed the full CI run, browser tests included. If a release is wrong, a new version fixes it. While I was designing upgrades, I made the tooling prove itself on one of my own apps: if anything failed, fix the platform, cut a patch release, and upgrade again until the app was actually upgraded.
Built for coding agents
Agents read instructions in layers. The app's guide is for building the product. The platform's guide arrives with each release, so it always matches the installed code. Instructions for developing the platform itself live in a private maintainer workspace, so an agent working on a business app never confuses the two. Common tasks come as skills that ship inside the platform, such as adding a table, a page or translated strings, recording a patch, or taking an upgrade.
Those skills are tested. The lab gives each one to a headless agent in a freshly adopted app, keeps the full transcript, and checks the result independently. An agent's claim that it succeeded is never taken as proof. A separate experiment gives agents everyday tasks without naming any skill, before and after a change to the instructions, to see whether they find the right path on their own.
- Every branch and worktree gets its own local database and ports, so parallel agents never collide. Stopping services checks each process's recorded identity first, so it never kills something it didn't start.
- Agents work on task branches through pull requests. Adoption refuses to run on the default branch, and merging stays with a person.
- Backend refusals carry stable error codes, so an agent can tell an outdated organization selection from a missing permission.
- The admin app can expose its capabilities to agents through MCP, a command-line client, WebMCP and agent-to-agent tasks. Each one is off by default, requires consent and recent verification, and is audited like any other admin action.
How I built it
Agents wrote most of the code. I set the direction, reviewed designs line by line, tested the interface myself and made the calls. Some rules I kept repeating: never change behaviour just to upgrade a dependency; when tests are missing or wrong, add them first; a security fix needs a test that proves the issue is gone; dependency updates wait until they have been public for a while, with a short exception for security patches. For security reviews I asked agents to think like an attacker and to start from what an operator could be sued for.
Being willing to throw work away mattered as much. The first attempt at multi-tenancy grew slow and complicated. I noticed it in an unusually long migration, reverted all of it, wrote a postmortem, and restarted with a simpler brief: give every user an organization, and make it safe. That version is the one that shipped.