Prerequisites
- Node.js 20 or later
- pnpm — install via
corepack enable && corepack prepare pnpm@latest --activate - A Turso account — sign up for free and create a database
Installation
npx create-codapult my-app
cd my-app
pnpm install
This scaffolds a fresh Codapult project with all modules included.
Configuration
Copy the example environment file and fill in the required values:
cp .env.example .env.local
At minimum, set these four variables:
| Variable | Value |
| --------------------- | ------------------------------------------------------------ |
| TURSO_DATABASE_URL | Your Turso database URL (e.g. libsql://my-db-org.turso.io) |
| TURSO_AUTH_TOKEN | Turso auth token from the dashboard |
| BETTER_AUTH_SECRET | Generate with openssl rand -base64 32 |
| NEXT_PUBLIC_APP_URL | http://localhost:3000 for local development |
All other variables are optional and documented in .env.example.
Database Setup
Push the schema to your Turso database — this creates all tables in one step:
pnpm db:push
Optionally seed sample data (users, organizations, plans) for local testing:
pnpm db:seed
Start the Dev Server
pnpm dev
Open http://localhost:3000. You should see the Codapult landing page. Click Sign Up to create your first account.
Interactive Setup Wizard
Run the setup wizard to choose which modules to keep. It removes unused code, routes, and database tables cleanly:
npx @codapult/cli setup
The wizard walks you through each optional module (AI chat, blog, teams, notifications, etc.) and strips out anything you don't need.
Useful Commands
| Command | Description |
| ------------------------- | ------------------------------- |
| pnpm dev | Start dev server (Turbopack) |
| pnpm build | Production build |
| pnpm lint | Run ESLint |
| pnpm format | Format with Prettier |
| pnpm test | Run Vitest unit tests |
| pnpm test:e2e | Run Playwright E2E tests |
| pnpm db:generate | Generate Drizzle migration |
| pnpm db:push | Push schema to database |
| pnpm db:seed | Seed sample data |
| npx @codapult/cli setup | Interactive module setup wizard |
Next Steps
- Project Structure — understand the directory layout and config files
- Authentication — configure sign-in methods, 2FA, and SSO
- Plans & Pricing — set up subscription tiers and billing
- Customization — theming, branding, and white-label options