# versotile-org/verso architecture

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

- Interactive diagram: https://gitdiagram.com/versotile-org/verso
- Repository: https://github.com/versotile-org/verso

## Overview

##### Main Components Identification

The system should be represented with these key components:

a) Core Browser Components:
- Window Management System (src/window.rs)
- Tab Management System (src/tab.rs)
- Compositor (src/compositor.rs)
- WebView System (src/webview/)
- Configuration System (src/config.rs)
- Input Handling (keyboard.rs, touch.rs)

b) UI Components:
- Context Menus
- Prompts/Dialogs
- Media Controls
- Error Pages
- Directory Listings

c) External Dependencies:
- Servo Web Engine
- System Libraries (via Flatpak/Nix)

**[User Interface Layer]**

- Window Manager
- Tab Manager
- WebView Container
- Compositor
- Web Content

**[Core Browser Layer]**

- Configuration System
- Input Handler
- Resource Manager

**[Engine Layer]**

- Servo Engine

##### Implementation Details

- The modular structure of the webview system
- The separation between UI components and core browser logic
- The relationship with the Servo engine
- Resource handling (CSS, HTML templates, etc.)

##### Technical Notes

Notes regarding:
- Platform-specific implementations (Windows, MacOS, Linux)
- Build system integration (Flatpak, Nix)
- Development status of components

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef ui fill:#90EE90,stroke:#333,stroke-width:2px
    classDef core fill:#87CEEB,stroke:#333,stroke-width:2px
    classDef engine fill:#FFA500,stroke:#333,stroke-width:2px
    classDef input fill:#DDA0DD,stroke:#333,stroke-width:2px
    classDef future fill:#FFE4E1,stroke:#333,stroke-width:2px,stroke-dasharray: 5 5

    %% Main Layers
    subgraph UI["User Interface Layer"]
        WinMgr["Window Manager"]
        TabMgr["Tab Manager"]
        WebCont["WebView Container"]
        Comp["Compositor"]
        
        %% UI Components
        UIComp["UI Components"]
        CtxMenu["Context Menus"]
        Prompts["Prompts/Dialogs"]
        Media["Media Controls"]
        Error["Error Pages"]
        DirList["Directory Listings"]
    end

    subgraph Core["Core Browser Layer"]
        Config["Configuration System"]
        Input["Input Handler"]
        Resource["Resource Manager"]
        Browser["Browser Logic"]
        Render["Rendering System"]
        ErrorH["Error Handler"]
    end

    subgraph Engine["Engine Layer"]
        Servo["Servo Engine"]
    end

    %% Relationships
    WinMgr --> TabMgr
    TabMgr --> WebCont
    WebCont --> Comp
    WebCont --> UIComp
    UIComp --> CtxMenu
    UIComp --> Prompts
    UIComp --> Media
    UIComp --> Error
    UIComp --> DirList
    
    Input --> WinMgr
    Input --> WebCont
    Config --> Browser
    Browser --> WinMgr
    Browser --> Resource
    Resource --> WebCont
    Render --> Comp
    ErrorH --> Error
    
    WebCont --> Servo
    Comp --> Servo

    %% Future Features
    MultiWin["Multi-Window Support"]:::future
    MultiProc["Multiprocess Mode"]:::future
    Sandbox["Sandbox Implementation"]:::future
    GStream["GStreamer Integration"]:::future

    %% Click Events
    click WinMgr "https://github.com/versotile-org/verso/blob/main/src/window.rs"
    click TabMgr "https://github.com/versotile-org/verso/blob/main/src/tab.rs"
    click Comp "https://github.com/versotile-org/verso/blob/main/src/compositor.rs"
    click WebCont "https://github.com/versotile-org/verso/tree/main/src/webview/"
    click Config "https://github.com/versotile-org/verso/blob/main/src/config.rs"
    click Input "https://github.com/versotile-org/verso/blob/main/src/keyboard.rs"
    click CtxMenu "https://github.com/versotile-org/verso/blob/main/resources/components/context_menu.html"
    click Prompts "https://github.com/versotile-org/verso/tree/main/resources/components/prompt/"
    click Media "https://github.com/versotile-org/verso/blob/main/resources/media-controls.css"
    click Error "https://github.com/versotile-org/verso/blob/main/resources/neterror.html"
    click DirList "https://github.com/versotile-org/verso/blob/main/resources/directory-listing.html"
    click Browser "https://github.com/versotile-org/verso/blob/main/src/verso.rs"
    click Render "https://github.com/versotile-org/verso/blob/main/src/rendering.rs"
    click ErrorH "https://github.com/versotile-org/verso/blob/main/src/errors.rs"

    %% Style Applications
    class WinMgr,TabMgr,WebCont,Comp ui
    class Config,Input,Resource,Browser,Render,ErrorH core
    class Servo engine
    class CtxMenu,Prompts,Media,Error,DirList,UIComp ui
    class MultiWin,MultiProc,Sandbox,GStream future
```
