Local Development
This service has no mise.toml — everything runs through package.json
scripts. Bun installs dependencies; Node (via tsx) runs the worker.
Prerequisites
Section titled “Prerequisites”- Bun — package manager.
- A
GITHUB_TOKENwithread:packages— to install@huddlesurety/api. - Railway access —
bun run getenvpulls env vars from Railway. - A Resend API key and a reachable Temporal server (both supplied via env).
-
Install dependencies:
Terminal window bun installThe private SDK is resolved from GitHub Packages via
bunfig.toml, which reads yourGITHUB_TOKEN. -
Pull environment variables:
Terminal window bun run getenv # railway variables … > .env (env selected by .env.local) -
Build the workflow bundle (required before running the worker):
Terminal window bun run build # tsx ./src/build.ts → dist/workflow-bundle.js -
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
Previewing emails
Section titled “Previewing emails”Iterate on templates in the browser with the React Email dev server:
bun run email # email dev --dir ./src/templatesEach template’s default example export is what renders — edit a template and the preview hot-reloads.
Scripts
Section titled “Scripts”| 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 |
Environment
Section titled “Environment”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_TOKENfor installs
There are no tests and no in-repo CI; formatting is via Prettier.