# naserelziadna/doddle architecture

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

- Interactive diagram: https://gitdiagram.com/naserelziadna/doddle
- Repository: https://github.com/naserelziadna/doddle

## Overview

##### Main Components

a. Client-Side Architecture (Primary Focus)
- Flutter UI Layer
- Application Layer
- Domain Layer
- Platform-Specific Implementations

b. External Integrations
- Social Media Sharing
- Device Storage
- Google Ads Integration

##### Detailed Component Breakdown

Frontend Layer (Presentation):
- Canvas Screen (Main Drawing Interface)
- Home Screen
- Preview Screen
- About Me Screen
- To the common widgets and tools components

Application Layer:
- BrushSettingsProvider
- CanvasProvider
- ConfigProvider
- EffectsProvider
- RecorderProvider
- RouterProvider
- ThemeProvider
- Connection to Services:
- NavigationService

Domain Layer:
- Models Section:
- DrawController
- Frame
- Point
- RecorderState
- Stamp
- Effects Models
- Value Objects:
- ToolTypes

**┌─────────────────────────────────────────────────┐**
- Presentation                    │
- ┤
- Application                     │
- ┤
- Domain                        │
- ┤
- Platform Integration               │
- ┘

##### Important Flows to Highlight

Drawing Flow:
**User Input → SingleGestureRecognizer → DrawController → CanvasProvider → Sketcher → Screen**

Effect Processing:
**EffectsProvider → Various Effects (Glow/Normal/Spray) → Canvas**

Recording Flow:
**RecorderProvider → Frame Capture → Video Generation**

##### Additional Details
- A small section showing the file structure organization
- Notes about the provider pattern implementation
- Separation of concerns between layers

Remember to emphasize the reactive nature of the application through the provider pattern and how it manages the state of the drawing canvas and tools.

This architecture should be represented in a way that shows both the high-level structure and the detailed implementation of key features like the symmetrical drawing system and the brush effects pipeline.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles and Classes
    classDef presentation fill:#a8d1f0,stroke:#333,stroke-width:2px
    classDef application fill:#90EE90,stroke:#333,stroke-width:2px
    classDef domain fill:#FFE5B4,stroke:#333,stroke-width:2px
    classDef platform fill:#D3D3D3,stroke:#333,stroke-width:2px
    classDef external fill:#FFB6C1,stroke:#333,stroke-width:2px
    classDef widget fill:#B19CD9,stroke:#333,stroke-width:2px

    %% Presentation Layer
    subgraph PresentationLayer["Presentation Layer"]
        Screens["Screens"]
        subgraph ScreenComponents
            CS["Canvas Screen"]
            HS["Home Screen"]
            PS["Preview Screen"]
            AMS["About Me Screen"]
        end
        
        CommonWidgets["Common Widgets"]
        subgraph WidgetComponents
            BSP["Brush Settings Panel"]
            TW["Tools Widget"]
            RC["Recording Controls"]
            SK["Sketcher"]
        end
    end

    %% Application Layer
    subgraph ApplicationLayer["Application Layer"]
        Providers["Providers"]
        subgraph ProviderComponents
            BSProvider["Brush Settings Provider"]
            CProvider["Canvas Provider"]
            ConfigP["Config Provider"]
            EProvider["Effects Provider"]
            RProvider["Recorder Provider"]
            RouterP["Router Provider"]
            TProvider["Theme Provider"]
        end
        
        Services["Services"]
        subgraph ServiceComponents
            NS["Navigation Service"]
        end
    end

    %% Domain Layer
    subgraph DomainLayer["Domain Layer"]
        Models["Models"]
        subgraph ModelComponents
            DC["Draw Controller"]
            FR["Frame"]
            PT["Point"]
            RS["Recorder State"]
            ST["Stamp"]
            EM["Effects Models"]
            TT["Tool Types"]
        end
    end

    %% Platform Layer
    subgraph PlatformLayer["Platform Integration"]
        Android["Android"]
        iOS["iOS"]
        Web["Web"]
    end

    %% Connections
    Screens --> CommonWidgets
    CommonWidgets --> Providers
    Providers --> Models
    Services --> Providers
    Models --> PlatformLayer

    %% Click Events
    click CS "https://github.com/NaserElziadna/doddle/blob/main/lib/presentation/screens/canvas_screen/canvas_screen.dart"
    click HS "https://github.com/NaserElziadna/doddle/blob/main/lib/presentation/screens/home_screen/home_screen.dart"
    click PS "https://github.com/NaserElziadna/doddle/blob/main/lib/presentation/screens/preview_screen/preview_screen.dart"
    click AMS "https://github.com/NaserElziadna/doddle/blob/main/lib/presentation/screens/about_me_screen/about_me_page.dart"
    click SK "https://github.com/NaserElziadna/doddle/blob/main/lib/presentation/painting/sketcher.dart"
    click BSP "https://github.com/NaserElziadna/doddle/blob/main/lib/presentation/common/widgets/brush_settings/brush_settings_panel.dart"
    click TW "https://github.com/NaserElziadna/doddle/blob/main/lib/presentation/common/widgets/tools/tools_widget.dart"
    click RC "https://github.com/NaserElziadna/doddle/blob/main/lib/presentation/common/widgets/recording/recording_controls.dart"
    click BSProvider "https://github.com/NaserElziadna/doddle/blob/main/lib/application/providers/brush_settings_provider.dart"
    click CProvider "https://github.com/NaserElziadna/doddle/blob/main/lib/application/providers/canvas/canvas_provider.dart"
    click ConfigP "https://github.com/NaserElziadna/doddle/blob/main/lib/application/providers/config/config_provider.dart"
    click EProvider "https://github.com/NaserElziadna/doddle/blob/main/lib/application/providers/effects/effects_provider.dart"
    click RProvider "https://github.com/NaserElziadna/doddle/blob/main/lib/application/providers/recorder/recorder_provider.dart"
    click RouterP "https://github.com/NaserElziadna/doddle/blob/main/lib/application/providers/router/router_provider.dart"
    click TProvider "https://github.com/NaserElziadna/doddle/blob/main/lib/application/providers/theme/theme_providers.dart"
    click NS "https://github.com/NaserElziadna/doddle/blob/main/lib/application/services/navigation_service.dart"
    click DC "https://github.com/NaserElziadna/doddle/blob/main/lib/domain/models/draw_controller.dart"
    click FR "https://github.com/NaserElziadna/doddle/blob/main/lib/domain/models/frame.dart"
    click PT "https://github.com/NaserElziadna/doddle/blob/main/lib/domain/models/point.dart"
    click RS "https://github.com/NaserElziadna/doddle/blob/main/lib/domain/models/recorder_state.dart"
    click ST "https://github.com/NaserElziadna/doddle/blob/main/lib/domain/models/stamp.dart"
    click EM "https://github.com/NaserElziadna/doddle/tree/main/lib/domain/models/effects"
    click TT "https://github.com/NaserElziadna/doddle/blob/main/lib/domain/value_objects/tool_types.dart"
    click Android "https://github.com/NaserElziadna/doddle/tree/main/android/app/src/main"
    click iOS "https://github.com/NaserElziadna/doddle/tree/main/ios/Runner"
    click Web "https://github.com/NaserElziadna/doddle/tree/main/web"

    %% Style Applications
    class CS,HS,PS,AMS presentation
    class BSP,TW,RC,SK widget
    class BSProvider,CProvider,ConfigP,EProvider,RProvider,RouterP,TProvider,NS application
    class DC,FR,PT,RS,ST,EM,TT domain
    class Android,iOS,Web platform
```
