Quickstart
From source archive to a real AI response.
Before you start
You need Node.js 24+, pnpm 11.25.0, an empty PostgreSQL database, and your own funded OpenRouter account for the first real AI task. Local PostgreSQL works for development; Neon PostgreSQL is the documented hosted target. Use a database you own, never the FoundryLayer demo database.
The archive includes the source, lockfile, migrations, tests, guides, and third-party notices. Verify its SHA-256 against the delivery receipt before extracting. No provider credentials, seed users, or product records are included.
Install and configure
cd your-extracted-release
pnpm install --frozen-lockfile
cp .env.example .env
openssl rand -base64 32
openssl rand -hex 32
Edit the root .env with the first random value as BETTER_AUTH_SECRET, the second as EMAIL_ENCRYPTION_KEY, and:
DATABASE_URL=postgresql://YOUR_USER:YOUR_PASSWORD@localhost:5432/YOUR_EMPTY_DATABASE
BETTER_AUTH_URL=http://localhost:3000
NEXT_PUBLIC_APP_NAME=Customer Brief
FOUNDRYLAYER_SITE_MODE=application
EMAIL_DELIVERY_MODE=capture
EMAIL_FROM=Customer Brief <onboarding@resend.dev>
OPENROUTER_API_KEY=YOUR_OWN_KEY
AI_DEFAULT_MODEL=openai/gpt-6-luna
These placeholders must be replaced. Do not copy a founder environment file. Do not put secrets in NEXT_PUBLIC_ variables. Keep .env out of Git. For Neon, use your own PostgreSQL URL with sslmode=verify-full.
pnpm db:migrate
pnpm db:migrate
pnpm dev
Repeating migrations must succeed without reapplying them. Do not use drizzle-kit push: committed migrations include SQL triggers the schema generator does not represent.
Authenticate and create a workspace
- Open
http://localhost:3000/sign-upand create your own account with a password of at least 12 characters. - Your personal workspace is provisioned transactionally. Sign in if needed.
- Open
/dev/mailwhile signed in, then open your verification link. This mailbox is development-only and shows only your own captured messages. - From the workspace switcher, create an organization, such as Customer Brief with slug
customer-brief. Return to the personal workspace for the first task below.
Email capture proves the local auth flow. It does not prove Resend delivery. Production requires a verified Resend sender and working delivery configuration.
Fund the first task
Free workspaces intentionally start with zero credits. No credits or provider spend are included in the source license. From the repository root, with the email you just verified:
pnpm credits:grant you@example.com 100 first-project "Initial development budget"
This operator-only command grants 100 ledger units to that account’s personal workspace in the database configured by .env. It requires a verified existing account, records the reason, and is idempotent for the same key and input. Reuse that key for retries; changing units or reason with the same key fails. This is a local application budget, not an OpenRouter top-up, subscription, or platform-admin grant.
For team workspace grants, use the existing persisted platform-admin flow described in configuration. Never expose operator commands through a public route.
Execute a real task
In the personal workspace, create a thread, select General, and ask:
Summarize these fictional customer notes into three next steps: onboarding takes too long, the pricing page is unclear, and our trial email is easy to miss.
Wait for the answer. Reload the page: the messages should persist. Turn on Developer Mode and confirm the completed run, OpenRouter model, token usage, and credit charge. Check Usage & billing for the resulting balance. Missing credentials, insufficient provider funds, protocol failures, or zero application credits are failures to fix, not successful demo output.
You now have an authenticated application with a persisted, metered AI task. Next, make it your product, follow the first-project walkthrough, then complete the deployment guide.
Validate your checkout
pnpm lint
pnpm typecheck
pnpm test
pnpm build
Builds and offline tests require no AI/integration credentials. Database integration checks need a separate, empty test database and .env.test; never aim tests at customer or production data. See the repository README for migration and integration-test commands.
FoundryLayer