BunshipBunship
Integrations

Database and Data Model

What Bunship database includes out of the box and what you should customize first.

Bunship uses PostgreSQL + Drizzle. If you bought the template, this module is your source of truth for auth, billing, wallet, affiliate, AI, and CMS data.

What You Get Out of the Box

  • Domain schemas already split in packages/db/src/drizzle/schema/*
  • Versioned migrations in packages/db/drizzle/migrations
  • Seed scripts for product, affiliate, and AI model configs
  • Shared typed DB access used by both apps/ship and apps/ship-api

Where to Customize First

  1. Plan/product definitions and Stripe price references in seed data.
  2. Admin/business enums and status flows before any production migration.
  3. Indexes based on your actual query hotspots (orders, wallet, AI tasks).

Code Map

  • Schema: packages/db/src/drizzle/schema
  • Drizzle config: packages/db/drizzle.config.ts
  • Seed runner: packages/db/src/drizzle/seed/run.ts
  • DB package scripts: packages/db/package.json

Daily Commands

cd packages/db
bun run drizzle:generate
bun run drizzle:migrate
bun run seed

Use these selective seeds when needed:

bun run seed:product
bun run seed:ai-models

Launch Checklist

  1. DATABASE_URL points to your production PostgreSQL.
  2. Migrations are applied before app rollout.
  3. Seeded products/AI models match your real pricing strategy.
  4. Staging verification includes: signup -> pay -> credit grant -> admin audit.

Next Steps