# gtiosclub/sonora architecture

> Architecture diagram of the GitHub repository gtiosclub/sonora, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gtiosclub/sonora
- Repository: https://github.com/gtiosclub/sonora

## Overview

Sonora is an iOS speaking-practice app with account access, session modes for interviews, debates, and speeches, and transcript-related analysis. The visible path runs from login through auth-state routing to the signed-in home; the session test view exercises queue joining and session acceptance. Models indicate supporting user, drill, preference, skill, and opponent data. The README offers no feature documentation, and several listed capabilities have only models or fixtures in the supplied evidence, so their runtime connections are not inferred.

Main entry points: [`Sonora/Sonora/Shared/Services/AuthManager.swift`](https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Shared/Services/AuthManager.swift) (Auth state), [`Sonora/Sonora/Shared/Views/RootView.swift`](https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Shared/Views/RootView.swift) (Root routing), [`Sonora/Sonora/Shared/Models/Session.swift`](https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Shared/Models/Session.swift) (Session data), [`Sonora/Sonora/Shared/Models/SkillProfile.swift`](https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Shared/Models/SkillProfile.swift) (Skill profile)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and access"]
  node_app_entry["App entry<br/>[SonoraApp.swift]"]
  node_root["Root routing<br/>[RootView.swift]"]
  node_login["Login and signup<br/>[LoginView.swift]"]
  node_home["Signed-in home<br/>[ContentView.swift]"]
  node_auth["Auth state<br/>[AuthManager.swift]"]
  node_user_service["User records<br/>[UserService.swift]"]
  node_firebase_viewmodel["Firebase helper"]
end

subgraph group_sessions["Practice sessions"]
  node_session_test["Session test view<br/>[TestView.swift]"]
  node_session_ops["Session operations"]
  node_ai_model["AI model<br/>[AIModel.swift]"]
end

subgraph group_analysis["Speech analysis"]
  node_transcript_debug["Transcript debug view"]
  node_transcription["Mock transcription"]
  node_transcript["Transcript<br/>[Transcript.swift]"]
  node_transcript_word["Transcript word"]
end

subgraph group_domain["User and practice data"]
  node_user_model["User profile<br/>[User.swift]"]
  node_session_model["Session data<br/>[Session.swift]"]
  node_drill["Drill<br/>[Drill.swift]"]
  node_opponent["AI opponent<br/>[AIOpponent.swift]"]
  node_preferences["Preferences"]
  node_skills["Skill profile<br/>[SkillProfile.swift]"]
  node_improvement["Skill improvement"]
end

node_user(("User"))
node_firebase_auth["Firebase Auth"]
node_firestore[("Cloud Firestore")]

node_user -->|"launches"| node_app_entry
node_app_entry -->|"shows"| node_root
node_root -->|"observes"| node_auth
node_root -->|"routes signed-in"| node_home
node_root -->|"routes signed-out"| node_login
node_login -->|"submits credentials"| node_auth
node_auth -->|"authenticates"| node_firebase_auth
node_auth -->|"creates profiles"| node_firestore
node_auth -->|"loads user"| node_user_service
node_user_service -->|"reads and updates"| node_firestore
node_auth -->|"builds user"| node_user_model
node_auth -->|"builds profile"| node_skills
node_auth -->|"builds profile"| node_preferences
node_home -->|"signs out"| node_auth
node_home -->|"opens"| node_session_test
node_session_test -->|"gets current user"| node_auth
node_session_test -->|"calls operations"| node_session_ops
node_session_ops -->|"updates queue and session"| node_firestore
node_session_ops -->|"uses session mode"| node_session_model
node_session_model -->|"references"| node_opponent
node_user_model -->|"stores past drills"| node_drill
node_drill -->|"references"| node_session_model
node_drill -->|"references"| node_skills
node_preferences -->|"references"| node_session_model
node_user_model -->|"references"| node_skills
node_improvement -->|"references"| node_skills
node_transcript_debug -->|"loads fixture transcript"| node_transcription
node_transcription -->|"decodes"| node_transcript
node_transcript -->|"contains words"| node_transcript_word
node_transcript_debug -->|"displays words"| node_transcript_word

