Loomis
Configuration

Convex

Creating the deployment, the difference between a development one and a production one, and the address the app needs.

Convex is the database, the functions, the accounts and the scheduled work. It is the one dependency that is not optional, and it is also the one where the setup is a single command.

Creating it

An account

convex.dev, free to start. The free tier is enough to run this product while you set it up, and the tier you end on depends on traffic rather than on features: nothing in this installation is held back behind a paid plan on Convex's side.

The development deployment

npx convex dev

The first run asks you to sign in through the browser, then asks whether to create a new project or use an existing one. Choose new, give it a name, and it creates a development deployment, pushes the schema and the functions, writes NEXT_PUBLIC_CONVEX_URL into .env.local, and stays running to watch for changes.

The address

The command prints two addresses, and the difference between them matters later:

AddressExampleWhat it serves
The deployment URLhttps://quick-fox-1234.convex.cloudQueries and mutations, the app's data path
The site URLhttps://quick-fox-1234.convex.siteHTTP routes, which is where /api/auth lives

The first administrator

npx convex env set ADMIN_EMAIL "you@your-domain.com"
npx convex env set ADMIN_PASSWORD "a long one"
npx convex run admin:bootstrap

The app

pnpm dev

With NEXT_PUBLIC_CONVEX_URL in place, the app serves. A blank page for a few seconds while the first compile finishes is normal.

Development and production are two places

This is the part worth reading twice. A development deployment and a production deployment are separate databases with separate environments and separate addresses. Trying a change against development and then pushing it to production is the intended workflow, and it is safe because production is not touched until you say so.

npx convex dev             # watch and push to development
npx convex deploy          # push schema and functions to production
npx convex env set N v --prod   # set a production name
npx convex env list --prod      # check which names production has

npx convex deploy needs a production deployment to have been created once in the Convex dashboard, under the same project. After that, the command is the whole deployment story on the backend side: there is no build step, no container and no server to restart.

The environment is not shared, and the data is not either

A name set on development does not exist on production, and a row written on production does not appear on development. So npx convex env set ADMIN_EMAIL ... without --prod configures the copy you are testing, not the one your users are on. This is the most common cause of "it works locally".

What the deployment holds

AreaExamples
SchemaAccounts, sessions, projects, files, threads, messages, credits, plans, settings
Queries and mutationsEverything the app reads and writes through the Convex client
ActionsCalls to other people's APIs: models, mail, payments, Git providers, MCP servers
HTTP routesThe authentication routes, at /api/auth on the site URL
Scheduled functionsCredit windows, retention, health pings, reminder mail
MigrationsBringing an older schema forward, run deliberately rather than on deploy
EnvironmentThe twelve names on the deployment page

Nothing runs on your machine except the app. There is no worker to keep alive, no queue to drain and no cron of yours to configure: the scheduled work is a function of the deployment.

The commands you will actually use

CommandWhen
npx convex devWhile you are changing anything under convex/
npx convex dev --onceOnce, and exit, for a script or a check
npx convex deployReleasing schema and functions to production
npx convex env set NAME valueSetting one name on development
npx convex env set NAME value --prodSetting one name on production
npx convex run admin:bootstrapCreating the first administrator
npx convex dashboardOpening the dashboard for this project
npx convex logsWatching the deployment's log, which is where an action's failure shows up

Reset the wrong deployment and you lose what is in it

The dashboard offers to clear a deployment's tables. Development is a fine place to do that. Production is not, and the panel's System → Backups & exports exists so that a snapshot is taken before anybody is tempted.