First migration + seed
Get a schema into your Postgres, then drop in just enough rows to log in and click around.
Run the first migration
The schema lives at apps/api/prisma/schema.prisma. With your DATABASE_URL set, apply every existing migration from the repo — or generate your first one, if you've touched the schema:
npm run prisma:migrateThat's a shortcut for prisma migrate dev inside apps/api. It creates the tables, regenerates the Prisma client, and — if you've edited the schema — prompts you for a migration name before writing it to apps/api/prisma/migrations/.
npm run prisma:generate.Starting over
npm run prisma:reset drops the whole database and re-runs every migration from zero. Useful when a dev dataset drifts, or you want to re-exercise the seed script. It's destructive and non-interactive — don't point it at anything shared.
Seed the demo workspace
Once migrations have run, seed a minimal workspace so you can sign in and click through the settings UI:
npm run db:seed --workspace @orbit/apiThe seed is idempotent — running it again does nothing. It creates:
- One demo user (email
owner@wereorbit.com, already email-verified). - One workspace with slug
demo. - Three system roles: OWNER, ADMIN, MEMBER — each seeded with the default permission set from
@orbit/shared/permissions. - One workspace member binding the demo user to the OWNER role.
That's it. No teams, no subscriptions, no invites, no waitlist entries. Features built on top of the kit should seed themselves from their own scripts instead of expanding this one.
Using your own email
Pass overrides as env vars to the same command — handy when you want magic links to actually land in your inbox:
SEED_OWNER_EMAIL=you@yourdomain.com \SEED_OWNER_NAME="Your Name" \SEED_WORKSPACE_SLUG=acme \SEED_WORKSPACE_NAME="Acme" \npm run db:seed --workspace @orbit/apiSigning in
Start the stack with npm run dev, open http://localhost:4001/login, and enter the seeded email. In dev without RESEND_API_KEY, the ConsoleMailer logs the magic-link URL to the API's stdout and also exposes it at:
GET http://localhost:4002/v1/dev/last-magic-link?email=owner@wereorbit.comOpen that URL in a browser and you land inside the demo workspace, signed in as the owner.