Orbit
01 · Getting started

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:

ORM
npm run prisma:migrate
ORM

That'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/.

ORM
Note
If you only changed the schema and want to refresh the generated client without creating a new migration, run npm run prisma:generate.

Starting over

ORM

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:

ORM
npm run db:seed --workspace @orbit/api

The 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.
Note

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:

ORM
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/api

Signing 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.com

Open that URL in a browser and you land inside the demo workspace, signed in as the owner.