How dnmitev/hire-wire works
hire-wire is an invoicing service: a person creates an invoice over HTTP, approves or rejects it, and retrieves its status; a Temporal workflow coordinates the decision and, on approval, payment. Postgres stores invoices, while worker activities perform conditional status changes and charge through a fake idempotent gateway. The README documents list, health, and payment-decline behavior. Edges reflect the excerpts and README; migration-to-schema wiring is documented only at the package level, so the SQL schema is shown without an asserted runner edge.
Main entry points: invoices.ts Invoice routes · app.ts API app · activities.ts Invoice activities · worker.ts Worker runtime
Components 15
HTTP API
- API app
apps/api/src/app.ts - Invoice routes
apps/api/src/routes/invoices.ts - API server
apps/api/src/server.ts
Workflow orchestration
- Workflow definitions
packages/workflows/src/definitions.ts - Invoice lifecycle
packages/workflows/src/workflows.ts
Worker and payments
- Worker runtime
apps/worker/src/worker.ts - Invoice activities
apps/worker/src/activities.ts - Fake payment gateway
apps/worker/src/payment-gateway.ts
Persistence
- Invoice repository
packages/db/src/invoices.ts - Postgres pool
packages/db/src/pool.ts - Migration runner
packages/db/src/migrate.ts - Invoice schema
packages/db/migrations/001_invoices.sql
Other components
- Invoice user
- Temporal service
- Postgres
Connections 17
- Invoice user → API app: sends requests
README.md - API server → API app: builds
apps/api/src/server.ts - API app → Invoice routes: registers
apps/api/src/app.ts - API app → Postgres: checks health
apps/api/src/app.ts - Invoice routes → Invoice repository: reads and writes
apps/api/src/routes/invoices.ts - Invoice routes → Temporal service: starts and updates
apps/api/src/routes/invoices.ts - Invoice routes → Workflow definitions: uses update definitions
apps/api/src/routes/invoices.ts - Invoice lifecycle → Workflow definitions: registers handlers
packages/workflows/src/workflows.ts - Invoice lifecycle → Invoice activities: dispatches activities
packages/workflows/src/workflows.ts - Worker runtime → Temporal service: runs worker
apps/worker/src/worker.ts - Worker runtime → Invoice activities: registers activities
apps/worker/src/worker.ts - Worker runtime → Fake payment gateway: creates gateway
apps/worker/src/worker.ts - Invoice activities → Invoice repository: changes invoice status
apps/worker/src/activities.ts - Invoice activities → Fake payment gateway: charges invoice
apps/worker/src/activities.ts - Invoice repository → Postgres: queries and updates
packages/db/src/invoices.ts - Postgres pool → Postgres: creates connection pool
packages/db/src/pool.ts - Migration runner → Postgres pool: uses pool
packages/db/src/migrate.ts