# geniusvale/vidsqueeze architecture

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

- Interactive diagram: https://gitdiagram.com/geniusvale/vidsqueeze
- Repository: https://github.com/geniusvale/vidsqueeze

## Overview

##### Project type and purpose
- This is VidSqueeze, a cross-platform Flutter application (Android, iOS, Linux, macOS, Windows, Web) focused on video selection and compression.
- It uses the BLoC pattern for state management (video picking, compression, app settings).

##### File structure
- Platform folders (android, ios, linux, macos, windows, web) contain native shell code, build configs, platform channels, and resource assets.
- The lib folder holds the core Dart application:
– main.dart (entry point)
– bloc/ (business-logic components: app_settings_bloc, video_picker_bloc, video_compression_bloc)
– screens/ (UI screens: home_screen, settings_screen)
– widgets/ (reusable widgets: video_picker_widget, etc.)
- pubspec.yaml defines external dependencies (plugins for picking files, compression, state management).
- test/ contains widget tests.

##### README for additional insights
- It’s a starter Flutter project named VidSqueeze—no detailed architecture described.
- The name and code indicate a video-compression workflow with user settings.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Platform Shells
    subgraph "Platform Shells" 
        direction TB
        Android["Android Shell"]:::nativeShell
        iOS["iOS Shell"]:::nativeShell
        LinuxShell["Linux Shell"]:::nativeShell
        MacOSShell["macOS Shell"]:::nativeShell
        WindowsShell["Windows Shell"]:::nativeShell
        WebShell["Web Shell"]:::nativeShell
    end

    %% Flutter Engine & Embedder
    subgraph "Flutter Engine & Embedder"
        direction TB
        LinuxRegistrant["GeneratedPluginRegistrant.cc"]:::embedder
        MacRegistrant["GeneratedPluginRegistrant.swift"]:::embedder
        WinRegistrant["GeneratedPluginRegistrant.cc"]:::embedder
    end

    %% Dart Application Layer
    subgraph "Dart Application Layer"
        direction TB

        subgraph "UI Layer" 
            direction TB
            HomeScreen["HomeScreen"]:::ui
            SettingsScreen["SettingsScreen"]:::ui
            VideoPickerWidget["VideoPickerWidget"]:::ui
            WidgetsBarrel["Widgets Barrel"]:::ui
        end

        subgraph "BLoC Layer"
            direction TB
            SettingsBloc["AppSettingsBloc"]:::bloc
            VideoPickerBloc["VideoPickerBloc"]:::bloc
            VideoCompressionBloc["VideoCompressionBloc"]:::bloc
        end

        subgraph "Service/Plugin Layer"
            direction TB
            FilePickerPlugin["File Picker Plugin"]:::service
            CompressionPlugin["FFmpeg Compression Plugin"]:::service
            PreferencesPlugin["Shared Preferences Plugin"]:::service
        end
    end

    %% External Systems
    subgraph "External Systems"
        direction TB
        DeviceFS["Device File System / Media Gallery"]:::external
        NativeLibs["Native Compression Libs"]:::external
    end

    %% Flow: Video Picking
    HomeScreen -->|"Dispatch VideoPickerEvent"| VideoPickerBloc
    VideoPickerBloc -->|"Invoke file-picker plugin"| FilePickerPlugin
    FilePickerPlugin -->|"Platform Channel"| Android
    FilePickerPlugin -->|"Platform Channel"| iOS
    FilePickerPlugin -->|"Platform Channel"| LinuxShell
    FilePickerPlugin -->|"Platform Channel"| MacOSShell
    FilePickerPlugin -->|"Platform Channel"| WindowsShell
    FilePickerPlugin -->|"Platform Channel"| WebShell
    Android -->|"Return file path"| VideoPickerBloc
    iOS -->|"Return file path"| VideoPickerBloc
    LinuxShell -->|"Return file path"| VideoPickerBloc
    MacOSShell -->|"Return file path"| VideoPickerBloc
    WindowsShell -->|"Return file path"| VideoPickerBloc
    WebShell -->|"Return file path"| VideoPickerBloc
    VideoPickerBloc -->|"State Update"| HomeScreen

    %% Flow: Settings
    SettingsScreen -->|"Dispatch SettingsEvent"| SettingsBloc
    SettingsBloc -->|"Invoke shared_preferences"| PreferencesPlugin
    PreferencesPlugin -->|"Write/Read"| DeviceFS
    PreferencesPlugin -->|"Return data"| SettingsBloc
    SettingsBloc -->|"State Update"| SettingsScreen

    %% Flow: Video Compression
    HomeScreen -->|"Dispatch CompressEvent"| VideoCompressionBloc
    VideoCompressionBloc -->|"Invoke compression plugin"| CompressionPlugin
    CompressionPlugin -->|"Platform Channel"| Android
    CompressionPlugin -->|"Platform Channel"| iOS
    CompressionPlugin -->|"Platform Channel"| LinuxShell
    CompressionPlugin -->|"Platform Channel"| MacOSShell
    CompressionPlugin -->|"Platform Channel"| WindowsShell
    CompressionPlugin -->|"Platform Channel"| WebShell
    Android -->|"Stream progress/events"| VideoCompressionBloc
    iOS -->|"Stream progress/events"| VideoCompressionBloc
    LinuxShell -->|"Stream progress/events"| VideoCompressionBloc
    MacOSShell -->|"Stream progress/events"| VideoCompressionBloc
    WindowsShell -->|"Stream progress/events"| VideoCompressionBloc
    WebShell -->|"Stream progress/events"| VideoCompressionBloc
    VideoCompressionBloc -->|"State Update"| HomeScreen
    VideoCompressionBloc -->|"Save output"| DeviceFS

    %% Registrant connections
    Android --> LinuxRegistrant
    LinuxShell --> LinuxRegistrant
    MacOSShell --> MacRegistrant
    WindowsShell --> WinRegistrant

    %% Entry Point
    Entry["main.dart"]:::entry
    Entry --> HomeScreen
    Entry --> SettingsScreen

    %% Click Events
    click Android "https://github.com/geniusvale/vidsqueeze/tree/main/android/"
    click iOS "https://github.com/geniusvale/vidsqueeze/tree/main/ios/"
    click LinuxShell "https://github.com/geniusvale/vidsqueeze/tree/main/linux/"
    click MacOSShell "https://github.com/geniusvale/vidsqueeze/tree/main/macos/"
    click WindowsShell "https://github.com/geniusvale/vidsqueeze/tree/main/windows/"
    click WebShell "https://github.com/geniusvale/vidsqueeze/tree/main/web/"
    click LinuxRegistrant "https://github.com/geniusvale/vidsqueeze/blob/main/linux/flutter/generated_plugin_registrant.cc"
    click MacRegistrant "https://github.com/geniusvale/vidsqueeze/blob/main/macos/Flutter/GeneratedPluginRegistrant.swift"
    click WinRegistrant "https://github.com/geniusvale/vidsqueeze/blob/main/windows/flutter/generated_plugin_registrant.cc"
    click Entry "https://github.com/geniusvale/vidsqueeze/blob/main/lib/main.dart"
    click HomeScreen "https://github.com/geniusvale/vidsqueeze/blob/main/lib/screens/home_screen.dart"
    click SettingsScreen "https://github.com/geniusvale/vidsqueeze/blob/main/lib/screens/settings_screen.dart"
    click VideoPickerWidget "https://github.com/geniusvale/vidsqueeze/blob/main/lib/widgets/media/video_picker_widget.dart"
    click WidgetsBarrel "https://github.com/geniusvale/vidsqueeze/blob/main/lib/widgets/widgets.dart"
    click SettingsBloc "https://github.com/geniusvale/vidsqueeze/blob/main/lib/bloc/app_settings_bloc/app_settings_bloc.dart"
    click VideoPickerBloc "https://github.com/geniusvale/vidsqueeze/blob/main/lib/bloc/video_picker_bloc/video_picker_bloc.dart"
    click VideoCompressionBloc "https://github.com/geniusvale/vidsqueeze/blob/main/lib/bloc/video_compression_bloc/video_compression_bloc.dart"
    click FilePickerPlugin "https://github.com/geniusvale/vidsqueeze/blob/main/pubspec.yaml"
    click CompressionPlugin "https://github.com/geniusvale/vidsqueeze/blob/main/pubspec.yaml"
    click PreferencesPlugin "https://github.com/geniusvale/vidsqueeze/blob/main/pubspec.yaml"

    %% Styles
    classDef ui fill:#D0E6FF,stroke:#0366D6,color:#0366D6
    classDef bloc fill:#DBFFE0,stroke:#028A02,color:#028A02
    classDef service fill:#FFF5CC,stroke:#D4A017,color:#D4A017
    classDef nativeShell fill:#FFE8D0,stroke:#D2691E,color:#D2691E
    classDef embedder fill:#E8E8E8,stroke:#A0A0A0,color:#606060
    classDef external fill:#F0F0F0,stroke:#999999,color:#555555
    classDef entry fill:#FFFFFF,stroke:#000000,color:#000000
```
