# marcelo-maga/code-modrinth architecture

> Architecture diagram of the GitHub repository marcelo-maga/code-modrinth, 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/marcelo-maga/code-modrinth
- Repository: https://github.com/marcelo-maga/code-modrinth

## Overview

##### Main Components
- Web Interface: Represented primarily by the frontend code in apps/frontend (built using Nuxt/Vue) and its supporting assets, styles, middleware, and API routes.
- Desktop App: Found in apps/app. It contains Tauri configurations along with Rust components and native integrations. Also note the daedalus_client under apps – a further client component running as a separate executable.
- Additional Clients/Utilities: Other apps such as apps/app-playground, apps/daedalus_client, labrinth, and docs. These components may have their own build pipelines and runtime logic.
- Shared Libraries and Packages: The packages folder contains several modules such as app-lib (with its own Rust code and SQL migrations), UI libraries, ESLint configurations, TSConfig presets, utilities, and more. They provide common functionality (API handling, state management, asset utilities, etc.) that are reused across the apps.
- Development & Configuration Tools: Top-level configuration files (.cargo, .github, pnpm-workspace.yaml, etc.) and CI/CD workflows. They orchestrate building, testing, and deploying across the entire monorepo.

##### Relationships and Interactions
- The desktop app interacts with native integrations, Tauri configurations (apps/app/tauri*.json, build.rs) and may also use back-end Rust modules (database, authentication, process management) within the same directory.
- Both frontend and desktop components interact with backend APIs that can be traced in routes, API helper modules (for instance, in apps/app/src/api/ and apps/daedalus_client/src).
- The CI/CD configuration (inside .github/workflows) automates builds for multiple apps, and the multi-package management via pnpm and Turbo (e.g., turbo.json) ties everything together.

##### Architectural Patterns & Technologies
- Monorepo Structure: Separation of concerns using the “apps” and “packages” directories. Each app is self-contained yet shares common code via packages.
- Full-Stack Separation: The web interface (client-side UI) is clearly split from the desktop’s backend (native Rust via Tauri) while both re-use shared modules.
- Modern Tech Stack: Note the use of Rust (for native/back-end parts), TypeScript/JavaScript (front-end code and shared utilities), Vue/Nuxt (web interface), and SQL migrations (database schema management).

##### Suggested Elements
- Under “Packages”: List key modules such as app-lib, ui, eslint-config-custom, tsconfig, and utils.

## Diagram (Mermaid)

```mermaid
graph TD
    A["Modrinth Monorepo"]

    subgraph "Apps"
        FE["Web Interface"]
        DA["Desktop App"]
        AP["App Playground"]
        DC["Daedalus Client"]
        LAB["Labrinth"]
        DOCS["Docs"]
    end

    subgraph "Packages"
        AL["Application Logic"]
        UI["UI Components"]
        UT["Utilities"]
        TS["TSConfig Presets"]
        ESL["ESLint Configuration"]
    end

    subgraph "Infrastructure"
        INF["CI/CD & Configurations"]
    end

    %% Connections from Monorepo to clusters (for overall structure)
    A --> FE
    A --> DA
    A --> AP
    A --> DC
    A --> LAB
    A --> DOCS
    A --> AL
    A --> UI
    A --> UT
    A --> TS
    A --> ESL
    A --> INF

    %% Dependencies between Apps and Shared Packages
    FE -->|"uses"| UI
    FE -->|"uses"| UT

    DA -->|"calls"| AL
    DA -->|"uses"| UI
    DA -->|"uses"| UT

    AP -->|"uses"| AL
    AP -->|"uses"| UI
    AP -->|"uses"| UT

    DC -->|"uses"| AL
    DC -->|"uses"| UI
    DC -->|"uses"| UT

    DOCS -->|"references"| UI
    DOCS -->|"references"| UT

    %% Migration connection indicating data layer
    AL -->|"migrations"| LAB

    %% Infrastructure orchestrates the build and deployment across the monorepo
    INF -->|"orchestrates"| A

    %% Click Events
    click FE "https://github.com/marcelo-maga/code-modrinth/tree/main/apps/frontend"
    click DA "https://github.com/marcelo-maga/code-modrinth/tree/main/apps/app"
    click AP "https://github.com/marcelo-maga/code-modrinth/tree/main/apps/app-playground"
    click DC "https://github.com/marcelo-maga/code-modrinth/tree/main/apps/daedalus_client"
    click LAB "https://github.com/marcelo-maga/code-modrinth/tree/main/apps/labrinth"
    click DOCS "https://github.com/marcelo-maga/code-modrinth/tree/main/apps/docs"
    click AL "https://github.com/marcelo-maga/code-modrinth/tree/main/packages/app-lib"
    click UI "https://github.com/marcelo-maga/code-modrinth/tree/main/packages/ui"
    click UT "https://github.com/marcelo-maga/code-modrinth/tree/main/packages/utils"
    click TS "https://github.com/marcelo-maga/code-modrinth/tree/main/packages/tsconfig"
    click ESL "https://github.com/marcelo-maga/code-modrinth/tree/main/packages/eslint-config-custom"
    click INF "https://github.com/marcelo-maga/code-modrinth/blob/main/.github"

    %% Styles
    classDef frontend fill:#3498db,stroke:#2c3e50,stroke-width:2px,color:#fff;
    classDef backend fill:#27ae60,stroke:#2c3e50,stroke-width:2px,color:#fff;
    classDef shared fill:#e67e22,stroke:#d35400,stroke-width:2px,color:#fff;
    classDef infra fill:#95a5a6,stroke:#7f8c8d,stroke-width:2px,color:#fff;

    %% Apply classes to nodes
    class FE,DOCS frontend;
    class DA,AP,DC,LAB backend;
    class AL,UI,UT,TS,ESL shared;
    class INF infra;
```
