Installation
This guide will help you set up CraftJS and get your AI app running in minutes.
Prerequisites
Before you begin, make sure you have the following installed:
- Node.js 20+ - Download
- pnpm 9+ - Install with
npm install -g pnpm - PostgreSQL database - We recommend Neon for serverless PostgreSQL
CraftJS uses pnpm as the package manager for its faster installation and disk space efficiency.
Installation Steps
Create a New Project
Use the CLI to create a new CraftJS application:
npx create-craft-app my-ai-appOr with other package managers:
# With pnpm
pnpm create craft-app my-ai-app
# With yarn
yarn create craft-app my-ai-app
# With bun
bunx create-craft-app my-ai-appThe CLI will guide you through the setup process and install all dependencies automatically.
CLI Options
The create-craft-app CLI supports the following options:
| Option | Description |
|---|---|
[project-name] | Name of the project (default: my-craft-app) |
-y, --yes | Skip all prompts and use defaults |
--use-npm | Use npm as the package manager |
--use-yarn | Use yarn as the package manager |
--use-pnpm | Use pnpm as the package manager (recommended) |
--use-bun | Use bun as the package manager |
Interactive Mode
By default, the CLI runs in interactive mode and will prompt you for:
- Project name - What your project will be called
- Package manager - Choose between pnpm (recommended), npm, yarn, or bun
- Confirmation - Review your choices before creating the project
Non-Interactive Mode
Use the -y or --yes flag to skip all prompts:
npx create-craft-app my-app -y --use-pnpmThis will install all required dependencies including:
- Next.js 16
- Tailwind CSS v4
- shadcn/ui components
- Better Auth
- Drizzle ORM
- Vercel AI SDK 6
- And more…
Configure Environment Variables
Copy the example environment file:
cp .env.example .envOpen .env and fill in your values. See the Configuration page for detailed instructions on each variable.
Set Up the Database
Push the database schema to your PostgreSQL database:
pnpm db:pushMake sure your DATABASE_URL is correctly set in .env before running this
command.
Start the Development Server
pnpm devYour app will be running at http://localhost:3000 .
Quick Setup with Neon
If you don’t have a PostgreSQL database yet, here’s how to set one up with Neon:
Create a Neon Account
Go to neon.tech and sign up for a free account.
Create a New Project
Click “New Project” and give it a name (e.g., “my-ai-app”).
Copy the Connection String
In your project dashboard, find the connection string and copy it.
Update Your Environment
Add the connection string to your .env file:
DATABASE_URL="postgresql://username:password@ep-xxx.region.aws.neon.tech/dbname?sslmode=require"Verifying Installation
After starting the development server, you should see:
- Landing Page - A beautiful landing page at
/ - Auth Pages - Login (
/login) and Register (/register) pages - Dashboard - Protected dashboard at
/dashboard(after signing in)
Available Scripts
| Command | Description |
|---|---|
pnpm dev | Start development server with Turbopack |
pnpm build | Build for production |
pnpm start | Start production server |
pnpm lint | Run ESLint |
pnpm format | Format code with Prettier |
pnpm format:check | Check formatting |
pnpm db:push | Push schema changes to database |
pnpm db:studio | Open Drizzle Studio |
pnpm db:generate | Generate migrations |
pnpm db:migrate | Run migrations |
Next Steps
Now that you have CraftJS running, explore:
- Project Structure - Understand how the codebase is organized
- Configuration - Set up all environment variables
- Authentication - Configure auth providers
- AI Integration - Start building with AI
Having issues? Check our GitHub Issues or join the Discussions .