Skip to content

Quick Start

Before proceeding, make sure you have a typescript project and access to a postgresql database.

You will need the database connection URL available as an environment variable called DB_URL. (You can configure the expected name in @/db/index.ts and drizzle.config.ts)

  1. Add the registry to your components.json

    components.json
    // ...
    "registries": {
    "@wunshot": "https://registry.wunshot.dev/{name}.json"
    }
  2. Use your preferred package manager with the shadcn cli

    Terminal window
    pnpm dlx shadcn@latest add @wunshot/init
  3. Install dev dependencies

    Terminal window
    pnpm add -D drizzle-kit @types/pg
  4. Add scripts to your package.json

    package.json
    {
    // ...
    "scripts": {
    // ...
    "db": "drizzle-kit --config ./src/db/drizzle.config.ts",
    "db:check": "pnpm run db -- check",
    "db:generate": "pnpm run db -- generate",
    "db:migrate": "pnpm run db -- migrate",
    "db:push": "pnpm run db -- push",
    "db:studio": "pnpm run db -- studio"
    }
    // ...
    }
  5. Generate and apply migrations

    Terminal window
    pnpm run db:generate && pnpm run db:migrate