GuidesDeployment

Deployment Guide

How Surviva Health services are deployed across environments.

Environments

EnvironmentFrontendBackendDatabase
Productionapp.suriva.health (Vercel)api.suriva.health (Fly.io)Supabase (eu-west-1)
Stagingstaging.suriva.health (Vercel)api-staging.suriva.health (Fly.io)Supabase staging
Locallocalhost:3000 (Next.js dev)localhost:8000 (Uvicorn)Local or remote Supabase

Frontend (Vercel)

The Next.js frontend auto-deploys on push to main. Preview deploys are created for every pull request.

cd frontend && npm install && npm run dev
npm run typecheck
npm run build

Environment Variables

VariableDescription
NEXT_PUBLIC_SUPABASE_URLSupabase project URL
NEXT_PUBLIC_SUPABASE_ANON_KEYSupabase anon key (public)
NEXT_PUBLIC_API_URLBackend API base URL

Backend (Fly.io)

The FastAPI backend runs on Fly.io in the EU West region. All health data processing happens within the EU to comply with GDPR.

cd backend && python -m uvicorn app.main:app --reload --port 8000
python -m pytest tests/ --ignore=tests/integration -v --tb=short
python -m pytest tests/integration/ -v --tb=short

Backend Environment Variables

VariableDescription
SUPABASE_URLSupabase project URL
SUPABASE_SERVICE_KEYSupabase service role key (server only)
KENNIS_PLATFORM_URLKennis OS Platform API URL for KORA integration
KENNIS_PRODUCT_CODEsuriva

Health Check

GET /api/health

Returns 200 OK with service version and dependency status.

Database (Supabase)

Migrations live in backend/supabase/migrations/:

supabase db push
supabase migration new description_of_change

Migration Rules

  1. Every CREATE TABLE includes RLS enablement in the same migration
  2. Every migration includes rollback SQL as a trailing comment block
  3. Health data tables are classified Tier 3 (Confidential) and require stricter RLS

Data Residency

All Supabase infrastructure runs in EU West 1 (Ireland). User health data never leaves the EU region. This applies to the database, storage buckets, and edge functions.

KORA Integration

Surviva connects to the KORA AI assistant via the Kennis OS Platform API. See Platform Integration for the full request contract including required headers and the KOS-GUARD-HEALTH-001 guardrail.

CI/CD Pipeline

WorkflowTriggerWhat It Does
ci.ymlPush to any branchLint, type check, unit tests
backend-ci.ymlPush to backend/Python lint, mypy, pytest
frontend-ci.ymlPush to frontend/TypeScript check, Next.js lint
health-compliance.ymlPush to mainHealth data classification audit