Skip to content

Technology Stack

Moved from CLAUDE.md. Full stack reference with costs and service accounts. 25 services, 21 on free tiers. Total: ~$20/mo (Railway Pro).


Backend & Orchestration

Technology Role Cost/mo
FastAPI (Python 3.12+) API gateway + service layer $0 (on Railway)
LangGraph Multi-agent workflow engine $0 (open source)
LangChain Tool wrappers for LLM/DB/API $0 (open source)
Railway Pro FastAPI container hosting $20

Frontend

Technology Role Cost/mo
React 18 + TypeScript + Vite Patient/provider/admin UIs $0 (on Vercel)
Vercel Vite/React SPA deployment $0 (free tier)

Data Stores

Technology Role Cost/mo
Railway PostgreSQL FHIR records, tenancy, events, audit logs $0 (free tier)
Neo4j Aura Clinical knowledge graph $0 (free, 200K nodes)
Qdrant Cloud Medical embeddings $0 (free, 1GB)
Upstash Redis Application caching $0 (free, 10K/day)
Cloudflare R2 Documents, X-rays, PDFs $0 (free, 10GB)

Events & Messaging

Technology Role Cost/mo
Upstash QStash Async events + scheduling $0 (free, 500/day)
Resend Transactional email $0 (free, 3K/mo)
Twilio (stub) SMS $0 (stubbed)
Daily.co (stub) Video consultations $0 (free, 10K min)

Auth & Feature Flags

Technology Role Cost/mo
Clerk Auth, RBAC, multi-tenant orgs $0 (free, 10K MAU)
Flagsmith Feature toggles + A/B assignment $0 (free, 50K/mo)

LLM Inference (Tiered Routing)

Model Input $/MTok Output $/MTok Best For
Claude Haiku 4.5 $1.00 $5.00 Simple tasks: intake parsing, ICD extraction, explanations
Claude Sonnet 4.6 $3.00 $15.00 Complex reasoning: clinical analysis, edge case re-ranking
GPT-4o mini $0.15 $0.60 High-volume simple tasks: classification, routing
GPT-4.1 $2.00 $8.00 Document analysis, long-context medical records

Routing rules: - Simple tasks (80%): GPT-4o mini or Claude Haiku — lowest cost - Complex reasoning (20%): Claude Sonnet or GPT-4.1 — higher quality - Cost per patient journey (6 agent calls): $0.07–$0.50

Observability

Technology Role Cost/mo
Langfuse Cloud Production LLM traces, cost, latency, prompt management $0 (free tier)
LangSmith Prompt regression testing (deferred) $0 (free tier)
Metabase Cloud BI dashboards + reporting $0 (free starter)
PostHog Cloud User behavior + sessions $0 (free, 1M events)

Other Services

Technology Role Cost/mo
Unstructured.io Document/PDF OCR extraction $0 (free, 1K pages)

Environment Variables

All secrets in environment variables. Application code never references hardcoded credentials.

# Application
APP_NAME=Curaway Health Platform
APP_VERSION=0.1.0
API_VERSION=v1
DEBUG=false
ENVIRONMENT=staging

# Database (Railway PostgreSQL)
DATABASE_URL=postgresql+asyncpg://user:pass@host/dbname?sslmode=require

# Encryption
FIELD_ENCRYPTION_KEY=  # python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"

# CORS
ALLOWED_ORIGINS=["https://your-app.vercel.app","http://localhost:3000"]

# Neo4j Aura
NEO4J_URI=
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=

# Qdrant Cloud
QDRANT_URL=
QDRANT_API_KEY=

# Upstash Redis
UPSTASH_REDIS_URL=
UPSTASH_REDIS_TOKEN=

# Upstash QStash
QSTASH_URL=https://qstash.upstash.io
QSTASH_TOKEN=

# Auth (Clerk)
CLERK_SECRET_KEY=
CLERK_PUBLISHABLE_KEY=

# LLM Providers
ANTHROPIC_API_KEY=
OPENAI_API_KEY=

# Feature Flags (Flagsmith)
FLAGSMITH_API_KEY=

# Observability
LANGFUSE_PUBLIC_KEY=
LANGFUSE_SECRET_KEY=
LANGFUSE_HOST=https://cloud.langfuse.com

# File Storage (Cloudflare R2)
R2_ACCOUNT_ID=
R2_ACCESS_KEY_ID=
R2_SECRET_ACCESS_KEY=
R2_BUCKET_NAME=curaway-documents

# Email (Resend)
RESEND_API_KEY=

Service Account Checklist

Service URL Tier
GitHub github.com Free
Railway railway.app Pro ($20/mo)
Vercel vercel.com Hobby (free)
Railway PostgreSQL railway.app Included in Pro
Neo4j Aura neo4j.com/cloud/aura Free
Qdrant Cloud cloud.qdrant.io Free
Upstash upstash.com Free (Redis + QStash)
Clerk clerk.com Free
Flagsmith flagsmith.com Free
Langfuse cloud.langfuse.com Free
LangSmith smith.langchain.com Free
Metabase metabase.com/cloud Free starter
PostHog posthog.com Free
Anthropic console.anthropic.com Pay-per-use
OpenAI platform.openai.com Pay-per-use
Unstructured unstructured.io Free
Resend resend.com Free (3K/mo)
Cloudflare R2 dash.cloudflare.com Free (10GB)

Code Quality & Testing

Tool Purpose When
Ruff Python linter + formatter (PEP-8) On save + pre-commit + CI
mypy Static type checking (strict) CI pre-merge gate
bandit Security linter CI pre-merge gate
ESLint + Prettier TypeScript/React linting On save + CI
pre-commit Git hook running all checks Every commit
commitlint Conventional Commits format Every commit

Testing Pyramid

Layer Tool Coverage Target
Unit tests pytest + factory-boy 80% services, 70% routes, 60% integrations
Integration pytest + async SQLite Critical paths (tenant isolation, FHIR, auth)
Agent evals Langfuse traces + manual review ICD accuracy, match quality
BDD behave Happy path + GDPR + tenant isolation
E2E Playwright 3–5 critical user journeys
Snapshot pytest API response schema contracts