Environment File
LatentGEO uses a.env file in the project root for configuration. Start by copying the example file:
Critical Environment Variables
Database (Supabase)
LatentGEO uses Supabase Postgres with connection pooling:DB_POOL_PRE_PING=false is recommended when using Supabase’s pooler to avoid unnecessary overhead.Redis / Celery
Redis powers both the real-time SSE system and Celery task queue:Note that Celery uses different Redis databases (0 for broker, 1 for results) to isolate concerns.
Server-Sent Events (SSE)
Configure the real-time progress monitoring system:SSE_SOURCE: Primary event source (redisordb). Redis is recommended for performance.SSE_FALLBACK_DB_INTERVAL_SECONDS: How often to check the database if Redis has no events (seconds)SSE_HEARTBEAT_SECONDS: Keep-alive interval to maintain SSE connectionsSSE_RETRY_MS: Client retry delay after connection loss (milliseconds)
Frontend URLs
Configure API endpoints for both server-side and client-side requests:NEXT_PUBLIC_API_URLandNEXT_PUBLIC_BACKEND_URL: Used by browser for client-side API calls (points to localhost)API_URL: Used by Next.js server components for server-side API calls (points to Docker service name)
Execution Modes
LatentGEO supports two Docker Compose deployment modes:- Standard Mode
- Development Mode
Production-ready deployment with optimized builds.Characteristics:
- Backend and worker without code mounts
- Frontend in production mode (optimized build)
- Server-side
API_URL:http://backend:8000 - Browser
NEXT_PUBLIC_*:http://localhost:8000 - Runs in detached mode (
-d)
Real-time System
LatentGEO uses two complementary real-time mechanisms:- SSE (Server-Sent Events): Real-time progress updates for the audit dashboard UI
- Webhooks: External integrations for incoming/outgoing automations
Supabase Region Migration
If you need to migrate to a different Supabase region for better latency:Troubleshooting
High SSE Fallback Usage
High SSE Fallback Usage
If the SSE system frequently falls back to database polling:
- Check Redis connectivity and logs
- Verify
SSE_SOURCE=redisis set correctly - Review the frontend SSE proxy and hook implementation
- Check for Redis memory issues or eviction policies
High Database Latency
High Database Latency
If you experience slow database queries:
- Verify you’re using a Supabase region close to your deployment
- Confirm you’re using the pooler URL (contains
.pooler.supabase.com) - Check connection pool settings aren’t too restrictive
- Monitor Supabase dashboard for performance metrics
Connection Saturation
Connection Saturation
If you see database connection errors:
- Keep initial values:
DB_POOL_SIZE=5,DB_MAX_OVERFLOW=5 - Monitor actual connection usage before increasing
- Ensure
DB_POOL_PRE_PING=falsewith Supabase pooler - Check for connection leaks in application code
Validation
Verify your Docker Compose configuration before deploying:Next Steps
Quick Start
Launch LatentGEO with your configured environment
API Documentation
Explore the API after starting your services