apps/api/README.md
The API requires the following environment variables:
# Local development (Docker):
REDIS_URL=redis://localhost:6379
REDIS_QUEUE_URL=redis://localhost:6379
# Production:
# REDIS_URL=rediss://:[email protected]:6379 (Upstash - multi-region cache)
# REDIS_QUEUE_URL=redis://...railway.internal:6379 (Railway Redis - queue)
Start Redis with Docker:
docker run -d --name redis -p 6379:6379 redis:alpine
Set environment variable:
export REDIS_URL=redis://localhost:6379
DATABASE_PRIMARY_URL=postgresql://...
DATABASE_FRA_URL=postgresql://... # EU replica
DATABASE_IAD_URL=postgresql://... # US East replica
DATABASE_SJC_URL=postgresql://... # US West replica
bun dev
bun start
The API uses Redis for distributed caching across multiple server instances:
The Redis client automatically configures itself based on the environment:
Production (Railway):
Development (Local):
This ensures cache consistency across multiple stateful servers and eliminates the "No procedure found" TRPC errors caused by cache misses.