# bonbon-exchange/bonbon-browser architecture

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

- Interactive diagram: https://gitdiagram.com/bonbon-exchange/bonbon-browser
- Repository: https://github.com/bonbon-exchange/bonbon-browser

## Overview

##### Main Architectural Components

a) Frontend (Renderer Process)
- React-based UI components hierarchy
- Redux store architecture
- Two main UI parts: Main App and TitleBar

b) Backend (Main Process)
- Electron main process components
- System services and utilities
- Database and storage mechanisms

c) IPC Communication Layer
- Bidirectional communication between main and renderer processes

##### Key Components

Frontend Layer:
- App Container
- TitleBar (Window Controls)
- Board Management
- Browser Components
- Tabs System
- Navigation Controls
- URL Bar
- Features
- Bookmarks
- History
- Downloads
- Extensions

Backend Layer:
- Main Process
- Window Management
- File System Operations
- Database Operations
- Extension Management
- Download Management
- Analytics System

##### Specific Implementation Details

- Blue rectangles: Core browser components
- Green rectangles: Feature modules
- Yellow diamonds: Services
- Red hexagons: Storage systems

##### Component Relationships

Key interactions:
- IPC communication between main and renderer processes
- Redux store data flow
- Extension system integration
- File system interactions
- Database operations

##### Technical Stack Indicators

Technology badges for:
- Electron
- React
- Redux
- TypeScript
- WebKit/Chromium
- SQLite (for storage)

##### Special Features

Unique features with special callouts:
- Board system architecture
- Minimap implementation
- Window snapping mechanism
- Extension system
- Multi-language support

##### Data Flow

- User interaction flow
- Data persistence paths
- IPC message routes
- Extension communication

##### Notes Section

Technical notes about:
- Security boundaries
- Process isolation
- Performance considerations
- Extension sandbox

Remember to emphasize the unique features of BonBon Browser, such as the board system, minimap, and window snapping, as these are key differentiators from traditional browsers.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Main_Process
        MainProcess[Main Process]
        WinMgmt[Window Management]
        FileOps[File System Operations]
        DB[(Database)]:::storage
        ExtMgmt[Extension Management]
        DLMgmt[Download Management]
        Analytics[Analytics System]
        Settings[Settings Backend]
    end

    subgraph IPC_Layer
        IPC[IPC Communication]
        Preload[Preload Scripts]
    end

    subgraph Frontend
        App[App Container]:::frontend
        TitleBar[TitleBar]:::frontend
        
        subgraph BrowserCore
            Tabs[Tabs System]:::frontend
            NavControls[Navigation Controls]:::frontend
            URLBar[URL/Search Bar]:::frontend
        end
        
        subgraph Features
            Board[Board Management]:::frontend
            Bookmarks[Bookmarks UI]:::frontend
            History[History UI]:::frontend
            Downloads[Downloads UI]:::frontend
            Extensions[Extensions UI]:::frontend
            SettingsUI[Settings UI]:::frontend
            Minimap[Minimap]:::frontend
        end

        subgraph State
            ReduxStore[Redux Store]:::state
            TitleBarStore[TitleBar Store]:::state
        end
    end

    %% Connections
    MainProcess --> IPC
    IPC --> App
    IPC --> TitleBar
    Preload --> IPC

    App --> ReduxStore
    TitleBar --> TitleBarStore
    
    ReduxStore --> BrowserCore
    ReduxStore --> Features

    MainProcess --> DB
    MainProcess --> Analytics
    MainProcess --> WinMgmt
    MainProcess --> FileOps
    MainProcess --> ExtMgmt
    MainProcess --> DLMgmt
    MainProcess --> Settings

    %% Styling
    classDef frontend fill:#3498db
    classDef storage fill:#e74c3c
    classDef state fill:#2ecc71

    %% Click Events
    click App "https://github.com/BonBon-exchange/bonbon-browser/blob/main/src/renderer/App/App.tsx"
    click TitleBar "https://github.com/BonBon-exchange/bonbon-browser/blob/main/src/renderer/TitleBar/TitleBar.tsx"
    click Board "https://github.com/BonBon-exchange/bonbon-browser/tree/main/src/renderer/App/components/Board/"
    click NavControls "https://github.com/BonBon-exchange/bonbon-browser/tree/main/src/renderer/App/components/BrowserControlBar/"
    click URLBar "https://github.com/BonBon-exchange/bonbon-browser/tree/main/src/renderer/App/components/SearchForm/"
    click Bookmarks "https://github.com/BonBon-exchange/bonbon-browser/tree/main/src/renderer/App/components/Bookmarks/"
    click History "https://github.com/BonBon-exchange/bonbon-browser/tree/main/src/renderer/App/components/History/"
    click Downloads "https://github.com/BonBon-exchange/bonbon-browser/tree/main/src/renderer/App/components/Downloads/"
    click Extensions "https://github.com/BonBon-exchange/bonbon-browser/tree/main/src/renderer/App/components/Extensions/"
    click Analytics "https://github.com/BonBon-exchange/bonbon-browser/tree/main/src/main/analytics/"
    click DB "https://github.com/BonBon-exchange/bonbon-browser/blob/main/src/main/db.ts"
    click IPC "https://github.com/BonBon-exchange/bonbon-browser/blob/main/src/main/ipcMainEvents.ts"
    click Preload "https://github.com/BonBon-exchange/bonbon-browser/tree/main/src/main/preload/"
    click SettingsUI "https://github.com/BonBon-exchange/bonbon-browser/tree/main/src/renderer/App/components/Settings/"
    click Settings "https://github.com/BonBon-exchange/bonbon-browser/blob/main/src/main/store.ts"
    click Minimap "https://github.com/BonBon-exchange/bonbon-browser/tree/main/src/renderer/App/components/Minimap/"
    click ReduxStore "https://github.com/BonBon-exchange/bonbon-browser/tree/main/src/renderer/App/store/"
    click TitleBarStore "https://github.com/BonBon-exchange/bonbon-browser/tree/main/src/renderer/TitleBar/store/"
```
