CHAPTER 02

Getting Started

Node 22+, npm, and either the monorepo example or a fresh site from aftercare init.

01

Try the Example

Monorepo
npm install
npm run watch:example
# second terminal:
npm run serve:example

Open http://localhost:4173. Watch monitors examples/studio — sync, validate, and rebuild on change.

npm run sync:example
npm run validate:example
npm run doctor:example
npm run build:example
02

New Site

Scaffold
npx aftercare init my-site
cd my-site
npm install

init copies the studio starter (theme, sample content, config).

Developer loop

npx aftercare watch
# other terminal:
npx aftercare serve

Site-owner loop

npx aftercare validate
npx aftercare build
npx aftercare serve
03

Layout

Site Tree
my-site/
  aftercare.config.ts
  content/
    site.toon
    pages/
  theme/
    index.tsx
    Layout.tsx
    styles.css
    components/
    sections/
  public/
  dist/                 # build output
  AGENTS.md             # generated
  agent/                # generated
  .cursor/skills/       # generated
04

Config

Defaults
export default {
  contentDir: "content",
  themeDir: "theme",
  publicDir: "public",
  outDir: "dist",
  // basePath: "/my-repo",
};

Also accepted: aftercare.config.mjs or .js.

05

Health

Before Handoff
npx aftercare doctor
npx aftercare doctor --json --write

Use --json --write to emit agent/doctor.json for tooling.