# robertsolorzano/track-match-client architecture

> Architecture diagram of the GitHub repository robertsolorzano/track-match-client, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/robertsolorzano/track-match-client
- Repository: https://github.com/robertsolorzano/track-match-client

## Overview

##### Project type and purpose
- This is a React Native mobile application, scaffolded with Expo (app.json, eas.json, babel.config.js).
- Its purpose is to let users search Spotify, browse their library, and view track details in a native mobile UI.
- It relies on the Spotify Web API (now deprecated) and includes a Firebase config (firebaseConfig.js) for any user-data or auth interactions.

##### File structure
- Top-level files:
- App.js – the app’s entry point
- package.json / package-lock.json – Node dependencies
- babel.config.js – transpilation settings
- eas.json – Expo Application Services build config
- firebaseConfig.js – Firebase SDK setup
- “app/” directory:
- app/navigation/ – React Navigation setup (BottomTabNavigator.jsx, LibraryStackNavigator.jsx, SearchStackNavigator.jsx)
- app/screens/ – Screen-level containers (Homescreen, LibraryHomeScreen, LibraryDetailsScreen, SearchScreen, SongInfoScreen)
- app/components/ – Reusable UI widgets (SearchBar, TrackDisplay, AudioPlayer, AlbumArt, etc.)
- app/utils/musicUtils.jsx – Spotify API request helpers, data formatting
- No backend directory – all logic lives in the client; external services handle data persistence / retrieval.

##### README
- Minimal content: “Spotify has now deprecated most APIs that was needed for this project.”
- Indicates that the core external dependency (Spotify API) is no longer available, but the architecture remains a good reference for UI → API integrations.

a. Main components
1. Client App (React Native / Expo)
- Navigation Layer
- Screens
- UI Components
- Business-logic utils
2. External Services
- Spotify Web API
- Firebase (Realtime Database / Auth)
3. Build / Deployment
- Expo EAS Build
- babel transpiler

b. Relationships & data flows
- User taps UI Components → triggers Navigation → loads Screen
- Screens compose Components and call musicUtils → HTTP requests to Spotify API
- auth flows or data persistence via firebaseConfig → Firebase SDK
- Expo CLI/EAS picks up App.js + dependencies → builds native binaries

c. Architectural patterns & design principles
- Layered client architecture:
– Presentation (Components)
– Container (Screens)
– Routing (React Navigation)
– Services/Utils (API wrappers)
- Single responsibility per component
- Separation of concerns between navigation, UI, and data-fetch logic

