Quickstart
Clone the OPB Brain monorepo and get the applications running locally
Two things are needed to boot: Cloudflare D1 (local via Wrangler) and Clerk credentials. Everything else degrades on its own — each integration reads its own environment variables and skips itself when they are missing.
Clone and install
git clone https://github.com/reativatecnologia/opb-brain.git
cd opb-brain
bun installThe documentation site is not part of this workspace. It installs from its own directory:
cd docs && bun installSet up the database
Apply D1 migrations locally (Wrangler creates a local SQLite-backed D1 instance):
bun run migrateOptional: set DATABASE_URL in packages/database/.env only if you need Prisma CLI tooling
against a file SQLite database. Runtime apps use the DB binding, not a connection string.
Workspace and webhook receipts are the tables that exist today; the rest of
the domain model is still unbuilt.
Set up Clerk
Create an application at clerk.com and copy the publishable key and the secret
key from API Keys. Add both to apps/app/.env.local and apps/web/.env.local:
CLERK_SECRET_KEY="sk_test_REPLACE_ME"
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY="pk_test_REPLACE_ME"The NEXT_PUBLIC_CLERK_*_URL route values are already present in the .env.example files. Only
the two keys above need adding.
Start the applications
bun run dev| URL | Application |
|---|---|
| http://localhost:3000 | apps/app, the authenticated shell |
| http://localhost:3001 | apps/web, the marketing site |
| http://localhost:3002 | apps/api, webhooks and cron |
| http://localhost:3003 | apps/email, the email preview |
| http://localhost:3005 | apps/studio, Prisma Studio |
| http://localhost:6006 | apps/storybook |
This documentation site runs separately, on port 3004:
cd docs && bun run devChecks
The same commands that gate a pull request run locally:
bun run build # every workspace application
bun run test # workspace suites plus the repository-wide guards
bun run check # Ultracite, which wraps Biome
bun run design:lint -- . --baseline # every visual value against DESIGN.mdNext
- Environment variables — what each integration needs to switch on.
- Architecture — what is in the repository and where the unbuilt parts go.
- Concepts — the domain the product is being built toward.
- Deploying to Cloudflare — the Workers, their bindings and the deploy commands.