# doublegg1505/bachtunerproject architecture

> Architecture diagram of the GitHub repository doublegg1505/bachtunerproject, 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/doublegg1505/bachtunerproject
- Repository: https://github.com/doublegg1505/bachtunerproject

## Overview

BachTuner is a React Native violin practice app. Its main workflow takes microphone audio in the tuner screen, detects pitch, and presents tuning feedback; users can also manage repertoire and string inventory, sign in, and configure their profile and theme. The app initializes navigation, theme, and Redux state centrally. The tree and excerpts support these major capabilities, but several screens and persistence details are unsampled, so their internal links are omitted where not evidenced.

Main entry points: [`src/screens/features/user-settings/Profile.tsx`](https://github.com/doublegg1505/bachtunerproject/blob/main/src/screens/features/user-settings/Profile.tsx) (Profile Settings), [`src/navigation/StackNavigator.tsx`](https://github.com/doublegg1505/bachtunerproject/blob/main/src/navigation/StackNavigator.tsx) (Stack Navigation), [`src/screens/Home.tsx`](https://github.com/doublegg1505/bachtunerproject/blob/main/src/screens/Home.tsx) (Tuner Screen), [`src/navigation/TabsNavigator.tsx`](https://github.com/doublegg1505/bachtunerproject/blob/main/src/navigation/TabsNavigator.tsx) (Feature Tabs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App Shell"]
  node_app["App Root<br/>[App.tsx]"]
  node_stack["Stack Navigation<br/>[StackNavigator.tsx]"]
  node_tabs["Feature Tabs<br/>[TabsNavigator.tsx]"]
  node_button["Shared Button<br/>[CustomButton.tsx]"]
  node_input["Shared Input<br/>[CustomInput.tsx]"]
end

subgraph group_practice["Tuning Practice"]
  node_home["Tuner Screen<br/>[Home.tsx]"]
  node_pitch["Pitch Detection<br/>[audioProcessor.ts]"]
  node_metronome["Metronome<br/>[MetronomeModal.tsx]"]
end

subgraph group_account["Accounts"]
  node_login["Sign In<br/>[Login.tsx]"]
  node_register["Registration<br/>[Register.tsx]"]
  node_profile["Profile Settings<br/>[Profile.tsx]"]
  node_auth["Auth Context<br/>[AuthContext.tsx]"]
  node_supabase["Supabase Client<br/>[supabase.ts]"]
end

subgraph group_library["Practice Library"]
  node_repertoire["Repertoire<br/>[Repertoire.tsx]"]
  node_strings["String Inventory<br/>[MyStrings.tsx]"]
end

subgraph group_state["App State"]
  node_store["Redux Store<br/>[index.ts]"]
  node_userslice["User State<br/>[userSlice.ts]"]
  node_repslice["Repertoire State<br/>[repertoireSlice.ts]"]
  node_stringsslice["Inventory State<br/>[stringsSlice.ts]"]
  node_theme["Theme Context<br/>[ThemeContext.tsx]"]
  node_colors["Theme Palettes<br/>[colors.ts]"]
end

node_user(("Violinist"))

node_user -->|"navigates"| node_stack
node_app -->|"mounts"| node_stack
node_app -->|"provides"| node_theme
node_app -->|"provides"| node_store
node_stack -->|"routes"| node_home
node_stack -->|"routes"| node_login
node_stack -->|"routes"| node_register
node_stack -->|"routes"| node_tabs
node_tabs -->|"routes"| node_home
node_tabs -->|"routes"| node_strings
node_tabs -->|"routes"| node_profile
node_home -->|"detects pitch"| node_pitch
node_home -->|"opens"| node_metronome
node_login -->|"authenticates"| node_supabase
node_register -->|"registers"| node_supabase
node_profile -->|"signs out"| node_supabase
node_profile -->|"updates state"| node_userslice
node_profile -->|"clears inventory"| node_stringsslice
node_auth -->|"uses"| node_supabase
node_auth -->|"updates"| node_userslice
node_auth -->|"updates"| node_stringsslice
node_repertoire -->|"dispatches"| node_repslice
node_strings -->|"uses"| node_stringsslice
node_store -->|"combines"| node_userslice
node_store -->|"combines"| node_stringsslice
node_store -->|"combines"| node_repslice
node_theme -->|"selects palette"| node_colors
node_home -->|"renders"| node_button
node_repertoire -->|"renders"| node_button
node_repertoire -->|"renders"| node_input
node_profile -->|"renders"| node_button
node_profile -->|"renders"| node_input

click node_app "https://github.com/doublegg1505/bachtunerproject/blob/main/App.tsx"
click node_stack "https://github.com/doublegg1505/bachtunerproject/blob/main/src/navigation/StackNavigator.tsx"
click node_tabs "https://github.com/doublegg1505/bachtunerproject/blob/main/src/navigation/TabsNavigator.tsx"
click node_home "https://github.com/doublegg1505/bachtunerproject/blob/main/src/screens/Home.tsx"
click node_pitch "https://github.com/doublegg1505/bachtunerproject/blob/main/src/utils/audioProcessor.ts"
click node_metronome "https://github.com/doublegg1505/bachtunerproject/blob/main/src/components/MetronomeModal.tsx"
click node_login "https://github.com/doublegg1505/bachtunerproject/blob/main/src/screens/Login.tsx"
click node_register "https://github.com/doublegg1505/bachtunerproject/blob/main/src/screens/Register.tsx"
click node_profile "https://github.com/doublegg1505/bachtunerproject/blob/main/src/screens/features/user-settings/Profile.tsx"
click node_auth "https://github.com/doublegg1505/bachtunerproject/blob/main/src/context/AuthContext.tsx"
click node_supabase "https://github.com/doublegg1505/bachtunerproject/blob/main/src/lib/supabase.ts"
click node_repertoire "https://github.com/doublegg1505/bachtunerproject/blob/main/src/screens/features/Repertoire.tsx"
click node_strings "https://github.com/doublegg1505/bachtunerproject/blob/main/src/screens/MyStrings.tsx"
click node_store "https://github.com/doublegg1505/bachtunerproject/blob/main/src/store/index.ts"
click node_userslice "https://github.com/doublegg1505/bachtunerproject/blob/main/src/store/slices/userSlice.ts"
click node_repslice "https://github.com/doublegg1505/bachtunerproject/blob/main/src/store/slices/repertoireSlice.ts"
click node_stringsslice "https://github.com/doublegg1505/bachtunerproject/blob/main/src/store/slices/stringsSlice.ts"
click node_theme "https://github.com/doublegg1505/bachtunerproject/blob/main/src/context/ThemeContext.tsx"
click node_colors "https://github.com/doublegg1505/bachtunerproject/blob/main/src/theme/colors.ts"
click node_button "https://github.com/doublegg1505/bachtunerproject/blob/main/src/components/CustomButton.tsx"
click node_input "https://github.com/doublegg1505/bachtunerproject/blob/main/src/components/CustomInput.tsx"

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,node_stack,node_tabs,node_button,node_input toneBlue
class node_home,node_pitch,node_metronome toneAmber
class node_login,node_register,node_profile,node_auth,node_supabase toneMint
class node_repertoire,node_strings toneRose
class node_store,node_userslice,node_repslice,node_stringsslice,node_theme,node_colors,node_user toneIndigo
```

## Components

### App Shell

- [App Root](https://github.com/doublegg1505/bachtunerproject/blob/main/App.tsx): `App.tsx`
- [Stack Navigation](https://github.com/doublegg1505/bachtunerproject/blob/main/src/navigation/StackNavigator.tsx): `src/navigation/StackNavigator.tsx`
- [Feature Tabs](https://github.com/doublegg1505/bachtunerproject/blob/main/src/navigation/TabsNavigator.tsx): `src/navigation/TabsNavigator.tsx`
- [Shared Button](https://github.com/doublegg1505/bachtunerproject/blob/main/src/components/CustomButton.tsx): `src/components/CustomButton.tsx`
- [Shared Input](https://github.com/doublegg1505/bachtunerproject/blob/main/src/components/CustomInput.tsx): `src/components/CustomInput.tsx`

### Tuning Practice

- [Tuner Screen](https://github.com/doublegg1505/bachtunerproject/blob/main/src/screens/Home.tsx): `src/screens/Home.tsx`
- [Pitch Detection](https://github.com/doublegg1505/bachtunerproject/blob/main/src/utils/audioProcessor.ts): `src/utils/audioProcessor.ts`
- [Metronome](https://github.com/doublegg1505/bachtunerproject/blob/main/src/components/MetronomeModal.tsx): `src/components/MetronomeModal.tsx`

### Accounts

- [Sign In](https://github.com/doublegg1505/bachtunerproject/blob/main/src/screens/Login.tsx): `src/screens/Login.tsx`
- [Registration](https://github.com/doublegg1505/bachtunerproject/blob/main/src/screens/Register.tsx): `src/screens/Register.tsx`
- [Profile Settings](https://github.com/doublegg1505/bachtunerproject/blob/main/src/screens/features/user-settings/Profile.tsx): `src/screens/features/user-settings/Profile.tsx`
- [Auth Context](https://github.com/doublegg1505/bachtunerproject/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [Supabase Client](https://github.com/doublegg1505/bachtunerproject/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`

### Practice Library

- [Repertoire](https://github.com/doublegg1505/bachtunerproject/blob/main/src/screens/features/Repertoire.tsx): `src/screens/features/Repertoire.tsx`
- [String Inventory](https://github.com/doublegg1505/bachtunerproject/blob/main/src/screens/MyStrings.tsx): `src/screens/MyStrings.tsx`

### App State

- [Redux Store](https://github.com/doublegg1505/bachtunerproject/blob/main/src/store/index.ts): `src/store/index.ts`
- [User State](https://github.com/doublegg1505/bachtunerproject/blob/main/src/store/slices/userSlice.ts): `src/store/slices/userSlice.ts`
- [Repertoire State](https://github.com/doublegg1505/bachtunerproject/blob/main/src/store/slices/repertoireSlice.ts): `src/store/slices/repertoireSlice.ts`
- [Inventory State](https://github.com/doublegg1505/bachtunerproject/blob/main/src/store/slices/stringsSlice.ts): `src/store/slices/stringsSlice.ts`
- [Theme Context](https://github.com/doublegg1505/bachtunerproject/blob/main/src/context/ThemeContext.tsx): `src/context/ThemeContext.tsx`
- [Theme Palettes](https://github.com/doublegg1505/bachtunerproject/blob/main/src/theme/colors.ts): `src/theme/colors.ts`

### Other components

- **Violinist**

## Connections

- Violinist → Stack Navigation: navigates (evidence: `src/navigation/StackNavigator.tsx`)
- App Root → Stack Navigation: mounts (evidence: `App.tsx`)
- App Root → Theme Context: provides (evidence: `App.tsx`)
- App Root → Redux Store: provides (evidence: `App.tsx`)
- Stack Navigation → Tuner Screen: routes (evidence: `src/navigation/StackNavigator.tsx`)
- Stack Navigation → Sign In: routes (evidence: `src/navigation/StackNavigator.tsx`)
- Stack Navigation → Registration: routes (evidence: `src/navigation/StackNavigator.tsx`)
- Stack Navigation → Feature Tabs: routes (evidence: `src/navigation/StackNavigator.tsx`)
- Feature Tabs → Tuner Screen: routes (evidence: `src/navigation/TabsNavigator.tsx`)
- Feature Tabs → String Inventory: routes (evidence: `src/navigation/TabsNavigator.tsx`)
- Feature Tabs → Profile Settings: routes (evidence: `src/navigation/TabsNavigator.tsx`)
- Tuner Screen → Pitch Detection: detects pitch (evidence: `src/screens/Home.tsx`)
- Tuner Screen → Metronome: opens (evidence: `src/screens/Home.tsx`)
- Sign In → Supabase Client: authenticates (evidence: `src/screens/Login.tsx`)
- Registration → Supabase Client: registers (evidence: `src/screens/Register.tsx`)
- Profile Settings → Supabase Client: signs out (evidence: `src/screens/features/user-settings/Profile.tsx`)
- Profile Settings → User State: updates state (evidence: `src/screens/features/user-settings/Profile.tsx`)
- Profile Settings → Inventory State: clears inventory (evidence: `src/screens/features/user-settings/Profile.tsx`)
- Auth Context → Supabase Client: uses (evidence: `src/context/AuthContext.tsx`)
- Auth Context → User State: updates (evidence: `src/context/AuthContext.tsx`)
- Auth Context → Inventory State: updates (evidence: `src/context/AuthContext.tsx`)
- Repertoire → Repertoire State: dispatches (evidence: `src/screens/features/Repertoire.tsx`)
- String Inventory → Inventory State: uses (evidence: `src/screens/MyStrings.tsx`)
- Redux Store → User State: combines (evidence: `src/store/index.ts`)
- Redux Store → Inventory State: combines (evidence: `src/store/index.ts`)
- Redux Store → Repertoire State: combines (evidence: `src/store/index.ts`)
- Theme Context → Theme Palettes: selects palette (evidence: `src/context/ThemeContext.tsx`)
- Tuner Screen → Shared Button: renders (evidence: `src/screens/Home.tsx`)
- Repertoire → Shared Button: renders (evidence: `src/screens/features/Repertoire.tsx`)
- Repertoire → Shared Input: renders (evidence: `src/screens/features/Repertoire.tsx`)
- Profile Settings → Shared Button: renders (evidence: `src/screens/features/user-settings/Profile.tsx`)
- Profile Settings → Shared Input: renders (evidence: `src/screens/features/user-settings/Profile.tsx`)
