Last updated: 2026-06-29
This document is the high-precision backend-reference for engineers who need to change any Supabase edge function and immediately understand blast radius.
backend/supabase/functions (excluding _shared).All backend routes are exposed via Supabase Function URLs in the form:
/functions/v1/<directory-name>
For any function change, read:
backend/supabase/functions/_shared/*ios/, android/, and/or web/python-web-app/The following modules often need review even when editing one function:
backend/supabase/functions/_shared/auth-context.tsbackend/supabase/functions/_shared/cors.tsbackend/supabase/functions/_shared/types.tsbackend/supabase/functions/_shared/quotas.tsbackend/supabase/functions/_shared/usage.tsbackend/supabase/functions/_shared/entitlements.tsbackend/supabase/functions/_shared/subscription-gating-config.tsbackend/supabase/functions/_shared/private-voice-access.tsbackend/supabase/functions/_shared/billing-entitlement-policy.tsbackend/supabase/functions/_shared/byok.tsFormat:
Route — /<function-dir>Surface — the feature group that typically consumes this APIFiles — tracked implementation/test filesStatus — implemented or scaffoldedWhat it does — contract-level behavior| Route | Surface | Files | Status | What it does |
|---|---|---|---|---|
/account-delete |
auth/account lifecycle | index.ts, handler.ts, handler_test.ts |
Implemented | Removes authenticated user account and/or user-owned resources through server-side privileged operations. |
/billing-apple-sync |
billing | index.ts, logic.ts, logic_test.ts |
Partial/legacy | Reconciles Apple receipt sync payloads; helper-based implementation path, verify runtime route entry and parity with Apple notification path. |
/billing-apple-notifications |
billing | index.ts, handler.ts, handler_test.ts, deno.json, .npmrc |
Implemented | Validates Apple store notifications and applies entitlement changes with deterministic handling for known event types. |
/billing-google-play-sync |
billing | index.ts, handler.ts, google-play-verifier.ts, google-play-verifier_test.ts, handler_test.ts |
Implemented | Verifies/unwraps Google Play payload and maps entitlement/payment state to app billing policy. |
/billing-stripe-webhook |
billing | index.ts, dispatch.ts, dispatch_test.ts, logic.ts, logic_test.ts, persistence.ts, persistence_test.ts, signature.ts, signature_test.ts, validation.ts, validation_test.ts |
Implemented | Verifies Stripe signature + event schema, dispatches event-specific handlers, persists event/transition state where needed. |
/bug-report-submit |
support | index.ts, handler.ts, handler_test.ts |
Implemented | Captures user bug reports into backend persistence/ingest path for triage. |
/byok-resolve |
settings/provider config | index.ts, handler.ts, handler_test.ts |
Implemented | Returns bring-your-own-key configuration/status without revealing raw secrets in the response. |
/byok-upsert |
settings/provider config | index.ts, handler.ts, handler_test.ts |
Implemented | Creates or updates BYOK provider configuration and enablement state for user sessions. |
/clip-order-batch |
soundboard ordering | index.ts, handler.ts, handler_test.ts |
Implemented | Applies ordered clip ordering mutations, typically after drag/drop reorder in clients. |
/language-recommend |
STT/STT/STS quality UX | index.ts, handler.ts, handler_test.ts |
Implemented | Provides language recommendation payloads based on user context and usage policy. |
/models-list |
voice/model catalog | index.ts, handler.ts, handler_test.ts |
Implemented | Returns model catalog and provider/model visibility after entitlement and policy filtering. |
/pronunciation-dictionary |
pronunciation/tts accuracy | index.ts, handler.ts, handler_test.ts |
Implemented | CRUD + retrieval for user pronunciation overrides with validation semantics. |
/quota-status |
usage gating | index.ts, handler.ts, handler_test.ts |
Implemented | Returns quota snapshots used by usage-limit UI and policy gating. |
/soundboard-save-generated |
soundboard persistence | index.ts, handler.ts, handler_test.ts |
Implemented | Persists generated clip metadata + storage metadata for generated artifacts and returns saved clip contract. |
/soundboard-delete |
soundboard lifecycle | index.ts, handler.ts, handler_test.ts, delete_storage_error.ts, delete_storage_error_test.ts |
Implemented | Deletes soundboard assets with storage cleanup and typed deletion errors. |
/soundboard-clip-ingest |
migration/scaffold | (no function files) | Scaffold only | Placeholder function directory for future migration ingest path. Do not route production traffic here. |
/sts-live-voice-tts-session |
live STS/voice | index.ts, handler.ts, handler_test.ts |
Implemented | Starts live voice-to-speech session semantics and returns provider contract required by clients. |
/sts-near-realtime-session |
near-realtime STS | index.ts, handler.ts, handler_test.ts |
Implemented | Initializes near-realtime STS context with persisted state for finalize path. |
/sts-realtime-session |
realtime STS | index.ts, handler.ts, handler_test.ts |
Implemented | Creates/returns active realtime STS session context. |
/sts-realtime-finalize |
realtime STS | index.ts, handler.ts, handler_test.ts |
Implemented | Finalizes realtime/near-realtime session, merging transcript and artifact metadata and returning artifact contract. |
/sts-live-interpreter-session |
interpreter (next-gen) | index.ts only |
Scaffold only | Reserved migration target; runtime behavior undefined until handler implementation added. |
/sts-live-interpreter-tts-session |
interpreter (next-gen) | index.ts only |
Scaffold only | Reserved migration target; runtime behavior undefined until handler implementation added. |
/stt-transcribe |
STT | index.ts, capture.ts, capture_test.ts, validation.ts, validation_test.ts, handler.ts, handler_test.ts |
Implemented | Validates non-streaming STT request + provider invocation + optional capture telemetry + standardized response envelope. |
/style-presets |
settings / presets | index.ts, handler.ts, handler_test.ts |
Implemented | Fetches and stores style preset configuration consumed by speech generation features. |
/tts-generate |
TTS core | index.ts, handler.ts, pronunciation.ts, pronunciation_test.ts, policy.ts, policy_test.ts, handler_test.ts |
Implemented | Core text-to-speech contract path: validation, policy enforcement, pronunciation normalization, provider call, and artifact persistence. |
/user-settings-get |
settings | index.ts, handler.ts, handler_test.ts |
Implemented | Fetches user settings including migration-safe defaults and compatibility fallbacks. |
/user-settings-update |
settings | index.ts, handler.ts, handler_test.ts |
Implemented | Applies patch-based user settings updates with payload validation and response normalization. |
/voice-clone-preflight |
voice clone | index.ts, validation.ts, validation_test.ts, handler.ts, handler_test.ts |
Implemented | Prepares/validates readiness checks before clone creation (file length, account status, prior constraints). |
/voice-clone-create |
voice clone | index.ts, validation.ts, validation_test.ts, telemetry.ts, telemetry_test.ts, handler.ts, handler_test.ts |
Implemented | Executes provider-side voice clone creation and returns stable clone metadata + audit telemetry. |
/voice-clone-delete |
voice clone | index.ts, validation.ts, validation_test.ts, handler.ts, handler_test.ts |
Implemented | Deletes user-owned voice clone entry and related provider references. |
/voices-list |
voice/model catalog | index.ts, handler.ts, handler_test.ts |
Implemented | Returns voice list with ownership/private-access filtering and deterministic fallback ordering. |
/waitlist-signup |
marketing ops | index.ts, handler.ts, handler_test.ts |
Implemented | Stores waitlist entries, de-duplicates by key and persists minimal metadata. |
Use this matrix before editing a function; it identifies likely client callsites and test areas.
tts-generate, voices-list, models-list, pronunciation-dictionaryios/SpeakTrue/TTSViewModel.swiftios/SpeakTrue/AIProxyService.swiftios/SpeakTrue/VoiceModelSelectionView.swiftandroid/app/src/main/java/com/speaktrue/features/tts/data/*android/app/src/main/java/com/speaktrue/features/tts/presentation/TTSViewModel.ktandroid/app/src/main/java/com/speaktrue/features/tts/ui/TTSScreen.ktweb/python-web-app/src/services/* compatibility seamios/SpeakTrueTests/*TTS*stt-transcribe, sts-near-realtime-session, sts-realtime-session, sts-realtime-finalize, sts-live-voice-tts-sessionios/SpeakTrue/STTViewModel.swiftios/SpeakTrue/STSViewModel.swiftios/SpeakTrue/RealtimeSTTService.swiftios/SpeakTrue/LiveVoiceSTSService.swiftios/SpeakTrue/AIProxyService.swiftandroid/app/src/main/java/com/speaktrue/features/stt/*android/app/src/main/java/com/speaktrue/features/sts/data/*android/app/src/main/java/com/speaktrue/features/sts/presentation/STSViewModel.ktweb/python-web-app/src/routes/stt.pyweb/python-web-app/src/services/*web/python-web-app/static/js/index_stt.jsweb/python-web-app/static/js/index_sts_live_voice.jsweb/python-web-app/tests/js/sts_*.mjssoundboard-save-generated, soundboard-delete, clip-order-batch, soundboard-clip-ingestios/SpeakTrue/SoundboardViewModel.swiftios/SpeakTrue/SoundboardCacheManager.swiftios/SpeakTrue/SoundboardCacheIndex.swiftios/SpeakTrue/AIProxyService.swiftandroid/app/src/main/java/com/speaktrue/features/soundboard/data/*android/app/src/main/java/com/speaktrue/features/soundboard/presentation/SoundboardViewModel.ktweb/python-web-app/src/routes/soundboard.pyweb/python-web-app/src/services/soundboard_service.pyweb/python-web-app/static/js/index_soundboard.jsuser-settings-get, user-settings-update, quota-statusios/SpeakTrue/UserSettingsSyncService.swiftios/SpeakTrue/UserSettings.swiftios/SpeakTrue/SettingsTabView.swiftios/SpeakTrue/SettingsView.swiftandroid/app/src/main/java/com/speaktrue/features/settings/data/*android/app/src/main/java/com/speaktrue/features/settings/presentation/SettingsViewModel.ktweb/python-web-app/src/services/user_settings_service.pyweb/python-web-app/src/routes/settings.pybilling-apple-notifications, billing-apple-sync, billing-google-play-sync, billing-stripe-webhook, quota-status, byok-*backend/supabase/migrations/*_shared/subscription-gating-config.ts_shared/entitlements.ts_shared/billing-entitlement-policy.tsbash scripts/coverage_backend_contracts.shbash scripts/regression_migration_paths.shbackend/supabase/migrations/If you create a new function or convert a scaffold into an implementation:
index.tshandler.tshandler_test.ts