Skip to Content
⭐ CraftJS is open source. Star on GitHub →
DocsInstallation

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-app

Or 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-app

The CLI will guide you through the setup process and install all dependencies automatically.

CLI Options

The create-craft-app CLI supports the following options:

OptionDescription
[project-name]Name of the project (default: my-craft-app)
-y, --yesSkip all prompts and use defaults
--use-npmUse npm as the package manager
--use-yarnUse yarn as the package manager
--use-pnpmUse pnpm as the package manager (recommended)
--use-bunUse bun as the package manager

Interactive Mode

By default, the CLI runs in interactive mode and will prompt you for:

  1. Project name - What your project will be called
  2. Package manager - Choose between pnpm (recommended), npm, yarn, or bun
  3. 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-pnpm

This 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 .env

Open .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:push

Make sure your DATABASE_URL is correctly set in .env before running this command.

Start the Development Server

pnpm dev

Your 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:

  1. Landing Page - A beautiful landing page at /
  2. Auth Pages - Login (/login) and Register (/register) pages
  3. Dashboard - Protected dashboard at /dashboard (after signing in)

Available Scripts

CommandDescription
pnpm devStart development server with Turbopack
pnpm buildBuild for production
pnpm startStart production server
pnpm lintRun ESLint
pnpm formatFormat code with Prettier
pnpm format:checkCheck formatting
pnpm db:pushPush schema changes to database
pnpm db:studioOpen Drizzle Studio
pnpm db:generateGenerate migrations
pnpm db:migrateRun migrations

Next Steps

Now that you have CraftJS running, explore:

Having issues? Check our GitHub Issues  or join the Discussions .

Last updated on