Last updated: 2026-06-29
This is the canonical first-contact document for new engineers joining SpeakTrue. It is intended to answer: what each surface does, what each file owns, where to edit for a requested change, and how to deploy or triage issues safely.
If you need a complete file-by-file catalog, use:
docs/reference/ios-file-inventory.mddocs/reference/android-file-inventory.mddocs/reference/web-file-inventory.mdFor backend endpoint-level behavior:
docs/reference/backend-functions-detailed-map.mddocs/reference/backend-functions-deep-dive.mdREADME.mdAGENTS.mddocs/index.mddocs/contracts/native-speech-parity-anchor.mddocs/contracts/speech-workflow-contract.mddocs/reference/repository-unified-engineering-manual.md (this file)docs/reference/ios-file-inventory.mddocs/reference/android-file-inventory.mddocs/reference/web-file-inventory.mddocs/reference/backend-functions-detailed-map.mddocs/reference/backend-functions-deep-dive.mddocs/ops/*README.md, AGENTS.md, docs/CONVENTIONS.md, docs/ARCHITECTURE.md.docs/reference/repository-full-deep-reference.md, docs/reference/repository-onboarding-reference.md, docs/reference/repository-operator-manual.md.docs/contracts/native-speech-parity-anchor.md, docs/contracts/speech-workflow-contract.md.docs/ops/MIGRATION_REGRESSION_GATES.md, docs/ops/SUPABASE_SMOKE_TEST_CHECKLIST.md, scripts/coverage_backend_contracts.sh, scripts/regression_migration_paths.sh.docs/reference/backend-functions-detailed-map.md.docs/reference/ios-file-inventory.md, docs/reference/android-file-inventory.md, docs/reference/web-file-inventory.md.backend/supabase/functions and backend/supabase/migrations.web/marketing/ is production static marketing.web/python-web-app/ is the legacy/compatibility runtime and migration seam.docs/ is the operational and design authority.ios/SpeakTrue/SpeakTrueApp.swift: app bootstrap, service injection, startup orchestration.ios/SpeakTrue/ContentView.swift: app shell root and feature routing.ios/SpeakTrue/AuthGateView.swift: authentication gate and session state transitions.ios/SpeakTrue/StartupLoadingView.swift: pre-session initialization/loading view.ios/SpeakTrue/MainTabView.swift: main tab graph host.ios/SpeakTrue/SettingsTabView.swift: settings entrypoint.ios/SpeakTrue/SettingsView.swift: settings tab screens.ios/SpeakTrue/SignInView.swift: sign-in entry screen.ios/SpeakTrue/SpeakTrueApp.swift and ios/Config/App*.xcconfig: runtime-mode differences.ios/Info.plist, ios/SpeakTrue.entitlements: capabilities and plist-driven behavior.ios/SpeakTrue/SupabaseConfig.swift: env and runtime keys.ios/SpeakTrue/SupabaseClientProvider.swift: client construction and configuration.ios/SpeakTrue/AuthService.swift: auth/session lifecycle and persistence interactions.ios/SpeakTrue/AuthState.swift: auth state model consumed by screens/view-models.ios/SpeakTrue/UserSettings.swift: user settings schema and defaults.ios/SpeakTrue/UserSettingsSyncService.swift: remote sync loop for settings.ios/SpeakTrue/AIDataSharingAgreementService.swift: consent + legal state contract.ios/SpeakTrue/AIDataSharingConsent.swift and AIDataSharingConsentGateView.swift: consent UI and gating behavior.ios/SpeakTrue/AIProxyService.swift: edge-function API facade used by speech and settings flows.ios/SpeakTrue/TTSViewModel.swift: TTS request orchestration and state machine.ios/SpeakTrue/TextToSpeechView.swift: TTS screen and generation inputs.ios/SpeakTrue/TTSCatSelectView.swift: TTS category and quality controls.ios/SpeakTrue/VoiceModelSelectionView.swift: voice/model picker.ios/SpeakTrue/TextInputView.swift: shared speech input component.ios/SpeakTrue/GenerateButtonView.swift: primary generation action.ios/SpeakTrue/ResetButtonView.swift: reset/cancel action behavior.ios/SpeakTrue/STTViewModel.swift: non-live STT request orchestration.ios/SpeakTrue/SpeechToTextView.swift: STT screen and control state.ios/SpeakTrue/STSViewModel.swift: STS state machine, finalize sequencing.ios/SpeakTrue/SpeechToSpeechView.swift: STS/near-realtime UX.ios/SpeakTrue/RealtimeSTTService.swift: real-time STT transport wrapper.ios/SpeakTrue/LiveVoiceSTSService.swift: live STS transport orchestration.ios/SpeakTrue/LiveVoiceAudioPlayer.swift: streaming playback path used by live features.ios/SpeakTrue/ElevenLabsService.swift and ElevenLabsSTTService.swift: provider-adapter behavior.AIProxyService.swift and pronunciation helpers.ios/SpeakTrue/SoundboardView.swift: list and interaction surface.ios/SpeakTrue/SoundboardViewModel.swift: soundboard state and actions.ios/SpeakTrue/SoundboardCacheManager.swift: cache/index lifecycle for clips.ios/SpeakTrue/SoundboardCacheIndex.swift: clip ordering and category index model.ios/SpeakTrue/SoundboardCategories.swift and SBCategoryDetailView.swift: category grouping and drilldown.ios/SpeakTrue/SoundboardAudioClips.swift: clip model helpers for render/play.ios/SpeakTrue/StorageTestView.swift: diagnostics around caching/storage behavior.ios/SpeakTrue/VoiceCloneTabView.swift: clone creation surface.ios/SpeakTrue/VoiceCloneViewModel.swift: clone request state machine and validation.ios/SpeakTrue/PronunciationGlossaryView.swift: pronunciation dictionary UI.ios/SpeakTrue/PronunciationGlossaryViewModel.swift: CRUD behavior for pronunciation entries.ios/SpeakTrue/AppTheme.swift, ColorExtension.swift, CategoryInfo.swift: style and category metadata.ios/SpeakTrue/AppTour.swift: onboarding guidance flow.ios/SpeakTrue/DebugLogger.swift: debug logging and output format.ios/SpeakTrue/BreakManager.swift, AsyncTimeout.swift: timing utilities used by sessions/audio flows.ios/SpeakTrue/AudioPlayerService.swift, AudioRecorderService.swift: playback and recording service layer.ios/SpeakTrue/CloudStorageService.swift, StorageManager.swift: persistence and storage index handling.ios/SpeakTrue/WaveFormView.swift, AudioControlsView.swift, HeaderViewTTS.swift, HeaderViewSTT.swift: reusable UI components.ios/SpeakTrueTests/* and ios/SpeakTrueUITests/*.For file-level iOS inventory and descriptions, use docs/reference/ios-file-inventory.md.
android/app/src/main/java/com/speaktrue/app/SpeakTrueApp.kt: DI + app graph setup.android/app/src/main/java/com/speaktrue/app/MainActivity.kt: platform host and root activity.android/app/src/main/java/com/speaktrue/ui/navigation/AppNavGraph.kt: route graph and screen transitions.android/app/src/main/java/com/speaktrue/core/auth/**: auth repository + session state.android/app/src/main/java/com/speaktrue/core/config/RuntimeConfig.kt: platform config/runtime constants.android/app/src/main/java/com/speaktrue/core/network/**: edge-function and HTTP plumbing.android/app/src/main/java/com/speaktrue/core/storage/**: local persistence helpers.android/app/src/main/java/com/speaktrue/core/audio/**: recorder/player interoperability.android/app/src/main/java/com/speaktrue/core/reliability/**: retries and transient-failure control.android/app/src/main/java/com/speaktrue/core/permissions/**: permission state and prompts.android/app/src/main/java/com/speaktrue/core/di/**: dependency construction and service wiring.android/app/src/main/java/com/speaktrue/features/tts/**: TTS generation, voice/model catalog, presets integration.android/app/src/main/java/com/speaktrue/features/stt/**: STT feature state and service calls.android/app/src/main/java/com/speaktrue/features/sts/**: near/realtime STS orchestration.android/app/src/main/java/com/speaktrue/features/soundboard/**: soundboard persistence + ordering and playback.android/app/src/main/java/com/speaktrue/features/voiceclone/**: voice clone create/delete preflight flow.android/app/src/main/java/com/speaktrue/features/settings/**: persisted settings and feature flags.android/app/src/main/java/com/speaktrue/features/agreement/**: AI data sharing consent flow.android/app/src/main/java/com/speaktrue/features/dictionary/**: pronunciation dictionary integration.android/app/src/main/java/com/speaktrue/features/presets/**: style presets integration.android/app/src/main/java/com/speaktrue/features/language/**: language selection and recommendations.android/app/src/main/java/com/speaktrue/features/shared/** and android/app/src/main/java/com/speaktrue/ui/theme/**: shared UI and reusable components.android/settings.gradle.kts, android/build.gradle.kts, android/gradle/libs.versions.toml, android/app/build.gradle.kts.android/app/src/test/java/com/speaktrue/**.android/app/src/androidTest/java/com/speaktrue/**.For file-level Android inventory and descriptions, use docs/reference/android-file-inventory.md.
web/marketing/index.html: production marketing/landing shell.web/marketing/auth/callback/index.html: OAuth callback page.web/marketing/scripts/*.js: UI interaction, waitlist submission, theme wiring.web/marketing/styles/*.css: responsive styling and tokens.web/marketing/_headers, _redirects, site.webmanifest, deploy-version.json: deploy/runtime metadata.web/python-web-app/wsgi.py and web/python-web-app/src/app.py: legacy web runtime entry points.web/python-web-app/src/config.py: environment/config bootstrap.web/python-web-app/src/legacy_runtime.py and src/legacy_runtime_adapter.py: staged adapter seam to backend contracts.web/python-web-app/src/routes/*.py: HTTP route table for legacy APIs.web/python-web-app/src/services/*.py: orchestration/service boundary for routes.web/python-web-app/src/storage/*.py: storage and migration helpers used by compatibility path.web/python-web-app/src/jobs/*.py: background/asynchronous task orchestration.web/python-web-app/README.md, README_CONTEXT.md: runtime docs.web/python-web-app/Dockerfile, Procfile, docker-compose.yml, docker-entrypoint.sh: legacy runtime packaging.web/python-web-app/src/templates/**, web/python-web-app/src/static/**: runtime-facing assets for legacy web views.web/python-web-app/tests/**: Python regression and parity tests.For complete web file inventory and detailed ownership, use docs/reference/web-file-inventory.md.
| Route | Surface | Files | Status | What this changes | Primary test points |
|---|---|---|---|---|---|
/account-delete |
auth/account | backend/supabase/functions/account-delete/* |
implemented | deletes user account and related resources | backend/supabase/functions/account-delete/*_test.ts |
/billing-apple-sync |
billing | backend/supabase/functions/billing-apple-sync/* |
partial/legacy | updates entitlement state from Apple sync payloads | .../logic_test.ts, function tests |
/billing-apple-notifications |
billing | backend/supabase/functions/billing-apple-notifications/* |
implemented | applies webhook events to entitlements | .../handler_test.ts |
/billing-google-play-sync |
billing | backend/supabase/functions/billing-google-play-sync/* |
implemented | validates Play payload and persists subscription state | google-play-verifier_test.ts, handler tests |
/billing-stripe-webhook |
billing | backend/supabase/functions/billing-stripe-webhook/* |
implemented | verifies signatures and dispatches billing events | dispatch_test.ts, signature_test.ts, logic_test.ts |
/bug-report-submit |
support | backend/supabase/functions/bug-report-submit/* |
implemented | captures support payloads for triage | handler_test.ts |
/byok-resolve |
settings/provider | backend/supabase/functions/byok-resolve/* |
implemented | resolves BYOK status with secret-safe response | handler_test.ts |
/byok-upsert |
settings/provider | backend/supabase/functions/byok-upsert/* |
implemented | upserts BYOK capability state | handler_test.ts |
/clip-order-batch |
soundboard | backend/supabase/functions/clip-order-batch/* |
implemented | persists category/clip ordering payloads | handler_test.ts |
/language-recommend |
STS quality | backend/supabase/functions/language-recommend/* |
implemented | returns language recommendation payloads | handler_test.ts |
/models-list |
voices/models | backend/supabase/functions/models-list/* |
implemented | returns model catalog after filtering | handler_test.ts |
/voices-list |
voices/models | backend/supabase/functions/voices-list/* |
implemented | returns voice catalog after private/public filtering | handler_test.ts |
/pronunciation-dictionary |
quality | backend/supabase/functions/pronunciation-dictionary/* |
implemented | CRUD and retrieval for pronunciation dictionary | handler_test.ts |
/quota-status |
settings/feature-gating | backend/supabase/functions/quota-status/* |
implemented | returns usage + limit envelope for clients | handler_test.ts |
/soundboard-save-generated |
soundboard | backend/supabase/functions/soundboard-save-generated/* |
implemented | persists generated clip metadata + storage keys | handler_test.ts |
/soundboard-delete |
soundboard | backend/supabase/functions/soundboard-delete/* |
implemented | deletes soundboard artifacts and storage objects | handler_test.ts, delete_storage_error_test.ts |
/soundboard-clip-ingest |
soundboard | directory scaffold | scaffold only | migration placeholder; no handler behavior yet | none (intentional scaffold) |
/stt-transcribe |
STT | backend/supabase/functions/stt-transcribe/* |
implemented | validates + forwards STT job + response normalization | capture_test.ts, validation_test.ts, handler_test.ts |
/sts-near-realtime-session |
STS | backend/supabase/functions/sts-near-realtime-session/* |
implemented | starts near-realtime session lifecycle | handler_test.ts |
/sts-realtime-session |
STS | backend/supabase/functions/sts-realtime-session/* |
implemented | creates active realtime session context | handler_test.ts |
/sts-realtime-finalize |
STS | backend/supabase/functions/sts-realtime-finalize/* |
implemented | finalizes session and returns artifact contract | handler_test.ts |
/sts-live-voice-tts-session |
STS | backend/supabase/functions/sts-live-voice-tts-session/* |
implemented | starts live STS voice-to-speech session | handler_test.ts |
/sts-live-interpreter-session |
STS (future) | backend/supabase/functions/sts-live-interpreter-session/* |
scaffold only | future migration target; no active production behavior | none |
/sts-live-interpreter-tts-session |
STS (future) | backend/supabase/functions/sts-live-interpreter-tts-session/* |
scaffold only | future migration target; no active production behavior | none |
/style-presets |
presets/settings | backend/supabase/functions/style-presets/* |
implemented | fetch/update style preset records | handler_test.ts |
/tts-generate |
TTS generation | backend/supabase/functions/tts-generate/* |
implemented | policy + provider + artifact metadata + error normalization | policy_test.ts, pronunciation_test.ts, handler_test.ts |
/user-settings-get |
settings | backend/supabase/functions/user-settings-get/* |
implemented | reads settings with safe defaults | handler_test.ts |
/user-settings-update |
settings | backend/supabase/functions/user-settings-update/* |
implemented | updates settings with patch validation | handler_test.ts |
/voice-clone-preflight |
voice clone | backend/supabase/functions/voice-clone-preflight/* |
implemented | validates clone readiness constraints | validation_test.ts, handler_test.ts |
/voice-clone-create |
voice clone | backend/supabase/functions/voice-clone-create/* |
implemented | creates clone and records audit telemetry | validation_test.ts, telemetry_test.ts, handler_test.ts |
/voice-clone-delete |
voice clone | backend/supabase/functions/voice-clone-delete/* |
implemented | deletes clone and provider-side references | validation_test.ts, handler_test.ts |
/waitlist-signup |
marketing | backend/supabase/functions/waitlist-signup/* |
implemented | stores deduplicated waitlist entries | handler_test.ts |
backend/supabase/functions/_shared/auth-context.tsbackend/supabase/functions/_shared/cors.tsbackend/supabase/functions/_shared/types.tsbackend/supabase/functions/_shared/usage.tsbackend/supabase/functions/_shared/quotas.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.ts| Change request | iOS files | Android files | Web files | Backend / migration files | Tests |
|---|---|---|---|---|---|
| Update TTS policy, voices, model filters, pronunciation behavior | ios/SpeakTrue/AIProxyService.swift, TTSViewModel.swift, TextToSpeechView.swift, TTSCatSelectView.swift, VoiceModelSelectionView.swift |
features/tts/data/*, features/tts/presentation/TTSViewModel.kt, features/tts/ui/TTSScreen.kt |
web/python-web-app/src/routes/tts.py, src/services/tts_service.py and relevant templates |
backend/supabase/functions/tts-generate/*, voices-list/*, models-list/*, style-presets/*, _shared/entitlements.ts, _shared/quotas.ts, _shared/usage.ts |
function tests, iOS TTS tests, Android TTS tests |
| Change STT behavior (recording, upload, transcript handling) | STTViewModel.swift, SpeechToTextView.swift, AIProxyService.swift, ElevenLabsSTTService.swift |
features/stt/*, features/sts/presentation/STSViewModel.kt, features/sts/data/* |
web/python-web-app/src/routes/stt.py, src/services/speech_service.py, web/python-web-app/static/js/index_stt.js, index_sts_live_voice.js |
stt-transcribe/*, _shared/validation.ts, _shared/quotas.ts, _shared/usage.ts |
stt tests, STS tests, android/iOS speech tests |
| Change STS session lifecycle/finalize contract | STSViewModel.swift, SpeechToSpeechView.swift, LiveVoiceSTSService.swift, RealtimeSTTService.swift, AIProxyService.swift |
features/sts/* |
web/python-web-app/src/routes/stt.py, STS JS runtimes |
sts-near-realtime-session/*, sts-realtime-session/*, sts-realtime-finalize/*, sts-live-voice-tts-session/*, relevant _shared/* |
STS session/finalize tests and feature tests |
| Change soundboard ordering, persistence, delete semantics | SoundboardView.swift, SoundboardViewModel.swift, SoundboardCacheManager.swift, SoundboardCacheIndex.swift, AIProxyService.swift |
features/soundboard/ui/SoundboardScreen.kt, features/soundboard/presentation/SoundboardViewModel.kt, features/soundboard/data/* |
web/python-web-app/src/routes/soundboard.py, src/services/soundboard_service.py |
clip-order-batch/*, soundboard-save-generated/*, soundboard-delete/*, migrations touching soundboard tables |
soundboard tests on each surface |
| Change voice clone flow | VoiceCloneTabView.swift, VoiceCloneViewModel.swift, AIDataSharing* files |
features/voiceclone/* |
web/python-web-app/src/routes/voice_clone.py, src/services/voice_clone_service.py |
voice-clone-preflight/*, voice-clone-create/*, voice-clone-delete/*, BYOK helpers |
clone tests + contract tests |
| Update settings defaults, quotas, agreements | UserSettings.swift, UserSettingsSyncService.swift, settings screens, AIDataSharingAgreementService.swift |
features/settings/*, features/agreement/* |
web/python-web-app/src/routes/settings.py, src/services/user_settings_service.py |
user-settings-get/*, user-settings-update/*, quota-status/*, byok-* as needed, migrations for defaults |
settings tests and parity tests |
| Modify billing/entitlements | billing-sensitive screens and gating checks | all gating screens + core modules | legacy web billing surfaces as applicable | billing-apple-sync/*, billing-google-play-sync/*, billing-apple-notifications/*, billing-stripe-webhook/*, _shared/billing-entitlement-policy.ts, _shared/entitlements.ts, _shared/subscription-gating-config.ts, migrations for entitlements/gates |
billing tests + relevant client feature tests |
| Add migration or fix SQL behavior | any affected model/service tests | any affected feature tests | any compatibility route impacted by query behavior | backend/supabase/migrations/*, function handlers using affected tables |
regression migration scripts and relevant function/client tests |
| Add new backend endpoint | new function folder + client adapters | new API method in callsite layer | compatibility route where needed | backend/supabase/functions/<route>/*, migrations if schema required |
handler tests and client integration tests |
bash scripts/coverage_backend_contracts.shbash scripts/regression_migration_paths.shbash scripts/verify_android_play_release_blockers.py (release readiness aid when release-related)bash scripts/verify_ios_version_alignment.sh if version or entitlement changes.backend/supabase/migrations with rationale in commit/PR description../gradlew -p android :app:compileDebugKotlin./gradlew -p android :app:testDebugUnitTest./gradlew -p android :app:lintDebug./gradlew -p android :app:bundleRelease for release pipeline checks.docs/ops/ANDROID_PLAY_RELEASE_CHECKLIST.md for evidence and artifacts.ios/Config/App*.xcconfig, ios/SpeakTrue.entitlements, and ios/SpeakTrue/Info.plist for auth/billing/storage behavior changes.repository references before merge.docs/ops/CLOUDFLARE_PAGES_DEPLOY.md for marketing changes.python3 -m pytest web/python-web-app/tests for legacy compatibility behavior.wsgi:app smoke once compatibility changes are made.web/python-web-app/requirements*.txt, Docker entrypoint files, and legacy_runtime_adapter impact.rg --files ios → quick iOS surface check.rg --files android → quick Android surface check.rg --files web/python-web-app/src → web runtime file inventory.rg --files backend/supabase/functions → backend function directories.git log --oneline -- docs/reference/ios-file-inventory.md etc. to inspect doc/ownership drift.find backend/supabase/migrations -maxdepth 1 -type f | sort for migration chronology.git status --short before commit to ensure only intended files changed.docs/contracts/speech-workflow-contract.md for contract-shape changes.docs/ops/* for deployable behavior changes.docs/reference/repository-unified-engineering-manual.md (this file)docs/reference/repository-ultimate-engineering-bible.mddocs/reference/repository-total-engineering-atlas.mddocs/reference/repository-onboarding-reference.mddocs/reference/repository-full-deep-reference.mddocs/reference/repository-extremely-detailed-engineer-guide.mddocs/reference/repository-extreme-deep-behavior-map.mddocs/reference/repository-operator-manual.mddocs/reference/engineer-change-cookbook.mddocs/reference/backend-functions-detailed-map.mddocs/reference/backend-functions-deep-dive.mddocs/reference/ios-file-inventory.mddocs/reference/android-file-inventory.mddocs/reference/web-file-inventory.md