# meetfranz/franz architecture

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

- Interactive diagram: https://gitdiagram.com/meetfranz/franz
- Repository: https://github.com/meetfranz/franz

## Overview

##### Main Components

a. Frontend Layer:
- React-based UI components (src/components)
- Features modules (src/features)
- Stores for state management (src/stores)
- Theme system (packages/theme)
- Form components (packages/forms)
- UI components (packages/ui)

b. Electron Layer:
- Main Process (src/electron)
- IPC API handlers (src/electron/ipc-api)
- Browser View Manager
- Window Management

c. Service Integration Layer:
- Recipe System (for service integration)
- Service Handlers
- Webview Components
- Service Cache

d. Core Features:
- Authentication System
- Workspace Management
- Spellchecker
- Desktop Notifications
- Multi-language Support (i18n)

**[User Interface Layer]**
- ↑↓
**[Feature Modules Layer]**
- ↑↓
**[Store/State Management Layer]**
- ↑↓
**[Electron Bridge Layer]**
- ↑↓
**[System Integration Layer]**

##### Component Relationships

- Blue: Core application components
- Green: Service integration components
- Orange: Feature modules
- Purple: System integration

##### Key Elements to Highlight

a. Process Communication:
- Main Process ↔ Renderer Process communication
- IPC channels
- Service WebViews

b. Data Flow:
- User interactions
- Service message handling
- State updates
- Configuration management

##### Implementation Details

**[UI Components] → [Feature Modules] → [Stores]**
- ↑               ↑                ↑
**[Electron IPC] ← [Main Process] → [Service Integration]**
- ↑                              ↑
**[System APIs] ← -------------------- [Services]**

##### Additional Elements

- Annotations for key architectural decisions
- Configuration flow
- Third-party service connections

##### Technical Stack Indicators

Technology badges or labels for:
- Electron
- React
- MobX (for stores)
- TypeScript (for typed components)
- WebView components
- Native OS integration points

Remember to highlight the extensibility points where new services can be integrated through the recipe system, as this is a key feature of Franz.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        UI["UI Components"]
        Forms["Form System"]
        Theme["Theme System"]
        Features["Feature Modules"]
        Stores["State Management"]
        Auth["Authentication System"]
        I18n["Multi-language Support"]
    end

    subgraph Electron
        Main["Main Process"]
        IPC["IPC API Handlers"]
        BrowserMgr["Browser View Manager"]
        Window["Window Management"]
    end

    subgraph Services
        Recipe["Recipe System"]
        ServiceHandler["Service Handlers"]
        WebView["Webview System"]
        Cache["Service Cache"]
    end

    subgraph Features
        Workspace["Workspace Management"]
        Spell["Spellchecker"]
        Notify["Desktop Notifications"]
    end

    %% Relationships
    UI --> Forms
    UI --> Theme
    UI --> Features
    Features --> Stores
    Stores --> IPC
    IPC --> Main
    Main --> BrowserMgr
    Main --> Window
    ServiceHandler --> Recipe
    WebView --> ServiceHandler
    Cache --> ServiceHandler
    Auth --> Stores
    Features --> Auth
    Workspace --> Stores
    Spell --> Main
    WebView --> Notify
    I18n --> UI

    %% Click events
    click UI "https://github.com/meetfranz/franz/tree/master//packages/ui/src"
    click Forms "https://github.com/meetfranz/franz/tree/master//packages/forms/src"
    click Theme "https://github.com/meetfranz/franz/tree/master//packages/theme/src"
    click Features "https://github.com/meetfranz/franz/tree/master//src/features"
    click Stores "https://github.com/meetfranz/franz/tree/master//src/stores"
    click Main "https://github.com/meetfranz/franz/tree/master//src/electron"
    click IPC "https://github.com/meetfranz/franz/tree/master//src/electron/ipc-api"
    click BrowserMgr "https://github.com/meetfranz/franz/blob/master//src/electron/ipc-api/browserViewManager.ts"
    click ServiceHandler "https://github.com/meetfranz/franz/tree/master//src/components/services/content"
    click WebView "https://github.com/meetfranz/franz/tree/master//src/webview"
    click Auth "https://github.com/meetfranz/franz/tree/master//src/components/auth"
    click Workspace "https://github.com/meetfranz/franz/tree/master//src/features/workspaces"
    click Spell "https://github.com/meetfranz/franz/tree/master//src/features/spellchecker"
    click I18n "https://github.com/meetfranz/franz/tree/master//src/i18n"
    click Recipe "https://github.com/meetfranz/franz/blob/master//src/models/Recipe.js"
    click Notify "https://github.com/meetfranz/franz/blob/master//src/webview/notifications.js"

    %% Styling
    classDef frontend fill:#e1f5fe,stroke:#01579b
    classDef electron fill:#fff3e0,stroke:#ff6f00
    classDef services fill:#e8f5e9,stroke:#2e7d32
    classDef features fill:#fce4ec,stroke:#c2185b

    class UI,Forms,Theme,Features,Stores,Auth,I18n frontend
    class Main,IPC,BrowserMgr,Window electron
    class Recipe,ServiceHandler,WebView,Cache services
    class Workspace,Spell,Notify features
```
