# mohammadmansour200/basset-mobile architecture

> Architecture diagram of the GitHub repository mohammadmansour200/basset-mobile, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mohammadmansour200/basset-mobile
- Repository: https://github.com/mohammadmansour200/basset-mobile

## Overview

##### Main Components Identification

The system architecture should be divided into these key layers:

a. Presentation Layer
- Mobile UI Components (src/components/)
- Screens (src/screens/)
- Tabs (src/tabs/)
- Themes (src/themes/)

b. State Management Layer
- Stores (src/stores/)

c. Business Logic Layer
- Utils (src/utils/)
- FFmpeg Integration
- File System Operations

d. Platform-Specific Layer
- iOS Implementation
- Android Implementation

##### Specific Elements

Use these visual elements:

- Rectangles: UI components
- Hexagons: Stores
- Rounded rectangles: Native modules

- Blue: UI components
- Green: Business logic
- Orange: State management
- Gray: Platform-specific code

- Solid: Direct dependencies
- Double-headed: Two-way binding

##### Key Relationships to Highlight

- Media Processing Flow:
File Selection → Format Selection → Processing Options → FFmpeg Execution → Output

- State Management Flow:
User Input → Store Updates → UI Updates → File System Operations

##### Important Architectural Patterns

- MVC-like pattern with stores
- Component-based UI architecture
- Platform-specific bridge pattern
- Observer pattern for state management

##### Technical Stack Highlights

- React Native/Expo framework
- FFmpeg for media processing
- MobX or similar for state management (based on stores structure)
- Native bridges for file system access

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Legend"
        UI[UI Component]:::ui
        Store[(Store)]:::store
        Logic[Business Logic]:::logic
        Platform[Platform Layer]:::platform
        File[File System]:::file
    end

    subgraph "Presentation Layer"
        UI_Components["UI Components"]:::ui
        click UI_Components "https://github.com/mohammadmansour200/basset-mobile/tree/master/src/components/"
        
        Screens["Screen Components"]:::ui
        click Screens "https://github.com/mohammadmansour200/basset-mobile/tree/master/src/screens/"
        
        AVPlayer["Media Player"]:::ui
        click AVPlayer "https://github.com/mohammadmansour200/basset-mobile/blob/master/src/components/AVPlayer.tsx"
        
        AVControls["Media Controls"]:::ui
        click AVControls "https://github.com/mohammadmansour200/basset-mobile/blob/master/src/components/AVControls.tsx"
        
        FormatSelect["Format Selection"]:::ui
        click FormatSelect "https://github.com/mohammadmansour200/basset-mobile/blob/master/src/components/FormatSelect.tsx"
        
        CompressSlider["Compression Controls"]:::ui
        click CompressSlider "https://github.com/mohammadmansour200/basset-mobile/blob/master/src/components/CompressSlider.tsx"
        
        SettingsModal["Settings Modal"]:::ui
        click SettingsModal "https://github.com/mohammadmansour200/basset-mobile/blob/master/src/components/SettingsModal.tsx"
        
        Themes["Theme System"]:::ui
        click Themes "https://github.com/mohammadmansour200/basset-mobile/tree/master/src/themes/"
    end

    subgraph "Navigation Layer"
        TabNav["Tab Navigation"]:::ui
        click TabNav "https://github.com/mohammadmansour200/basset-mobile/tree/master/src/tabs/"
        
        subgraph "Media Processing Tabs"
            AudioToVideo["Audio To Video"]:::ui
            click AudioToVideo "https://github.com/mohammadmansour200/basset-mobile/blob/master/src/tabs/AudioToVideo.tsx"
            
            VideoToAudio["Video To Audio"]:::ui
            click VideoToAudio "https://github.com/mohammadmansour200/basset-mobile/blob/master/src/tabs/VideoToAudio.tsx"
            
            Compress["Compress"]:::ui
            click Compress "https://github.com/mohammadmansour200/basset-mobile/blob/master/src/tabs/Compress.tsx"
            
            Convert["Convert"]:::ui
            click Convert "https://github.com/mohammadmansour200/basset-mobile/blob/master/src/tabs/Convert.tsx"
            
            Quality["Quality"]:::ui
            click Quality "https://github.com/mohammadmansour200/basset-mobile/blob/master/src/tabs/Quality.tsx"
            
            Trim["Trim"]:::ui
            click Trim "https://github.com/mohammadmansour200/basset-mobile/blob/master/src/tabs/Trim.tsx"
        end
    end

    subgraph "State Management Layer"
        Stores[(State Stores)]:::store
        click Stores "https://github.com/mohammadmansour200/basset-mobile/tree/master/src/stores/"
    end

    subgraph "Business Logic Layer"
        Utils["Business Logic/Utils"]:::logic
        click Utils "https://github.com/mohammadmansour200/basset-mobile/tree/master/src/utils/"
        
        FileOps["File Operations"]:::logic
        click FileOps "https://github.com/mohammadmansour200/basset-mobile/blob/master/src/utils/fileUtils.ts"
        
        FFmpeg["FFmpeg Processing"]:::logic
        
        I18n["Internationalization"]:::logic
        click I18n "https://github.com/mohammadmansour200/basset-mobile/blob/master/i18n.tsx"
    end

    subgraph "Platform Layer"
        iOS["iOS Implementation"]:::platform
        click iOS "https://github.com/mohammadmansour200/basset-mobile/tree/master/ios/"
        
        Android["Android Implementation"]:::platform
        click Android "https://github.com/mohammadmansour200/basset-mobile/tree/master/android/"
    end

    UI_Components --> TabNav
    TabNav --> AudioToVideo & VideoToAudio & Compress & Convert & Quality & Trim
    UI_Components --> AVPlayer & AVControls & FormatSelect & CompressSlider & SettingsModal
    Screens --> UI_Components
    UI_Components --> Themes
    
    AudioToVideo & VideoToAudio & Compress & Convert & Quality & Trim --> Stores
    Stores --> FFmpeg
    FFmpeg --> FileOps
    FileOps --> iOS & Android
    
    UI_Components --> I18n
    Stores --> Utils
    Utils --> FileOps

    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef store fill:#e67e22,stroke:#d35400,color:white
    classDef logic fill:#2ecc71,stroke:#27ae60,color:white
    classDef platform fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef file fill:#34495e,stroke:#2c3e50,color:white
```
