Prerequisites
Before starting, ensure you have:| Tool | Version | Purpose |
|---|---|---|
| Node.js | 18+ | Frontend development |
| Python | 3.11+ | Backend development |
| Docker | 24+ | Container runtime |
| Git | Latest | Version control |
Quick Start
1. Clone the Repository
2. Set Up Backend
3. Configure Environment
Editbackend/.env:
4. Start Backend Services
Option A: With Docker Compose (Recommended)5. Set Up Frontend
.env.local:
6. Start Frontend
http://localhost:5173
Makefile Commands
The backend includes a Makefile for common tasks:Development Workflow
API Development
- Make changes to
backend/app/ - Server auto-reloads on file changes
- Test at
http://localhost:8000/docs(Swagger UI) - Run tests:
make test
Frontend Development
- Make changes to
risk-legion-frontend/src/ - Vite auto-reloads on file changes
- Test in browser at
http://localhost:5173
Database Changes
- Make schema changes in Supabase Dashboard
- Update corresponding Pydantic models
- Test with real data
Testing
Backend Tests
Frontend Tests
Troubleshooting
Port already in use
Port already in use
Database connection failed
Database connection failed
- Verify
DATABASE_URLin.env - Check Supabase project is active
- Ensure IP is whitelisted in Supabase
Redis connection failed
Redis connection failed
- Redis is optional for local dev
- System falls back to in-memory storage
- To use Redis:
docker run -d -p 6379:6379 redis:7-alpine
CORS errors
CORS errors
- Check
ALLOWED_ORIGINSin backend config - Ensure frontend URL is included
- Default:
http://localhost:5173