Skip to main content

Prerequisites

  • Docker and Docker Compose (recommended)
  • Python 3.11+ (for local development without Docker)
  • Supabase account with project configured
  • Google API key for AI services
  • Stripe account for payment integration

1. Clone and Configure

git clone <repository-url>
cd conformly-core
cp env.example .env
Edit .env with your credentials — see Configuration for all available variables.

2. Start Services

docker compose up -d
This starts four containers: FastAPI backend (port 8000), Redis, Celery worker, and Celery Beat. The backend runs with --reload so code changes take effect immediately.

3. Verify

docker compose ps                    # Check all services are running
curl http://localhost:8000/health     # API health check
open http://localhost:8000/docs       # Interactive API docs

Local Python Installation (Alternative)

1. Clone and Set Up

git clone <repository-url>
cd conformly-core
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt

2. Configure Environment

cp env.example .env
At minimum, you need:
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_ANON_KEY=your-anon-key
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
GOOGLE_API_KEY=your-google-api-key
STRIPE_API_KEY=sk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...
ALLOWED_ORIGINS=http://localhost:5173,http://localhost:8080

3. Run

python run.py
The API will be available at http://localhost:8000.
Without Docker, you need Redis running separately for Celery background tasks. Set USE_CELERY=false if Redis is unavailable — analysis tasks will run in-process instead.

Supabase Setup

  1. Create a Supabase project
  2. Run the database schema from schema.sql in the Supabase SQL editor
  3. Verify the handle_new_user() trigger is active — it automatically creates a profile row when users sign up via Supabase Auth
  4. Configure Supabase email templates (optional, see email-templates/ directory for branded HTML templates)
  5. Update .env with your Supabase credentials

Stripe Setup

  1. Create a Stripe account and get your API keys
  2. Set STRIPE_API_KEY and STRIPE_WEBHOOK_SECRET in .env
  3. Configure STRIPE_SUCCESS_URL and STRIPE_CANCEL_URL for your environment
  4. Set up a webhook in Stripe dashboard pointing to POST /api/v1/payments/webhook

Verify Installation

# Health check
curl http://localhost:8000/health

# Interactive docs
open http://localhost:8000/docs

# Test auth (requires a valid Supabase JWT)
curl -H "Authorization: Bearer YOUR_JWT" http://localhost:8000/api/v1/auth/me

Next: Configuration

Learn about all configuration options