apps/api is the standalone Hono host for mobile/native clients and browser tRPC traffic. apps/worker runs asynchronous jobs on BullMQ.
| Item | Value |
|---|
| Path | apps/api |
| Local run | bun --filter api dev |
| Check | bun --filter api check-types |
| Owns | /api/auth/*, /api/trpc/*, selected image/upload routes, signed /api/webhooks/replicate/staging/* receiver |
| Primary packages | @repo/api, @repo/auth, @repo/database, @repo/server-services |
| Item | Value |
|---|
| Path | apps/worker |
| Local run | bun --filter worker dev |
| Check | bun --filter worker check-types |
| Owns | Search sync, lead ingestion/DLQ, alerts, AI jobs, Bull Board |
| Primary packages | @repo/database, @repo/cache, @repo/notifications, @repo/redis-search |
- API behavior usually belongs in
packages/api services and routers, not directly inside apps/api.
- Worker producers and consumers must use the same
QUEUE_SUFFIX in dev.
- GPT Image 2 staging uses the dedicated
ai-staging queue and PostgreSQL as its dispatch/provider-attempt source of truth. Keep REPLICATE_API_TOKEN on the worker and REPLICATE_WEBHOOK_SIGNING_SECRET on apps/api. Follow the staging rollout runbook before enabling paid predictions.
- Notification payloads must match
@repo/notifications translations and generated Knock docs.