Skip to main content

Prerequisites

Before starting, ensure you have:

Quick Start

1. Clone the Repository

2. Set Up Backend

3. Configure Environment

Edit backend/.env:

4. Start Backend Services

Option A: With Docker Compose (Recommended)
Option B: Without Docker

5. Set Up Frontend

Edit .env.local:

6. Start Frontend

Frontend available at: http://localhost:5173

Makefile Commands

The backend includes a Makefile for common tasks:

Development Workflow

API Development

  1. Make changes to backend/app/
  2. Server auto-reloads on file changes
  3. Test at http://localhost:8000/docs (Swagger UI)
  4. Run tests: make test

Frontend Development

  1. Make changes to risk-legion-frontend/src/
  2. Vite auto-reloads on file changes
  3. Test in browser at http://localhost:5173

Database Changes

  1. Make schema changes in Supabase Dashboard
  2. Update corresponding Pydantic models
  3. Test with real data

Testing

Backend Tests

Frontend Tests

Troubleshooting

  • Verify DATABASE_URL in .env
  • Check Supabase project is active
  • Ensure IP is whitelisted in Supabase
  • 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
  • Check ALLOWED_ORIGINS in backend config
  • Ensure frontend URL is included
  • Default: http://localhost:5173

IDE Setup

VS Code Extensions

Recommended extensions:

VS Code Settings