d. Key technologies & frameworks
- React Native + Expo
- React Navigation
- Spotify Web API
- Firebase JS SDK
- EAS Build, Babel

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Build and Config Layer
    subgraph "Build & Configuration" 
        direction TB
        ExpoConfig["app.json"]:::config
        EASConfig["eas.json"]:::config
        BabelConfig["babel.config.js"]:::config
        FirebaseConfig["firebaseConfig.js"]:::config
        ExpoConfig -->|used by| EASBuild["EAS Build"]:::tool
        BabelConfig -->|transpiled by| Babel["Babel"]:::tool
    end

    %% Client Application Layer
    subgraph "Client App (React Native / Expo)"
        direction TB
        AppEntry["App.js"]:::entry

        subgraph "Navigation Layer"
            direction TB
            BottomTab["BottomTabNavigator.jsx"]:::frontend
            LibraryStack["LibraryStackNavigator.jsx"]:::frontend
            SearchStack["SearchStackNavigator.jsx"]:::frontend
        end

        subgraph "Screens Layer"
            direction TB
            HomeScreen["Homescreen.jsx"]:::frontend
            LibraryHome["LibraryHomeScreen.jsx"]:::frontend
            LibraryDetails["LibraryDetailsScreen.jsx"]:::frontend
            SearchScreen["SearchScreen.jsx"]:::frontend
            SongInfo["SongInfoScreen.jsx"]:::frontend
        end

        subgraph "UI Components"
            direction TB
            AdditionalInfo["AdditionalInfo.jsx"]:::frontend
            AlbumArt["AlbumArt.jsx"]:::frontend
            AlbumArtFlip["AlbumArtFlip.jsx"]:::frontend
            AlbumArtLayer["AlbumArtLayer.jsx"]:::frontend
            AudioFeatures["AudioFeatures.jsx"]:::frontend
            AudioPlayer["AudioPlayer.jsx"]:::frontend
            CustomCircle["CustomCircle.jsx"]:::frontend
            CustomHeader["CustomHeader.jsx"]:::frontend
            DropdownMenu["DropdownMenu.jsx"]:::frontend
            LibrarySearchBar["LibrarySearchBar.jsx"]:::frontend
            LoudnessBar["LoudnessBar.jsx"]:::frontend
            SearchBar["SearchBar.jsx"]:::frontend
            SearchResults["SearchResults.jsx"]:::frontend
            SpotifyLink["SpotifyLink.jsx"]:::frontend
            TrackDetails["TrackDetails.jsx"]:::frontend
            TrackDisplay["TrackDisplay.jsx"]:::frontend
            TrackElement["TrackElement.jsx"]:::frontend
            TrackInfo["TrackInfo.jsx"]:::frontend
        end

        subgraph "Service/Utils Layer"
            direction TB
            MusicUtils["musicUtils.jsx"]:::service
        end

        %% Internal connections
        AppEntry -->|initializes| BottomTab
        AppEntry -->|initializes| LibraryStack
        AppEntry -->|initializes| SearchStack

        BottomTab -->|navigates to| HomeScreen
        BottomTab -->|navigates to| LibraryHome
        BottomTab -->|navigates to| SearchScreen

        LibraryStack -->|navigates to| LibraryHome
        LibraryStack -->|navigates to| LibraryDetails

        SearchStack -->|navigates to| SearchScreen
        SearchStack -->|navigates to| SongInfo

        HomeScreen -->|renders| AdditionalInfo
        HomeScreen -->|renders| AlbumArt

        LibraryHome -->|uses| LibrarySearchBar
        LibraryHome -->|renders| TrackDisplay

        LibraryDetails -->|renders| TrackDetails
        LibraryDetails -->|renders| AudioFeatures

        SearchScreen -->|uses| SearchBar
        SearchScreen -->|renders| SearchResults

        SongInfo -->|renders| AlbumArtLayer
        SongInfo -->|renders| TrackInfo
        SongInfo -->|renders| AudioPlayer

        %% Components to Utils
        AdditionalInfo -->|gets data via| MusicUtils
        AlbumArt -->|gets data via| MusicUtils
        AudioFeatures -->|formats via| MusicUtils
        AudioPlayer -->|streams via| MusicUtils
        SearchBar -->|queries via| MusicUtils
        LibrarySearchBar -->|queries via| MusicUtils
        SearchResults -->|maps via| MusicUtils
        TrackDisplay -->|structures via| MusicUtils
        TrackDetails -->|details via| MusicUtils
        TrackElement -->|structures via| MusicUtils
        TrackInfo -->|formats via| MusicUtils

    end

    %% External Services Layer
    subgraph "External Services"
        direction TB
        SpotifyAPI["Spotify Web API"]:::external
        FirebaseDB["Firebase SDK"]:::external
    end

    %% Service connections
    MusicUtils -->|HTTP requests| SpotifyAPI
    FirebaseConfig -->|auth/persist| FirebaseDB

    %% Click Events
    click AppEntry "https://github.com/robertsolorzano/track-match-client/blob/main/App.js"
    click ExpoConfig "https://github.com/robertsolorzano/track-match-client/blob/main/app.json"
    click EASConfig "https://github.com/robertsolorzano/track-match-client/blob/main/eas.json"
    click BabelConfig "https://github.com/robertsolorzano/track-match-client/blob/main/babel.config.js"
    click FirebaseConfig "https://github.com/robertsolorzano/track-match-client/blob/main/firebaseConfig.js"
    click BottomTab "https://github.com/robertsolorzano/track-match-client/blob/main/app/navigation/BottomTabNavigator.jsx"
    click LibraryStack "https://github.com/robertsolorzano/track-match-client/blob/main/app/navigation/LibraryStackNavigator.jsx"
    click SearchStack "https://github.com/robertsolorzano/track-match-client/blob/main/app/navigation/SearchStackNavigator.jsx"
    click HomeScreen "https://github.com/robertsolorzano/track-match-client/blob/main/app/screens/Homescreen.jsx"
    click LibraryHome "https://github.com/robertsolorzano/track-match-client/blob/main/app/screens/LibraryHomeScreen.jsx"
    click LibraryDetails "https://github.com/robertsolorzano/track-match-client/blob/main/app/screens/LibraryDetailsScreen.jsx"
    click SearchScreen "https://github.com/robertsolorzano/track-match-client/blob/main/app/screens/SearchScreen.jsx"
    click SongInfo "https://github.com/robertsolorzano/track-match-client/blob/main/app/screens/SongInfoScreen.jsx"
    click AdditionalInfo "https://github.com/robertsolorzano/track-match-client/blob/main/app/components/AdditionalInfo.jsx"
    click AlbumArt "https://github.com/robertsolorzano/track-match-client/blob/main/app/components/AlbumArt.jsx"
    click AlbumArtFlip "https://github.com/robertsolorzano/track-match-client/blob/main/app/components/AlbumArtFlip.jsx"
    click AlbumArtLayer "https://github.com/robertsolorzano/track-match-client/blob/main/app/components/AlbumArtLayer.jsx"
    click AudioFeatures "https://github.com/robertsolorzano/track-match-client/blob/main/app/components/AudioFeatures.jsx"
    click AudioPlayer "https://github.com/robertsolorzano/track-match-client/blob/main/app/components/AudioPlayer.jsx"
    click CustomCircle "https://github.com/robertsolorzano/track-match-client/blob/main/app/components/CustomCircle.jsx"
    click CustomHeader "https://github.com/robertsolorzano/track-match-client/blob/main/app/components/CustomHeader.jsx"
    click DropdownMenu "https://github.com/robertsolorzano/track-match-client/blob/main/app/components/DropdownMenu.jsx"
    click LibrarySearchBar "https://github.com/robertsolorzano/track-match-client/blob/main/app/components/LibrarySearchBar.jsx"
    click LoudnessBar "https://github.com/robertsolorzano/track-match-client/blob/main/app/components/LoudnessBar.jsx"
    click SearchBar "https://github.com/robertsolorzano/track-match-client/blob/main/app/components/SearchBar.jsx"
    click SearchResults "https://github.com/robertsolorzano/track-match-client/blob/main/app/components/SearchResults.jsx"
    click SpotifyLink "https://github.com/robertsolorzano/track-match-client/blob/main/app/components/SpotifyLink.jsx"
    click TrackDetails "https://github.com/robertsolorzano/track-match-client/blob/main/app/components/TrackDetails.jsx"
    click TrackDisplay "https://github.com/robertsolorzano/track-match-client/blob/main/app/components/TrackDisplay.jsx"
    click TrackElement "https://github.com/robertsolorzano/track-match-client/blob/main/app/components/TrackElement.jsx"
    click TrackInfo "https://github.com/robertsolorzano/track-match-client/blob/main/app/components/TrackInfo.jsx"
    click MusicUtils "https://github.com/robertsolorzano/track-match-client/blob/main/app/utils/musicUtils.jsx"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#0366D6,color:#0366D6;
    classDef service fill:#DFFFE0,stroke:#28A745,color:#155724;
    classDef external fill:#FFF5CC,stroke:#FFC107,color:#856404;
    classDef config fill:#E2E3E5,stroke:#6C757D,color:#343A40;
    classDef tool fill:#F0F0F0,stroke:#A0A0A0,color:#000000;
    classDef entry fill:#CCE5FF,stroke:#0056B3,color:#004085;
```
