Libraries

Canonical Library Reference

These are the standard libraries for all Foundation projects. Do not substitute without explicit justification and team approval.


Python

LibraryPurpose
fastapiHTTP API framework
uvicorn[standard]ASGI server
pydanticData validation and serialization
pydantic-settingsSettings management from environment variables
sqlalchemyPostgres query layer / ORM (Neon)
asyncpgAsync Postgres driver (Neon)
pyjwt[crypto]Validate Better Auth JWTs (Neon RLS / auth)
polarsDataFrame / data transformation
fireCLI interface generation
google-cloud-bigqueryGoogle BigQuery client (analytics sync)
google-genaiGoogle Gen AI SDK for Gemini — reasoning, embeddings, and voice, configured for Vertex (vertexai=True, project + location); never ai.google.dev. Used by backend/worker + embedding jobs (see AI Tier)
restate-sdkDurable-execution client (Restate, 1.0) — ASGI/Hypercorn, some glue vs FastAPI-native
cerbosAuthorization PDP client — checks + Query Plan API (SQL filters that pair with Neon RLS)

Python Dev / Test

LibraryPurpose
ruffLinting + formatting
pytestTest runner
pytest-covCoverage reporting
httpxAsync HTTP client (FastAPI test client)

JavaScript / TypeScript

LibraryPurpose
viteBuild tool for the application UIs
@tanstack/react-routerApplication routing
@tanstack/react-queryApplication data fetching / server state
openapi-typescript + openapi-fetchTyped API client generated from the FastAPI OpenAPI schema (the frontend ↔ backend contract)
better-authAuthentication (hosted by the applications-UI server)
drizzle-orm + pgTyped data access — direct Postgres → Neon, with RLS
drizzle-kitSchema migrations + DDL for Neon — schema, migrations, and RLS policies live in the top-level schema/ package (owns tables and RLS; single migration history — the Python side reflects, no Alembic)
nextMarketing site framework (Next.js 14, App Router)
expo + expo-routerMobile framework (React Native)
posthog-jsProduct analytics + session replay on ui/web-app (client; masking on)
posthog-nodeServer-side PostHog for flags (local eval) + events — ui/web-app server and ui/marketing
posthog-react-nativeProduct analytics + session replay on ui/ios (masking on)
turboMonorepo build system (Turborepo)

JS/TS Dev / Test

LibraryPurpose
@biomejs/biomeLinting + formatting
lefthookGit hooks
vitestTest runner (ui/web-app, ui/marketing, ui/ios)
@testing-library/react + @testing-library/react-nativeReact / React Native component testing

Substitution Policy

These libraries were chosen for:

  1. Ecosystem fit — they work well together and with the rest of the stack.
  2. Performance — e.g., Polars over Pandas for data processing, Biome over ESLint for speed.
  3. Maintenance — actively maintained with strong community support.
  4. Compliance — compatible with HIPAA requirements and vendor BAAs.

If a project requires a different library:

  • Document the justification in the PR description.
  • Update .github/copilot-instructions.md to reflect the change.
  • Ensure the replacement meets the same quality and compliance standards.