Run hearloop yourself
Run hearloop locally, or deploy it to your own Cloudflare account.
hearloop is two Cloudflare Workers: the app, which uses a D1 database, and these docs. Both live in one Bun monorepo.
Run it locally
-
Install dependencies and create the local settings file:
bun install cp apps/web/.dev.vars.example apps/web/.dev.vars -
In
apps/web/.dev.vars, setBETTER_AUTH_SECRETto the output ofopenssl rand -hex 32. -
Create the local database and start both apps:
bun run db:migrate bun run dev
The app runs at http://localhost:3000, and the docs run at http://localhost:3001.
Deploy to Cloudflare
-
Create the database:
cd apps/web bunx wrangler d1 create hearloop-v2 -
Copy the database ID that the command prints into
apps/web/wrangler.jsonc. -
In the same file, set
BETTER_AUTH_URLto your app's public URL. The MCP server uses this URL to sign agents in. -
Apply the migrations and set the secret:
bun run db:migrate:remote bunx wrangler secret put BETTER_AUTH_SECRET -
Deploy both Workers from the repository root:
bun run deploy:web bun run deploy:docs
What it's built with
- TanStack Start with React 19, running on Cloudflare Workers.
- D1, queried through Drizzle ORM.
- Better Auth for email sign-in and for MCP OAuth.
- TanStack Query, shadcn/ui, and Tailwind CSS v4.
- Fumadocs for these docs, in
apps/docs. packages/uifor the components and theme that both apps share.