Add PostgreSQL-backed background worker

This commit is contained in:
2026-08-17 01:02:44 -04:00
parent 9929d7321d
commit 24a1307a96
22 changed files with 629 additions and 120 deletions
+5 -3
View File
@@ -8,7 +8,8 @@ Beenvoice is a freelancer and small-business invoicing platform with a Next.js w
beenvoice/
├── apps/
│ ├── web/ # Next.js dashboard, tRPC API, PostgreSQL/Drizzle
── mobile/ # Expo Router mobile app and iOS widgets
── mobile/ # Expo Router mobile app and iOS widgets
│ └── worker/ # PostgreSQL-backed scheduler and background jobs
├── packages/
│ └── domain/ # Platform-neutral shared rules and parsing
├── Dockerfile
@@ -32,7 +33,7 @@ bun run --filter @beenvoice/web db:push
bun run dev
```
`bun run dev` starts Next.js on port 3000 and Expo Metro on port 8082. For a physical iPhone, set `EXPO_PUBLIC_API_URL` in `apps/mobile/.env` to a host the device can reach and configure the web app's canonical/auth URLs consistently.
`bun run dev` starts Next.js on port 3000, Expo Metro on port 8082, and the background worker. For a physical iPhone, set `EXPO_PUBLIC_API_URL` in `apps/mobile/.env` to a host the device can reach and configure the web app's canonical/auth URLs consistently.
Useful workspace commands:
@@ -61,7 +62,7 @@ git pull
./scripts/docker-deploy.sh
```
The root Dockerfile installs the frozen Bun workspace lockfile, builds the Next.js app under Node, and runs migrations plus the web server under Bun.
The root Dockerfile installs the frozen Bun workspace lockfile and exposes separate `final` (web) and `worker` targets. The Compose stack starts both; the web container runs migrations before serving requests and the worker tolerates that short startup race.
## Documentation
@@ -69,6 +70,7 @@ The root Dockerfile installs the frozen Bun workspace lockfile, builds the Next.
- [Web architecture](./apps/web/docs/ARCHITECTURE.md)
- [Mobile setup](./apps/mobile/README.md)
- [Mobile architecture](./apps/mobile/docs/ARCHITECTURE.md)
- [Worker architecture](./apps/worker/README.md)
- [Shared domain package](./packages/domain/README.md)
## Product concepts