Getting started
AURELITH runs before it is configured. Start the web app with no environment file and you get a working local-first workspace; add a Firebase project when you want cloud inference, authentication and sync.
1 · Run in local-first mode
No configuration is a supported state, not a broken one.
# Install workspace dependencies (pnpm)
pnpm install
# Develop the web app
pnpm dev
# Gates, in the order CI runs them
pnpm lint
pnpm typecheck
pnpm test
pnpm build
pnpm test:e2e # builds first, then runs next start on port 3211With empty NEXT_PUBLIC_FIREBASE_* values, /app renders a local demo banner that names the missing keys. Sign-in is disabled, records live in IndexedDB, and cloud inference fails with CLOUD_MODEL_UNAVAILABLE rather than inventing text.
The end-to-end suite serves the production build on port 3211. Run pnpm build before pnpm test:e2e if you invoke Playwright directly.
2 · Add Firebase
Create a web app in a Firebase project, then fill these values.
# Copy to apps/web/.env.local — values from .env.example
NEXT_PUBLIC_APP_URL=http://localhost:3000
NEXT_PUBLIC_FIREBASE_API_KEY=
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=
NEXT_PUBLIC_FIREBASE_PROJECT_ID=
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=
NEXT_PUBLIC_FIREBASE_APP_ID=
# Cloud inference (Firebase AI Logic)
NEXT_PUBLIC_FIREBASE_AI_MODEL=gemini-3.8-flash
NEXT_PUBLIC_FIREBASE_AI_LOCATION=us-central1
# App Check (optional at boot, required for production traffic)
NEXT_PUBLIC_RECAPTCHA_ENTERPRISE_SITE_KEY=Firebase reads env files inside the application directory, so the file lives at apps/web/.env.local. Restart the dev server after changing it.
3 · Deploy the backend
Functions, rules and indexes deploy together; the callables validate their configuration at boot.
# Backend: compile, then run the emulators (auth, firestore, storage, functions)
cd functions
npm run build
npm run serveThe functions config requires AURELITH_ENV and a project id. In production it also refuses to boot with App Check enforcement disabled. See the security posture for the full list of deployment controls.
4 · What to verify
| Check | Expected |
|---|---|
| Open /app with no Firebase | Local demo banner; no sign-in form is rendered. |
| Send a cloud-mode prompt with no backend | CLOUD_MODEL_UNAVAILABLE with a recovery step. |
| Open /onboarding | Six-step wizard; step and answers persist locally. |
| Sign in with Firebase configured | Session restored from Firebase Auth; workspace loads. |
| Call a protected route signed out | A sign-in gate that states what was not loaded. |
Where things live
- apps/web/src/app
- Routes. The (public) group carries marketing and documentation chrome; /app, /admin, /auth and /onboarding sit outside it.
- apps/web/src/lib/domain
- Zod schemas, the error taxonomy, the entitlement engine and the plan catalog.
- apps/web/src/lib/inference
- Capability probe, routing decision, local and cloud adapters.
- functions/src
- Callables and triggers, grouped by module. functions/src/lib/callable.ts is the single wrapper.
- docs/
- Engineering documentation: contracts, database shape, security model and performance notes.
- firestore.rules · storage.rules
- Deny-by-default policies evaluated on every client read and write.
Open the workspace
It runs without configuration; the banner tells you exactly what is missing when it does.