# foldingathome/fah-web-client-bastet architecture

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

- Interactive diagram: https://gitdiagram.com/foldingathome/fah-web-client-bastet
- Repository: https://github.com/foldingathome/fah-web-client-bastet

## Overview

##### Component Relationships

- WebSocket communications (wavy lines)

**[Web Browser]**
- ↓
**[Vue Router] ← → [App.vue]**
- ↓
**[Feature Modules]**
- Account
- Machines
- Units
- Projects
- Statistics
- ↓
**[Services Layer]**
- API
- WebSocket
- Machine Connection
- ↓
**[Utility Layer]**

##### Component Hierarchy
- Main Vue components hierarchy
- Reusable components (Button.vue, Dialog.vue, etc.)
- View components vs. utility components

##### Data Flow
- How data flows between components
- WebSocket communication paths
- Machine connection patterns

##### State Management
- How different states are managed
- Cache interaction patterns
- Data persistence methods

##### External Interactions
- Connection to Folding@home client
- External API endpoints
- WebSocket connection points

Remember to:
- Use consistent symbols and notation
- Both synchronous and asynchronous communications
- Error handling paths
- Security implementation points

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles and Classes
    classDef browser fill:#f9f,stroke:#333
    classDef vue fill:#42b883,stroke:#333,color:white
    classDef service fill:#64b5f6,stroke:#333
    classDef utility fill:#ffd54f,stroke:#333
    classDef state fill:#ce93d8,stroke:#333
    classDef ui fill:#81c784,stroke:#333

    %% Legend
    subgraph Legend
        L1[Browser]:::browser
        L2[Vue Components]:::vue
        L3[Services]:::service
        L4[Utilities]:::utility
        L5[State Management]:::state
        L6[UI Components]:::ui
    end

    %% Client Layer
    Browser[Web Browser]:::browser
    App["App.vue"]:::vue
    Router["Router"]:::vue
    MainHeader["MainHeader"]:::ui
    MainMenu["MainMenu"]:::ui

    %% Core Features Layer
    subgraph Features
        direction TB
        %% Account Management
        Account["Account Management"]:::vue
        AccountView["AccountView"]:::vue
        AccountSettings["AccountSettings"]:::vue
        AccountTeams["AccountTeams"]:::vue
        AccountAppearance["AccountAppearance"]:::vue

        %% Machine Management
        Machines["Machine Management"]:::vue
        MachinesView["MachinesView"]:::vue
        MachineView["MachineView"]:::vue
        MachineDetails["MachineDetailsView"]:::vue

        %% Units Management
        Units["Units Management"]:::vue
        UnitsView["UnitsView"]:::vue
        UnitInfo["UnitInfo"]:::vue
        UnitDetails["UnitDetailsView"]:::vue

        %% Statistics
        Stats["Statistics & Visualization"]:::vue
        StatsView["StatsView"]:::vue
        Visualization["Visualization"]:::vue
        PlotView["PlotView"]:::vue

        %% Projects
        Projects["Project Management"]:::vue
        ProjectsView["ProjectsView"]:::vue
        ProjectView["ProjectView"]:::vue
    end

    %% Communication Layer
    subgraph Communication
        API["API Service"]:::service
        WebSocket["WebSocket"]:::service
        MachConn["Machine Connection"]:::service
        DirectMachConn["Direct Machine Connection"]:::service
        NodeMachConn["Node Machine Connection"]:::service
    end

    %% Utility Layer
    subgraph Utilities
        Cache["Cache System"]:::utility
        Crypto["Crypto Operations"]:::utility
        BIP39["BIP39"]:::utility
        Utils["Utilities"]:::utility
    end

    %% State Management
    subgraph State
        MachineState["Machines State"]:::state
        ProjectState["Projects State"]:::state
        StatsState["Statistics State"]:::state
    end

    %% Relationships
    Browser --> App
    App --> Router
    App --> MainHeader
    App --> MainMenu
    Router --> Features
    Features --> Communication
    Communication --> Utilities
    Communication --> State

    %% Click Events
    click App "https://github.com/FoldingAtHome/fah-web-client-bastet/blob/main/src/App.vue"
    click Router "https://github.com/FoldingAtHome/fah-web-client-bastet/blob/main/src/router.js"
    click AccountView "https://github.com/FoldingAtHome/fah-web-client-bastet/blob/main/src/AccountView.vue"
    click AccountSettings "https://github.com/FoldingAtHome/fah-web-client-bastet/blob/main/src/AccountSettings.vue"
    click AccountTeams "https://github.com/FoldingAtHome/fah-web-client-bastet/blob/main/src/AccountTeams.vue"
    click AccountAppearance "https://github.com/FoldingAtHome/fah-web-client-bastet/blob/main/src/AccountAppearance.vue"
    click MachinesView "https://github.com/FoldingAtHome/fah-web-client-bastet/blob/main/src/MachinesView.vue"
    click MachineView "https://github.com/FoldingAtHome/fah-web-client-bastet/blob/main/src/MachineView.vue"
    click MachineDetails "https://github.com/FoldingAtHome/fah-web-client-bastet/blob/main/src/MachineDetailsView.vue"
    click UnitsView "https://github.com/FoldingAtHome/fah-web-client-bastet/blob/main/src/UnitsView.vue"
    click UnitInfo "https://github.com/FoldingAtHome/fah-web-client-bastet/blob/main/src/UnitInfo.vue"
    click UnitDetails "https://github.com/FoldingAtHome/fah-web-client-bastet/blob/main/src/UnitDetailsView.vue"
    click StatsView "https://github.com/FoldingAtHome/fah-web-client-bastet/blob/main/src/StatsView.vue"
    click Visualization "https://github.com/FoldingAtHome/fah-web-client-bastet/blob/main/src/Visualization.vue"
    click PlotView "https://github.com/FoldingAtHome/fah-web-client-bastet/blob/main/src/PlotView.vue"
    click ProjectsView "https://github.com/FoldingAtHome/fah-web-client-bastet/blob/main/src/ProjectsView.vue"
    click ProjectView "https://github.com/FoldingAtHome/fah-web-client-bastet/blob/main/src/ProjectView.vue"
    click API "https://github.com/FoldingAtHome/fah-web-client-bastet/blob/main/src/api.js"
    click WebSocket "https://github.com/FoldingAtHome/fah-web-client-bastet/blob/main/src/sock.js"
    click MachConn "https://github.com/FoldingAtHome/fah-web-client-bastet/blob/main/src/mach-connection.js"
    click DirectMachConn "https://github.com/FoldingAtHome/fah-web-client-bastet/blob/main/src/direct-mach-conn.js"
    click NodeMachConn "https://github.com/FoldingAtHome/fah-web-client-bastet/blob/main/src/node-mach-conn.js"
    click Cache "https://github.com/FoldingAtHome/fah-web-client-bastet/blob/main/src/cache.js"
    click Crypto "https://github.com/FoldingAtHome/fah-web-client-bastet/blob/main/src/crypto.js"
    click BIP39 "https://github.com/FoldingAtHome/fah-web-client-bastet/blob/main/src/bip39.js"
    click Utils "https://github.com/FoldingAtHome/fah-web-client-bastet/blob/main/src/util.js"
    click MainHeader "https://github.com/FoldingAtHome/fah-web-client-bastet/blob/main/src/MainHeader.vue"
    click MainMenu "https://github.com/FoldingAtHome/fah-web-client-bastet/blob/main/src/MainMenu.vue"
```
