01 — Create Project
Chapter 01 — Create Project
Section titled “Chapter 01 — Create Project”Scaffold a new CruzJS project, tour the generated structure, and run the dev server.
Scaffold
Section titled “Scaffold”npx create-cruz-app taskboardcd taskboardcreate-cruz-app creates a full monorepo with apps/web, packages/core (your app’s feature packages), and the Cruz CLI pre-installed.
Start the dev server
Section titled “Start the dev server”cruz devOpen http://localhost:5173. You’ll see the CruzJS welcome screen — a signup form backed by a real SQLite database running locally.
Generated structure
Section titled “Generated structure”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)Key files to know
Section titled “Key files to know”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.
What we built
Section titled “What we built”- A running CruzJS app with auth pre-configured
- Understood the monorepo layout and key files