services:
  # Backend API Service
  - type: web
    name: randevu-backend
    env: python
    buildCommand: pip install -r backend/requirements.txt
    startCommand: uvicorn backend.server:app --host 0.0.0.0 --port $PORT
    envVars:
      - key: PORT
        value: 10000
      - key: DATABASE_URL
        sync: false
      - key: JWT_SECRET_KEY
        sync: false
      - key: ADMIN_USERNAME
        sync: false
      - key: ADMIN_PASSWORD
        sync: false
    healthCheckPath: /api/health

  # Frontend Static Site
  - type: web
    name: randevu-frontend
    env: static
    buildCommand: cd frontend && yarn install && yarn build
    staticPublishPath: ./frontend/build
    envVars:
      - key: REACT_APP_API_URL
        value: https://randevu-backend.onrender.com
