Backend Configuration
The backend uses environment variables for API keys, database, and AWS configuration.Create Backend .env File
Create a.env file in the sprout-backend/ directory:
Required Environment Variables
Configuration Details
- Anthropic API
- AWS S3
- Database
- Server
ANTHROPIC_API_KEY (Required)The backend uses Claude for seven autonomous agents:
- Topic Agent
- Subconcept Bootstrap Agent
- Concept Refinement Agent
- Tutor Chat Agent
- Grade Answers Agent
- Generate Diagnostic Agent
- Review Learning Path Agent
Frontend Configuration
The frontend uses environment variables to connect to the backend and configure feature flags.Create Frontend .env.local File
Create a.env.local file in the sprout-frontend/ directory:
Required Environment Variables
Configuration Details
- Backend Origin
- Proxy Prefix
- Agent Mode
NEXT_PUBLIC_BACKEND_ORIGIN (Required)The URL where your Express backend is running. Used for Server-Sent Events (SSE) streaming.
The frontend bypasses the Next.js proxy for SSE connections and connects directly to this origin.
Hand Tracking Configuration
The Python hand tracking service runs on a fixed port and connects via WebSocket.Default Configuration
| Setting | Value | Notes |
|---|---|---|
| Port | 8765 | Avoids conflict with Node.js backend (8000) |
| Protocol | WebSocket | ws://localhost:8765 |
| Camera Index | 0 | Default webcam |
| Frame Rate | 60 fps | Capped to prevent queue buildup |
| Model Complexity | 0 | Lightest/fastest MediaPipe model |
Customizing Hand Tracking
Editbackend.py to customize settings:
Configuration Validation
Verify your configuration is correct:Common Issues
Missing ANTHROPIC_API_KEY error
Missing ANTHROPIC_API_KEY error
The backend will fail to start or agent routes will return 500 errors.Solution: Add your Anthropic API key to
.env:Document uploads fail with S3 error
Document uploads fail with S3 error
AWS credentials are missing or incorrect.Solution: Verify your AWS credentials and bucket name:Test with AWS CLI:
Frontend can't connect to backend
Frontend can't connect to backend
CORS error or connection refused.Solution: Check that:
- Backend is running on the correct port
NEXT_PUBLIC_BACKEND_ORIGINmatches the backend URL- Backend has CORS enabled (enabled by default in
src/index.ts)
Next Steps
Running Locally
Start all three services in development mode
Database Migrations
Initialize the SQLite database schema