Skip to content

Local Development

This service has no mise.toml — everything runs through package.json scripts. Bun installs dependencies; Node (via tsx) runs the worker.

  • Bun — package manager.
  • A GITHUB_TOKEN with read:packages — to install @huddlesurety/api.
  • Railway accessbun run getenv pulls env vars from Railway.
  • A Resend API key and a reachable Temporal server (both supplied via env).
  1. Install dependencies:

    Terminal window
    bun install

    The private SDK is resolved from GitHub Packages via bunfig.toml, which reads your GITHUB_TOKEN.

  2. Pull environment variables:

    Terminal window
    bun run getenv # railway variables … > .env (env selected by .env.local)
  3. Build the workflow bundle (required before running the worker):

    Terminal window
    bun run build # tsx ./src/build.ts → dist/workflow-bundle.js
  4. Run the worker:

    Terminal window
    bun run worker # node --import tsx ./src/worker.ts
    # or, with Railway-injected env:
    bun run worker:dev # railway run … ./src/worker.ts

Iterate on templates in the browser with the React Email dev server:

Terminal window
bun run email # email dev --dir ./src/templates

Each template’s default example export is what renders — edit a template and the preview hot-reloads.

Script Command
build tsx ./src/build.ts (bundle workflows)
worker node --max-old-space-size=256 --import tsx ./src/worker.ts
worker:dev railway run … ./src/worker.ts
email email dev --dir ./src/templates
getenv railway variables … > .env

Pulled from Railway into .env; .env.local selects the environment. Required variables (typed in src/env.d.ts):

  • API: API_URL, API_AUTH_KEY
  • App: APP_URL (used to build links in emails)
  • Email: RESEND_API_KEY, MAIL_SENDER_EMAIL, MAIL_SENDER_NAME
  • Temporal: TEMPORAL_SERVER_URL, TEMPORAL_TASK_QUEUE_NOTIFICATION, DEPLOYMENT_ENVIRONMENT
  • OTel: OTEL_EXPORTER_OTLP_ENDPOINT (gates all telemetry — unset = the worker runs untraced)
  • Misc: ROOT_ORG_ID; GITHUB_TOKEN for installs

There are no tests and no in-repo CI; formatting is via Prettier.