# fleuristes/fleur architecture

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

- Interactive diagram: https://gitdiagram.com/fleuristes/fleur
- Repository: https://github.com/fleuristes/fleur

## Overview

Based on our analysis of the file tree and README, Fleur is a desktop application marketplace for MCPs. This project leverages a full-stack architecture with a clear separation between the frontend and the backend. The frontend is implemented in React/TypeScript (under the “src” directory) and the backend is built with Rust using Tauri (found in “src-tauri”). Additionally, the project makes use of Bun as a package manager and build runner for the Node.js/Yarn ecosystem, while Rust and Cargo handle the backend dependencies.

- Frontend: Represented by the “src” directory, which contains React/TypeScript components, routes, store, and types. This is responsible for the User Interface, application state management, and client-side interactions.
- Tauri Backend: Identify the “src-tauri” directory, which holds all Rust code such as main.rs, lib.rs, and various modules (like clients, file_utils, environment). This layer handles system calls, communicates with the OS, and manages application-level operations.
- Build and Configuration Tools: Include Bun (with its package.json, bun.lock, etc.), Tauri configurations (tauri.conf.json), and scripts (e.g., installation, release, test, sign_app).
- App Registry: Although the actual registry is maintained in a separate repository (app-registry), it is a core part of the system functionality and should be represented in the overall design as an external service.
- External Tools & Services: Consider the roles of GitHub workflows (under .github) for testing/CI and other external integrations such as release scripts for signing and packaging.

##### Establish the interactions and relationships
- How static assets are loaded and served to the frontend.
- Use of external development tools/build scripts (installation, testing, build processes) that contribute to both the frontend and the backend.

##### Architectural patterns or design principles
- Separation of Concerns: Clearly separate the UI (React) from the system-level operations (Rust/Tauri).
- Modular Design: Note the modular structure within both “src” and “src-tauri” directories, where each concern (UI components, app configurations, utilities, tests) is handled in its dedicated space.
- Extensibility: Represent how the marketplace is designed to be extensible for non-technical users as well as developers (for example, through the app registry integration).

##### Relevant technologies, frameworks, and libraries
- React/TypeScript for the frontend.
- Rust with Tauri for desktop application logic.
- Bun as a modern package manager/build tool.
- Cargo for Rust dependency management.
- Additional tools such as VS Code (recommended IDE), as well as test frameworks in Rust (cargo test) and Node/Bun for frontend testing.

##### Suggested elements
- A representation of “External Services/Repositories”, including the “App Registry”, which may interface with the core marketplace.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Frontend Layer"
        FE["Frontend (React/TypeScript)"]:::frontend
    end

    %% Backend Layer
    subgraph "Backend Layer"
        BE["Tauri Backend (Rust)"]:::backend
    end

    %% Static Assets
    subgraph "Static Assets"
        PA["Public (Images/Icons)"]:::assets
        DO["Documentation (docs)"]:::assets
    end

    %% Build & Configuration Tools
    subgraph "Build & Config Tools"
        PK["package.json"]:::tools
        BL["bun.lock"]:::tools
        TC["tauri.conf.json"]:::tools
        subgraph "Scripts"
            S1["create_signed_dmg.sh"]:::tools
            S2["release.sh"]:::tools
            S3["sign_app.sh"]:::tools
            S4["scripts/start"]:::tools
            S5["scripts/test"]:::tools
        end
    end

    %% App Registry
    AR["App Registry"]:::tools

    %% External Tools & Services
    XT["GitHub Workflows"]:::external

    %% Connections between Frontend and Backend
    FE -->|"IPC/API_calls_via_Tauri"| BE

    %% Connections to Static Assets
    FE -->|"Loads_static_assets"| PA
    FE -->|"Loads_static_assets"| DO
    BE -->|"Accesses_static_assets"| PA
    BE -->|"Accesses_static_assets"| DO

    %% App Registry connection
    BE -->|"MCP_metadata_flow"| AR

    %% External Tools triggering Build Tools (CI integration)
    XT -->|"Triggers_builds"| PK
    XT -->|"Triggers_builds"| BL
    XT -->|"Triggers_builds"| TC

    %% Build Tools used by Frontend and Backend
    PK -->|"Builds_frontend"| FE
    BL -->|"Builds_frontend"| FE
    PK -->|"Builds_backend"| BE
    BL -->|"Builds_backend"| BE
    TC -->|"Configures_backend"| BE
    S1 -->|"Executes_for_frontend"| FE
    S2 -->|"Executes_for_frontend"| FE
    S3 -->|"Executes_for_backend"| BE
    S4 -->|"Starts_frontend"| FE
    S5 -->|"Tests_frontend"| FE

    %% Click Events
    click FE "https://github.com/fleuristes/fleur/tree/main/src"
    click BE "https://github.com/fleuristes/fleur/tree/main/src-tauri"
    click PA "https://github.com/fleuristes/fleur/tree/main/public"
    click DO "https://github.com/fleuristes/fleur/tree/main/docs"
    click PK "https://github.com/fleuristes/fleur/blob/main/package.json"
    click BL "https://github.com/fleuristes/fleur/blob/main/bun.lock"
    click TC "https://github.com/fleuristes/fleur/blob/main/src-tauri/tauri.conf.json"
    click S1 "https://github.com/fleuristes/fleur/blob/main/scripts/create_signed_dmg.sh"
    click S2 "https://github.com/fleuristes/fleur/blob/main/scripts/release.sh"
    click S3 "https://github.com/fleuristes/fleur/blob/main/scripts/sign_app.sh"
    click S4 "https://github.com/fleuristes/fleur/tree/main/scripts/start"
    click S5 "https://github.com/fleuristes/fleur/tree/main/scripts/test"
    click AR "https://github.com/fleuristes/fleur/blob/main/src/appRegistry.ts"
    click XT "https://github.com/fleuristes/fleur/tree/main/.github/workflows"

    %% Style Definitions
    classDef frontend fill:#f9c,stroke:#333,stroke-width:2px;
    classDef backend fill:#bbf,stroke:#333,stroke-width:2px;
    classDef assets fill:#afa,stroke:#333,stroke-width:2px;
    classDef tools fill:#fea,stroke:#333,stroke-width:2px;
    classDef external fill:#eef,stroke:#333,stroke-width:2px;
```
