Backend Configuration
Backend configuration is managed through a.env file in the backend/ directory.
Required Settings
Comma-separated list of allowed CORS origins.
.env
The frontend URL must be included in this list for WebSocket connections to work.
Database Configuration
Required for auto-update functionality and site tracking.Your Supabase project URL.Get this from: Supabase Dashboard → Settings → API → Project URL
.env
Your Supabase anonymous/public key.Get this from: Supabase Dashboard → Settings → API → anon public
.env
Storage Configuration
Required for hosting generated llms.txt files on a public CDN.Cloudflare R2 endpoint URL.Format:
.env
https://<account-id>.r2.cloudflarestorage.comR2 access key ID.Generate from: Cloudflare Dashboard → R2 → Manage R2 API Tokens
.env
R2 secret access key.
.env
Name of the R2 bucket for storing llms.txt files.Create this bucket in the Cloudflare R2 dashboard before using.
.env
Public domain for accessing R2 files.Options:
.env
- Use R2’s public domain:
https://pub-<bucket-id>.r2.dev - Use a custom domain connected to R2
Brightdata Configuration
Optional proxy service for crawling JavaScript-heavy websites.Your Brightdata customer ID.Get this from: Brightdata Dashboard → Overview → Customer ID
.env
Zone password for your Brightdata zone.Get this from: Brightdata Dashboard → Zones → Zone Password
.env
Brightdata zone to use for crawling.Options:
.env
scraping_browser1- Standard scraping browser- Custom zones you’ve created
Global toggle for Brightdata usage.
.env
Individual requests can override this with the
useBrightdata parameter.LLM Enhancement Configuration
Optional AI-powered content optimization using OpenRouter.Enable LLM-powered content enhancement.
.env
OpenRouter model to use for enhancement.Options:
.env
x-ai/grok-4.1-fast:free- Grok 4.1 Fast (free tier)anthropic/claude-3-5-sonnet- Claude 3.5 Sonnetopenai/gpt-4-turbo- GPT-4 Turbo
Timeout for LLM API requests in seconds.
.env
Maximum retry attempts for failed LLM requests.
.env
Temperature parameter for LLM generation (0.0-1.0).
.env
- Lower values (0.1-0.3): More consistent, deterministic output
- Higher values (0.7-1.0): More creative, varied output
Security Configuration
API key for authenticating WebSocket connections.Generate a secure key:
.env
If not set, WebSocket connections will not require authentication. Only use this for development.
Secret token for authenticating cron job requests.Required for:
.env
/internal/cron/recrawl- Scheduled recrawl endpoint
Frontend Configuration
Frontend configuration is managed through a.env.local file in the frontend/ directory.
WebSocket URL for the backend API.
.env.local
Use
ws:// for local development and wss:// (secure WebSocket) for production.API key for authenticating with the backend (optional).
.env.local
Configuration File Reference
The backend uses Pydantic Settings for configuration management:config.py
Environment File Examples
Development Environment
Production Environment
Validation
Verify your configuration:Troubleshooting
CORS errors in browser console
CORS errors in browser console
Symptom:
WebSocket connection failed: CORS errorSolution:- Add your frontend URL to
CORS_ORIGINSin backend.env - Ensure URLs match exactly (including protocol and port)
- Restart the backend after changing
.env
Example
No hosted URL generated
No hosted URL generated
Symptom: Generated llms.txt shows but no public URLSolution:
- Verify all R2 configuration variables are set:
R2_ENDPOINTR2_ACCESS_KEYR2_SECRET_KEYR2_BUCKETR2_PUBLIC_DOMAIN
- Verify the bucket exists in Cloudflare R2
- Check bucket permissions allow public reads
Auto-update not working
Auto-update not working
Symptom: Sites not recrawling on scheduleSolution:
- Verify
SUPABASE_URLandSUPABASE_KEYare set - Check the
crawl_sitestable exists in Supabase - Verify AWS Lambda/cron job is configured
- Check
CRON_SECRETmatches between backend and Lambda
Brightdata crawls failing
Brightdata crawls failing
Symptom: “Failed to connect to Brightdata” errorsSolution:
- Verify
BRIGHTDATA_API_KEY(customer ID) is correct - Verify
BRIGHTDATA_PASSWORDmatches your zone password - Check
BRIGHTDATA_ZONEexists in your Brightdata account - Ensure you have credits/subscription active
LLM enhancement not working
LLM enhancement not working
Symptom: No enhancement despite enabling in UISolution:
- Set
LLM_ENHANCEMENT_ENABLED=truein backend.env - Verify
OPENROUTER_API_KEYis valid - Check OpenRouter account has credits
- Review backend logs for LLM errors
Best Practices
Use Environment Variables
Never hardcode secrets in source code. Always use environment variables.
Rotate Keys Regularly
Change API keys, tokens, and secrets periodically (every 90 days).
Separate Environments
Use different credentials for development, staging, and production.
Validate on Deploy
Test all endpoints after deployment to catch configuration issues early.
Next Steps
Web Interface
Learn how to use the web UI with your configuration
API Usage
Integrate programmatically using the WebSocket API
Deployment
Deploy to production with proper configuration
Development
Set up a local development environment