···44# Server configuration
55PORT=3000
6677+# Process type: all (everything), app (HTTP + Jetstream), or worker (sync jobs only)
88+# PROCESS_TYPE=all
99+710# Authentication service base URL
811AUTH_BASE_URL=http://localhost:8081
912
+36
api/CLAUDE.md
···3333 SYSTEM_SLICE_URI=at://did:plc:bcgltzqazw5tb6k2g3ttenbj/network.slices.slice/3lymhd4jhrd2z
3434 AUTH_BASE_URL=http://localhost:8081
3535 RELAY_ENDPOINT=https://relay1.us-west.bsky.network
3636+ PROCESS_TYPE=all # Optional: all (default), app, worker
3637 ```
3838+3939+### Process Types
4040+4141+The application supports running different components in separate processes for better resource isolation and scaling:
4242+4343+- `all` (default): Everything (HTTP API + Jetstream + sync workers)
4444+- `app`: HTTP API server + Jetstream real-time indexing
4545+- `worker`: Background sync job processing only
4646+4747+Set via `PROCESS_TYPE` environment variable (or `FLY_PROCESS_GROUP` on Fly.io).
37483849## Common Development Commands
3950···174185- **Auth System**: Uses dedicated auth cache for OAuth and AT Protocol session caching
175186- **Actor Resolution**: Caches DID resolution results to avoid repeated lookups
176187- **Automatic Fallback**: Redis failures automatically fall back to in-memory caching without errors
188188+189189+## Deployment
190190+191191+### Fly.io (Multi-Process Architecture)
192192+193193+The application is configured to run different components in separate process groups on Fly.io:
194194+195195+```toml
196196+[processes]
197197+ app = "app" # HTTP API + Jetstream
198198+ worker = "worker" # Sync job processing
199199+```
200200+201201+**Scale processes independently:**
202202+```bash
203203+# Scale app instances (HTTP + Jetstream)
204204+fly scale count app=2
205205+206206+# Scale sync workers (for heavy backfills)
207207+fly scale count worker=5
208208+209209+# Different VM sizes per workload
210210+fly scale vm shared-cpu-1x --process-group app
211211+fly scale vm shared-cpu-2x --process-group worker
212212+```