Skip to Content
hearloop

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

  1. Install dependencies and create the local settings file:

    bun install
    cp apps/web/.dev.vars.example apps/web/.dev.vars
  2. In apps/web/.dev.vars, set BETTER_AUTH_SECRET to the output of openssl rand -hex 32.

  3. 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

  1. Create the database:

    cd apps/web
    bunx wrangler d1 create hearloop-v2
  2. Copy the database ID that the command prints into apps/web/wrangler.jsonc.

  3. In the same file, set BETTER_AUTH_URL to your app's public URL. The MCP server uses this URL to sign agents in.

  4. Apply the migrations and set the secret:

    bun run db:migrate:remote
    bunx wrangler secret put BETTER_AUTH_SECRET
  5. 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/ui for the components and theme that both apps share.

On this page