# darkwater/shino architecture

> Architecture diagram of the GitHub repository darkwater/shino, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/darkwater/shino
- Repository: https://github.com/darkwater/shino

## Overview

##### Main Components Identification

a) Frontend Layer (UI/Presentation)
- Pages component (/lib/pages/)
- Server Overview
- Server List
- Server Edit functionality

b) Data/Model Layer (/lib/models/)
- Core Models
- Bytes
- Command
- Filesystem
- Memory
- KeyPair
- Server-specific Models
- Server Details
- Generic Server
- MacOS Server
- NixOS Server

c) State Management Layer (/lib/providers/)
- Servers Provider

d) Platform-Specific Implementations
- Android
- iOS
- Linux
- macOS
- Windows
- Web

**┌─────────────────────────────────────────┐**
- Platform Layers              │
- (Android/iOS/Web/Desktop Platforms)    │
- ┤
- UI Layer (Pages)             │
- ┤
- State Management Layer          │
- (Providers)                  │
- ┤
- Model Layer                  │
- ┘

##### Component Relationships

Key interactions:
- Dependencies between different models (e.g., Server Details to specific server implementations)

##### Detailed Component Breakdown

Create sub-sections showing:
- Server Management Flow
- Server List → Server Edit → Server Overview
- Model Hierarchy
- Base Server → Specific Server Types
- State Management Flow
- User Actions → Provider Updates → UI Refresh

##### Notes for Implementation

- Maintain a clean, hierarchical layout
- Version information
- Notes for important architectural decisions
- Document any external service dependencies

Remember to highlight the reactive nature of the Flutter framework and how state changes propagate through the system using the provider pattern.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Platform Layer
    subgraph Platforms
        Android["Android"]:::platform
        iOS["iOS"]:::platform
        Linux["Linux"]:::platform
        macOS["macOS"]:::platform
        Windows["Windows"]:::platform
        Web["Web"]:::platform
    end

    %% UI Layer
    subgraph UI
        ServerOverview["Server Overview"]:::ui
        ServerList["Server List"]:::ui
        ServerEdit["Server Edit"]:::ui
        ServerCard["Server Card"]:::ui
    end

    %% State Management Layer
    subgraph StateManagement
        ServersProvider["Servers Provider"]:::state
    end

    %% Data/Model Layer
    subgraph Models
        %% Core Models
        BytesModel["Bytes Model"]:::model
        CommandModel["Command Model"]:::model
        FilesystemModel["Filesystem Model"]:::model
        MemoryModel["Memory Model"]:::model
        KeyPairModel["KeyPair Model"]:::model

        %% Server Models
        ServerDetails["Server Details"]:::model
        GenericServer["Generic Server"]:::model
        MacOSServer["MacOS Server"]:::model
        NixOSServer["NixOS Server"]:::model

        %% Generated Code
        ServerDetailsGen["Server Details Generated"]:::generated
        ServerDetailsFreezed["Server Details Freezed"]:::generated
        BytesGen["Bytes Generated"]:::generated
        MemoryFreezed["Memory Freezed"]:::generated
        FilesystemFreezed["Filesystem Freezed"]:::generated
        KeyPairGen["KeyPair Generated"]:::generated
    end

    %% Relationships
    Platforms --> UI
    UI --> ServersProvider
    ServersProvider --> Models
    ServerDetails --> GenericServer
    GenericServer --> MacOSServer
    GenericServer --> NixOSServer
    ServerDetails --> ServerDetailsGen
    ServerDetails --> ServerDetailsFreezed
    BytesModel --> BytesGen
    MemoryModel --> MemoryFreezed
    FilesystemModel --> FilesystemFreezed
    KeyPairModel --> KeyPairGen

    %% Click Events
    click ServerOverview "https://github.com/darkwater/shino/blob/master/lib/pages/server/overview.dart"
    click ServerList "https://github.com/darkwater/shino/blob/master/lib/pages/server_list/server_list.dart"
    click ServerEdit "https://github.com/darkwater/shino/blob/master/lib/pages/server_list/server_edit.dart"
    click ServerCard "https://github.com/darkwater/shino/blob/master/lib/pages/server_list/card.dart"
    click BytesModel "https://github.com/darkwater/shino/blob/master/lib/models/bytes.dart"
    click CommandModel "https://github.com/darkwater/shino/blob/master/lib/models/command.dart"
    click FilesystemModel "https://github.com/darkwater/shino/blob/master/lib/models/filesystem.dart"
    click MemoryModel "https://github.com/darkwater/shino/blob/master/lib/models/memory.dart"
    click KeyPairModel "https://github.com/darkwater/shino/blob/master/lib/models/keypair.dart"
    click ServerDetails "https://github.com/darkwater/shino/blob/master/lib/models/server_details.dart"
    click GenericServer "https://github.com/darkwater/shino/blob/master/lib/models/server/generic.dart"
    click MacOSServer "https://github.com/darkwater/shino/blob/master/lib/models/server/macos.dart"
    click NixOSServer "https://github.com/darkwater/shino/blob/master/lib/models/server/nixos.dart"
    click ServersProvider "https://github.com/darkwater/shino/blob/master/lib/providers/servers.dart"
    click Android "https://github.com/darkwater/shino/tree/master/android/app/src/main/"
    click iOS "https://github.com/darkwater/shino/tree/master/ios/Runner/"
    click Linux "https://github.com/darkwater/shino/tree/master/linux/"
    click macOS "https://github.com/darkwater/shino/tree/master/macos/Runner/"
    click Windows "https://github.com/darkwater/shino/tree/master/windows/runner/"
    click Web "https://github.com/darkwater/shino/tree/master/web/"
    click ServerDetailsGen "https://github.com/darkwater/shino/blob/master/lib/models/server_details.g.dart"
    click ServerDetailsFreezed "https://github.com/darkwater/shino/blob/master/lib/models/server_details.freezed.dart"
    click BytesGen "https://github.com/darkwater/shino/blob/master/lib/models/bytes.g.dart"
    click MemoryFreezed "https://github.com/darkwater/shino/blob/master/lib/models/memory.freezed.dart"
    click FilesystemFreezed "https://github.com/darkwater/shino/blob/master/lib/models/filesystem.freezed.dart"
    click KeyPairGen "https://github.com/darkwater/shino/blob/master/lib/models/keypair.g.dart"

    %% Styles
    classDef platform fill:#gray,stroke:#333,stroke-width:2px
    classDef ui fill:#blue,stroke:#333,stroke-width:2px
    classDef state fill:#orange,stroke:#333,stroke-width:2px
    classDef model fill:#green,stroke:#333,stroke-width:2px
    classDef generated fill:#purple,stroke:#333,stroke-width:2px

    %% Legend
    subgraph Legend
        Platform["Platform Component"]:::platform
        UIComponent["UI Component"]:::ui
        StateComponent["State Management"]:::state
        ModelComponent["Data Model"]:::model
        GeneratedComponent["Generated Code"]:::generated
    end
```
