Skip to content

Overview

Sadie is SaaS-primary and self-hostable. This page is the full self-host path in one view. Each step links to a dedicated page with detail and gotchas.

One deployment serves exactly one user. There is no multi-tenancy, no org layer, no login form. The first request bootstraps the owner account and sets a session cookie. That is the entire auth story.

your laptop Neon (or local pg) Cloudflare Pages
─────────── ──────────────────── ─────────────────
git clone ─────▶ DATABASE_URL ◀──── Next.js worker
(HTTP or pooled TCP) via OpenNext
optional: scripts/collab-server.mjs for Studio multiplayer

The app is a single Next.js 15 project at apps/app. The data layer is Drizzle over Postgres, with two drivers auto-selected by hostname (Neon HTTP for production, postgres-js pooled TCP for local dev).

Terminal window
git clone https://github.com/Miscreants/sadie.git
cd sadie
pnpm install

Sadie targets Node.js 20+ and pnpm 10.

Pick one.

  • Neon. The canonical production path. One pooled connection string, stateless HTTP driver, works on Cloudflare Pages without a connection pool to warm up.
  • Local Postgres. A one-liner Docker container. Fine for development and for self-hosters who already run their own Postgres.

SQLite is not supported. The schema uses pgTable, pgEnum, and jsonb.

Copy .env.example to .env.local and fill in the required keys:

Terminal window
cp .env.example .env.local

At minimum you need DATABASE_URL and, if deploying to production, SADIE_ENCRYPTION_KEY. See Environment variables for the full inventory. If you want real model responses in chat, add ANTHROPIC_API_KEY or OPENAI_API_KEY.

Terminal window
pnpm db:migrate

This applies every migration in packages/db/drizzle/ to the database in DATABASE_URL. See Migrations for the difference between db:migrate and db:push.

Terminal window
pnpm db:reset

Wipes and re-seeds with seven wiki entries, two briefs, eight sources, five feeds, three Studio docs, and so on. Skip this if you want to start empty and onboard from scratch.

Terminal window
pnpm dev # Next.js on :3000
pnpm dev:all # app + Yjs collab server + scheduler

Open http://localhost:3000. First request lands on /onboarding/frame. Walk the eight-step flow once to unlock the shell.

Terminal window
pnpm --filter @sadie/app build:cf
pnpm --filter @sadie/app deploy

Uses OpenNext to compile the Next.js app into a Cloudflare worker, then wrangler pages deploy pushes .open-next/assets. See Cloudflare Pages deploy for bindings, env vars, and the optional scheduler worker.

  • Your Neon project.
  • Your SADIE_ENCRYPTION_KEY (rotate and the user-supplied API keys at rest become unreadable).
  • The Cloudflare Pages project and any R2 buckets.
  • Your SADIE_CRON_SECRET if you run the compile and feed-refresh jobs on a schedule.