# brocode/fw architecture

> Architecture diagram of the GitHub repository brocode/fw, 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/brocode/fw
- Repository: https://github.com/brocode/fw

## Overview

##### Main Components

a) Core Components:
- Configuration Management System
- Workspace Manager
- Project Handler
- Shell Integration
- Git Operations Handler
- Tag Management System

b) External Integrations:
- Git Repositories
- Shell Environments (Bash, Fish, ZSH)
- IDE Integration (IntelliJ/Projectile)

**┌─ User Interface Layer ─────────────────────┐**
- CLI Interface                            │
- Shell Integration (bash/fish/zsh)        │
- ┬────────────────────────┘
- ↓
**┌─ Core Service Layer ───────────────────────┐**
- ┌─────────────┐  ┌──────────┐  ┌────────┐ │
- Workspace  │  │ Project  │  │  Tag   │ │
- Manager    │←→│ Handler  │←→│ System │ │
- ┘  └──────────┘  └────────┘ │
- ↑             ↑             ↑       │
- ┌─────────────┐  ┌──────────┐  ┌────────┐ │
- Git      │  │  Config  │  │ Setup  │ │
- Operations │←→│ Manager  │←→│ System │ │
- ┘  └──────────┘  └────────┘ │
- ┬────────────────────────┘
- ↓
**┌─ External Integration Layer ───────────────┐**
- Git Repositories                         │
- IDE Integration                         │
- Virtual Environments                     │
- ┘

##### Key Elements to Highlight

a) Configuration Flow:
- How the config system (under src/config) interacts with:
- Project definitions
- Workspace settings
- Tag configurations
- Repository metadata

b) Workspace Operations:
- Relationship between:
- Project management
- Git operations
- Shell environment setup
- Tag-based organization

c) Integration Points:
- Connections to:
- Shell environments (bash/fish/zsh)
- IDE integration (IntelliJ/Projectile)
- Git repositories

##### Implementation Details
- Configuration file locations and structure
- Workspace directory organization
- Project setup and activation flow
- Shell integration mechanisms

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef ui fill:#B3E5FC,stroke:#0288D1
    classDef core fill:#C8E6C9,stroke:#388E3C
    classDef external fill:#FFE0B2,stroke:#F57C00
    classDef config fill:#E1BEE7,stroke:#7B1FA2
    classDef shell fill:#FFCDD2,stroke:#D32F2F

    %% User Interface Layer
    subgraph UI[User Interface Layer]
        CLI[CLI Interface]
        ShellInt[Shell Integration]
    end

    %% Core Service Layer
    subgraph Core[Core Service Layer]
        %% Workspace and Project Management
        WM[Workspace Manager]:::core
        PH[Project Handler]:::core
        TS[Tag System]:::core

        %% Operations and Config
        GO[Git Operations]:::core
        CM[Config Manager]:::config
        SS[Setup System]:::core

        %% Relationships
        WM <--> PH
        PH <--> TS
        GO <--> CM
        CM <--> SS
        WM <--> GO
        PH <--> CM
    end

    %% External Integration Layer
    subgraph External[External Integration Layer]
        Git[Git Repositories]:::external
        IDE[IDE Integration]:::external
        VE[Virtual Environments]:::external
    end

    %% Inter-layer connections
    CLI --> WM
    ShellInt --> WM
    GO --> Git
    PH --> IDE
    SS --> VE

    %% Legend
    subgraph Legend
        UI_L[User Interface]:::ui
        Core_L[Core Service]:::core
        Ext_L[External Integration]:::external
        Config_L[Configuration]:::config
        Shell_L[Shell Component]:::shell
    end

    %% Click events for component mapping
    click WM "https://github.com/brocode/fw/tree/master/src/ws/"
    click PH "https://github.com/brocode/fw/tree/master/src/project/"
    click TS "https://github.com/brocode/fw/tree/master/src/tag/"
    click GO "https://github.com/brocode/fw/tree/master/src/git/"
    click CM "https://github.com/brocode/fw/tree/master/src/config/"
    click ShellInt "https://github.com/brocode/fw/tree/master/src/shell/"
    click IDE "https://github.com/brocode/fw/tree/master/src/intellij/"
    click Git "https://github.com/brocode/fw/tree/master/src/ws/github/"

    %% Additional click events for specific files
    click CM "https://github.com/brocode/fw/blob/master/src/config/settings.rs"
    click PH "https://github.com/brocode/fw/blob/master/src/config/project.rs"
    click ShellInt "https://github.com/brocode/fw/blob/master/src/shell/setup.bash"
    click ShellInt "https://github.com/brocode/fw/blob/master/src/shell/setup.fish"
    click ShellInt "https://github.com/brocode/fw/blob/master/src/shell/setup.zsh"
```
