Skip to Content

Deploy an app

Deploy runs check on the project, then puts the app’s UI and API live on <id>.manh.run together. Writing files never deploys the app.

The running app changes only when someone deploys, so the app’s users never see a half-written version. While the agent edits files, you watch the draft in the preview inside the dashboard.

Two ways to deploy

Both run the same steps:

  • Ask the agent, for example: “Run check, then deploy the Purchase Approval app.” The agent calls the deploy tool.
  • Click Deploy at the top of the project page in the dashboard. Every section of the project has it.

What deploy does

On every deploy manh.run runs these steps in order:

  1. Runs check with all four layers, type checking included. Any error refuses the deploy and returns the list for the agent to fix. The running app stays as it was.
  2. Builds the UI: every .tsx file is compiled to static files. Public pages get pre-rendered HTML carrying that page’s export const meta (title, description, link preview image).
  3. Bundles the backend: handlers, middleware, cron, jobs, tables, repositories and the files they import become one bundle.
  4. Applies the schema from the *.table.ts files to the app’s own SQLite database.
  5. Puts the UI and API live together, updates the scheduled jobs (cron) and waits until the new version answers. The next request already sees it.

A deploy usually takes 3–10 seconds, the first one longer. A UI compile error or a backend bundle error fails the deploy with file:line before anything changes on the live app.

Only type (TypeScript) errors can be overridden: the agent calls deploy with force: true and a reason saying why the error can’t break the app. Syntax, banned-pattern and contract errors can’t be overridden. See Check rules.

A file tree that has deployed successfully before skips check. That way restoring an old checkpoint and deploying it always works, even after check gained new rules. See Rollback and checkpoints.

Tests after every deploy

When the agent deploys, manh.run runs tests on a test copy of the app (same code, its own database, live data untouched) and returns the results in the deploy reply:

  • With spec/acceptance.json, it runs the tests the agent wrote.
  • Without it, it runs basic tests manh.run builds from the files: each role opens the home page, the other pages open, every list answers 200 or 403, never 500.

Tests run for about 30 seconds at most; whatever didn’t fit is reported as not run. A failing test doesn’t stop the app going live, but the reply says the app isn’t ready for handover, and the agent should fix it and deploy again.

The app’s address

The app runs at <id>.manh.run, where <id> is the project’s id, for example k7xq2mfp9dhw. manh.run assigns it when the project is created and it never changes. For an address people remember, add a custom domain. The UI is at / and the API at /api/* on the same address, so UI and API always belong to the same version.

k7xq2mfp9dhw.manh.run/ → UI (pages /, /requests, …) k7xq2mfp9dhw.manh.run/api/requests → the app's API

Before the first deploy only you can see the draft, in the dashboard. Anyone else opening this address gets a “not published” page, and the API answers 503. To show users your company’s domain, see Custom domain.

Every deployed app also gets: a favicon.svg in the brand color, a sitemap.xml and robots.txt listing the public pages that have meta, and a real 404 for paths no page matches.

The database on deploy

Each app has its own SQLite database. Deploy only adds, never removes:

  • New tables and columns in *.table.ts are added.
  • Tables or columns removed from code stay in the database; columns are never retyped.
  • A new NOT NULL column without a default is added as nullable, and the deploy notes say so.
  • Renaming a column: add the new one, copy the data over with db_exec, stop using the old one.
  • The first deploy loads spec/sample-data.json (if present) into empty tables. The Database section has a button that removes sample rows nobody changed.

Secrets and configuration

Secrets (API keys of outside services, tokens) go in the Secrets section of the project sidebar, or through the env_set tool. Backend code reads them as env.NAME from manh/env. A new secret takes effect at once: the running app restarts with the new value, no deploy needed.

manh.run sets the app’s MANH_APP_URL and JWT_SECRET (created on the first deploy). Deploys and rollbacks always take secrets and the domain from the current settings, never from the old version.

The “Made with manh.run” label

Apps on the Free plan show a small “Made with manh.run” label in the bottom-left corner that links to manh.run. Builder and Agency apps don’t have it.

Good to know

  • manh.run doesn’t back up the database. Rolling back changes code, not data, so export important tables to CSV before a big change.
  • Deploy never drops columns or tables. Cleaning up old data is up to you, after you’ve read the rows it would touch.
  • When a paid plan expires and the 7-day grace period passes, the account returns to Free. The app keeps running, but the custom domain is paused and the app shows the manh.run label.

Next steps

Last updated