Helpdear Docs Deploy free

Development

Run Helpdear locally, run the tests, and find your way around the code.

Run it locally

You need Node.js 24.

git clone https://github.com/onmyway133/helpdear.git
cd helpdear
npm install
cp .dev.vars.example .dev.vars    # set ENCRYPTION_KEY to any random string
npm run dev                       # http://localhost:5173
node scripts/seed.mjs             # optional: demo conversations, articles and ideas

npm run dev runs the Worker, the Durable Object and a local D1 database in workerd through Vite. The dashboard is at /admin, the public pages at /, and the widget at /widget.js.

To try the widget on another site, put the embed code from Settings → Websites in any HTML file and serve it from another port.

Check your work

npm run check    # TypeScript and the tests
npm run build    # the production build

Tests run the whole Worker against an in-memory SQLite database shaped like D1, with no mocks of the database.

Layout

FolderWhat's there
src/worker/The Worker: app.ts has the routes, index.ts the Cloudflare entry, services.ts reads bindings
src/worker/conversations/Conversations, messages, and what happens after people write (hooks.ts)
src/worker/visitors/Contacts, visitor tokens, page views and identity
src/worker/email/Sending, the outbox, notifications and inbound email
src/worker/realtime/The Durable Object that pushes live updates
src/worker/portal/The public help center, feedback, roadmap and changelog pages
src/worker/mcp/The MCP server
src/app/The dashboard (React)
src/widget/The chat widget's iframe app (React); public/widget.js is the loader
src/shared/Types and logic used by both sides
migrations/The database schema, applied by the Worker on the first request
test/Tests

Rules worth knowing

  • A schema change is a new file in migrations/ plus the same change in src/worker/db/schema.ts; test/schema.test.ts checks they match.
  • Route code reads bindings only through c.var.services.
  • Installs keep their own wrangler.jsonc when they update, so new code must work without a binding that's added later.