Skip to content

01 — Create Project

Scaffold a new CruzJS project, tour the generated structure, and run the dev server.

Terminal window
npx create-cruz-app taskboard
cd taskboard

create-cruz-app creates a full monorepo with apps/web, packages/core (your app’s feature packages), and the Cruz CLI pre-installed.

Terminal window
cruz dev

Open http://localhost:5173. You’ll see the CruzJS welcome screen — a signup form backed by a real SQLite database running locally.

taskboard/
├── apps/
│ └── web/
│ ├── src/
│ │ ├── app.server.ts # Framework entry point
│ │ ├── database/
│ │ │ └── schema.ts # All your Drizzle table definitions
│ │ └── routes/ # React Router v7 routes
│ ├── wrangler.toml # Cloudflare Pages config
│ └── vite.config.ts
├── packages/
│ └── core/ # Your app's feature packages live here
├── package.json
└── cruz.config.ts # Deployment bindings (D1, KV, R2)

apps/web/src/app.server.ts — where you register modules and configure the framework.

import { createCruzApp } from '@cruzjs/core';
export default createCruzApp({
modules: [
// your feature modules go here
],
});

apps/web/src/database/schema.ts — one file for all your Drizzle table definitions. No separate migration files to create by hand; Cruz generates them.

apps/web/wrangler.toml — tells Cloudflare what D1 database, KV namespace, and R2 bucket to bind to your app in production.

  • A running CruzJS app with auth pre-configured
  • Understood the monorepo layout and key files

Next: Chapter 02 — Database Schema