Database Setup (PostgreSQL & Prisma)
LaunchKit Pro uses PostgreSQL with Prisma for schema management and migrations.
PostgreSQL setup
Create database and app user
Use placeholder values in docs — replace with your own secure password locally (never commit it).
CREATE USER launchkit_user WITH PASSWORD 'replace_with_secure_password';
CREATE DATABASE launchkit_app OWNER launchkit_user;
GRANT ALL PRIVILEGES ON DATABASE launchkit_app TO launchkit_user;Set DATABASE_URL in backend .env:
DATABASE_URL=postgresql://launchkit_user:replace_with_secure_password@127.0.0.1:5432/launchkit_appSchema ownership and permissions
The app user should own the database (or have sufficient privileges on the public schema). If migrations fail with access denied (P1010), grant schema access:
-- Connect to launchkit_app as superuser, then:
GRANT ALL ON SCHEMA public TO launchkit_user;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON TABLES TO launchkit_user;Without these grants, Prisma may not create or alter tables.
pgAdmin connection fields
When connecting in pgAdmin (or any SQL client), each field is separate:
| Field | Example placeholder | Notes |
|---|---|---|
| Host | 127.0.0.1 | Server address |
| Port | 5432 | Default PostgreSQL port |
| Database | launchkit_app | Database name — not your password |
| Username | launchkit_user | PostgreSQL role |
| Password | replace_with_secure_password | Role password |
WARNING
The database name (e.g. launchkit_app) is not the same as the password. Enter username and password in their own fields.
Prisma migration guidance
Buyers and production → migrate deploy
Apply shipped migrations to an empty or existing database:
cd launchkit-pro-backend # or backend/
npx prisma generate
npx prisma migrate deployUse this for: marketplace install, fresh RC test, staging, and production VPS.
Developers changing schema → migrate dev
When you modify prisma/schema.prisma and create new migrations locally:
npx prisma migrate devmigrate dev may create a temporary shadow database. If it fails with P3014, the DB user cannot create that shadow DB.
Fixes for developers:
- Grant
CREATEDBto the dev PostgreSQL user, or - Configure
shadowDatabaseUrlin Prisma, or - For install/testing only, use
migrate deployon a throwaway database instead
Buyers should not rely on migrate dev — always use migrate deploy.
Prisma commands reference
| Command | When to use |
|---|---|
npx prisma generate | After install or schema changes |
npx prisma migrate deploy | Buyer install, production, staging |
npx prisma migrate dev | Developers creating new migrations locally |
npx prisma studio | Visual DB browser (local only) |
npm run prisma:generate
npm run prisma:migrate:deployPrisma Studio
npm run prisma:studioOpens a local UI (default port 5555) to inspect users, workspaces, plans, and other tables.
WARNING
Do not expose Prisma Studio to the public internet.
Seed and default data
LaunchKit Pro does not ship a mandatory buyer seed script. On startup (when the database is configured):
- Default billing plans are upserted:
lite,pro,enterprise - Plan features and limits align with the feature-limits module defaults
You create your first user via register or direct SQL for admin promotion.
Default plans (reference)
| Code | Name | Typical limits (summary) |
|---|---|---|
lite | LaunchKit Lite | Baseline features; no API keys/webhooks |
pro | LaunchKit Pro | Full module set; moderate API key/webhook limits |
enterprise | LaunchKit Enterprise | Highest limits; advanced features |
Safe production notes
- Backups — schedule
pg_dumpbefore migrations - Migrations — use
prisma migrate deploy, notmigrate dev, in production - Credentials — inject
DATABASE_URLvia environment manager, not git - Least privilege — DB user should not be superuser in production
- Connection pooling — consider PgBouncer at scale
First admin user
After registering normally, promote to platform admin:
UPDATE "User" SET role = 'ADMIN' WHERE email = 'your-email@example.com';See Admin Panel for admin capabilities.
Troubleshooting
| Issue | Hint |
|---|---|
| Migration failed | PostgreSQL running? DATABASE_URL correct? |
| P1010 access denied | DB user owns DB / schema grants — see above |
| P3014 shadow database | Use migrate deploy for install; or grant CREATEDB for migrate dev |
| Client out of sync | Run npx prisma generate |
See Troubleshooting and Deployment Gotchas.