click node_app_entry "https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Shared/SonoraApp.swift"
click node_root "https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Shared/Views/RootView.swift"
click node_login "https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Shared/Views/LoginView.swift"
click node_home "https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Shared/Views/ContentView.swift"
click node_auth "https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Shared/Services/AuthManager.swift"
click node_user_service "https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Shared/Services/UserService.swift"
click node_firebase_viewmodel "https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Shared/Services/FirebaseViewModel.swift"
click node_session_test "https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/LiveSession/Views/TestView.swift"
click node_session_ops "https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/LiveSession/ViewModel/SessionViewModel.swift"
click node_ai_model "https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/LiveSession/Model/AIModel.swift"
click node_transcript_debug "https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Analysis/Views/TranscriptDebugView.swift"
click node_transcription "https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Analysis/Services/Speech/MockTranscriptionService.swift"
click node_transcript "https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Analysis/Models/Transcript.swift"
click node_transcript_word "https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Analysis/Models/TranscriptWord.swift"
click node_user_model "https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Shared/Models/User.swift"
click node_session_model "https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Shared/Models/Session.swift"
click node_drill "https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Shared/Models/Drill.swift"
click node_opponent "https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Shared/Models/AIOpponent.swift"
click node_preferences "https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Shared/Models/PreferenceProfile.swift"
click node_skills "https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Shared/Models/SkillProfile.swift"
click node_improvement "https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Shared/Models/SkillImprovement.swift"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app_entry,node_root,node_login,node_home,node_auth,node_user_service,node_firebase_viewmodel,node_user toneBlue
class node_session_test,node_session_ops,node_ai_model,node_firestore toneAmber
class node_transcript_debug,node_transcription,node_transcript,node_transcript_word toneMint
class node_user_model,node_session_model,node_drill,node_opponent,node_preferences,node_skills,node_improvement toneRose
class node_firebase_auth toneIndigo
```

## Components

### App and access

- [App entry](https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Shared/SonoraApp.swift): `Sonora/Sonora/Shared/SonoraApp.swift`
- [Root routing](https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Shared/Views/RootView.swift): `Sonora/Sonora/Shared/Views/RootView.swift`
- [Login and signup](https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Shared/Views/LoginView.swift): `Sonora/Sonora/Shared/Views/LoginView.swift`
- [Signed-in home](https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Shared/Views/ContentView.swift): `Sonora/Sonora/Shared/Views/ContentView.swift`
- [Auth state](https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Shared/Services/AuthManager.swift): `Sonora/Sonora/Shared/Services/AuthManager.swift`
- [User records](https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Shared/Services/UserService.swift): `Sonora/Sonora/Shared/Services/UserService.swift`
- [Firebase helper](https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Shared/Services/FirebaseViewModel.swift): `Sonora/Sonora/Shared/Services/FirebaseViewModel.swift`

### Practice sessions

- [Session test view](https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/LiveSession/Views/TestView.swift): `Sonora/Sonora/LiveSession/Views/TestView.swift`
- [Session operations](https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/LiveSession/ViewModel/SessionViewModel.swift): `Sonora/Sonora/LiveSession/ViewModel/SessionViewModel.swift`
- [AI model](https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/LiveSession/Model/AIModel.swift): `Sonora/Sonora/LiveSession/Model/AIModel.swift`

### Speech analysis

- [Transcript debug view](https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Analysis/Views/TranscriptDebugView.swift): `Sonora/Sonora/Analysis/Views/TranscriptDebugView.swift`
- [Mock transcription](https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Analysis/Services/Speech/MockTranscriptionService.swift): `Sonora/Sonora/Analysis/Services/Speech/MockTranscriptionService.swift`
- [Transcript](https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Analysis/Models/Transcript.swift): `Sonora/Sonora/Analysis/Models/Transcript.swift`
- [Transcript word](https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Analysis/Models/TranscriptWord.swift): `Sonora/Sonora/Analysis/Models/TranscriptWord.swift`

### User and practice data

- [User profile](https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Shared/Models/User.swift): `Sonora/Sonora/Shared/Models/User.swift`
- [Session data](https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Shared/Models/Session.swift): `Sonora/Sonora/Shared/Models/Session.swift`
- [Drill](https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Shared/Models/Drill.swift): `Sonora/Sonora/Shared/Models/Drill.swift`
- [AI opponent](https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Shared/Models/AIOpponent.swift): `Sonora/Sonora/Shared/Models/AIOpponent.swift`
- [Preferences](https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Shared/Models/PreferenceProfile.swift): `Sonora/Sonora/Shared/Models/PreferenceProfile.swift`
- [Skill profile](https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Shared/Models/SkillProfile.swift): `Sonora/Sonora/Shared/Models/SkillProfile.swift`
- [Skill improvement](https://github.com/gtiosclub/sonora/blob/main/Sonora/Sonora/Shared/Models/SkillImprovement.swift): `Sonora/Sonora/Shared/Models/SkillImprovement.swift`

### Other components

- **User**
- **Firebase Auth**
- **Cloud Firestore**

## Connections

- User → App entry: launches (evidence: `Sonora/Sonora/Shared/SonoraApp.swift`)
- App entry → Root routing: shows (evidence: `Sonora/Sonora/Shared/SonoraApp.swift`)
- Root routing → Auth state: observes (evidence: `Sonora/Sonora/Shared/Views/RootView.swift`)
- Root routing → Signed-in home: routes signed-in (evidence: `Sonora/Sonora/Shared/Views/RootView.swift`)
- Root routing → Login and signup: routes signed-out (evidence: `Sonora/Sonora/Shared/Views/RootView.swift`)
- Login and signup → Auth state: submits credentials (evidence: `Sonora/Sonora/Shared/Views/LoginView.swift`)
- Auth state → Firebase Auth: authenticates (evidence: `Sonora/Sonora/Shared/Services/AuthManager.swift`)
- Auth state → Cloud Firestore: creates profiles (evidence: `Sonora/Sonora/Shared/Services/AuthManager.swift`)
- Auth state → User records: loads user (evidence: `Sonora/Sonora/Shared/Services/AuthManager.swift`)
- User records → Cloud Firestore: reads and updates (evidence: `Sonora/Sonora/Shared/Services/UserService.swift`)
- Auth state → User profile: builds user (evidence: `Sonora/Sonora/Shared/Services/AuthManager.swift`)
- Auth state → Skill profile: builds profile (evidence: `Sonora/Sonora/Shared/Services/AuthManager.swift`)
- Auth state → Preferences: builds profile (evidence: `Sonora/Sonora/Shared/Services/AuthManager.swift`)
- Signed-in home → Auth state: signs out (evidence: `Sonora/Sonora/Shared/Views/ContentView.swift`)
- Signed-in home → Session test view: opens (evidence: `Sonora/Sonora/Shared/Views/ContentView.swift`)
- Session test view → Auth state: gets current user (evidence: `Sonora/Sonora/LiveSession/Views/TestView.swift`)
- Session test view → Session operations: calls operations (evidence: `Sonora/Sonora/LiveSession/Views/TestView.swift`)
- Session operations → Cloud Firestore: updates queue and session (evidence: `Sonora/Sonora/LiveSession/ViewModel/SessionViewModel.swift`)
- Session operations → Session data: uses session mode (evidence: `Sonora/Sonora/LiveSession/ViewModel/SessionViewModel.swift`)
- Session data → AI opponent: references (evidence: `Sonora/Sonora/Shared/Models/Session.swift`)
- User profile → Drill: stores past drills (evidence: `Sonora/Sonora/Shared/Models/User.swift`)
- Drill → Session data: references (evidence: `Sonora/Sonora/Shared/Models/Drill.swift`)
- Drill → Skill profile: references (evidence: `Sonora/Sonora/Shared/Models/Drill.swift`)
- Preferences → Session data: references (evidence: `Sonora/Sonora/Shared/Models/PreferenceProfile.swift`)
- User profile → Skill profile: references (evidence: `Sonora/Sonora/Shared/Models/User.swift`)
- Skill improvement → Skill profile: references (evidence: `Sonora/Sonora/Shared/Models/SkillImprovement.swift`)
- Transcript debug view → Mock transcription: loads fixture transcript (evidence: `Sonora/Sonora/Analysis/Views/TranscriptDebugView.swift`)
- Mock transcription → Transcript: decodes (evidence: `Sonora/Sonora/Analysis/Services/Speech/MockTranscriptionService.swift`)
- Transcript → Transcript word: contains words (evidence: `Sonora/Sonora/Analysis/Models/Transcript.swift`)
- Transcript debug view → Transcript word: displays words (evidence: `Sonora/Sonora/Analysis/Views/TranscriptDebugView.swift`)
