# levish0/mofumofu architecture

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

- Interactive diagram: https://gitdiagram.com/levish0/mofumofu
- Repository: https://github.com/levish0/mofumofu

## Overview

##### Project Type and Purpose
- Mofumofu is a full-stack social blogging platform built with a microservices architecture.
- It includes:
- A web frontend (SvelteKit)
- A desktop app (Tauri + Svelte)
- A set of independent backend services (Rust, Python, Bun)
- Background processing via Celery
- Data and storage components (PostgreSQL, Redis, Meilisearch, Cloudflare R2)

##### High-Level File Structure
- Top-level directories:
- mofumofu-ui/       → Web UI (SvelteKit, TypeScript, TailwindCSS)
- mofumofu-desktop/  → Desktop app (Tauri + Svelte)
- mofumofu-backend/  → Core backend services and microservices
– src/             → Main API (Rust + Axum + SeaORM)
– tasks/           → Task API and Celery tasks (Python + FastAPI + Celery)
– markdown-service/→ Markdown rendering service (Bun + Elysia)
– migration/       → DB migration scripts (SeaORM)
- assets/            → Branding and image files
- CI/CD, Docker and deployment descriptors in .github/ and at project root.

##### Key Architecture Insights from README
- Architecture follows microservices split into layers:
Frontend Layer → API Gateway → Core Backend Services → Background Processing → Data & Storage
- Each service runs on its own port and can scale independently.
- API Gateway (Caddy or Cloudflare) routes traffic to public services.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Frontend Layer"
        WebUI["Web UI: SvelteKit"]:::frontend
        Desktop["Desktop App: Tauri + Svelte"]:::frontend
    end

    subgraph "API Gateway"
        Gateway["Load Balancer / Caddy or Cloudflare"]:::gateway
    end

    subgraph "Core Backend Services"
        MainAPI["Main API: Rust + Axum (8000)"]:::core
        Migration["DB Migrations: SeaORM"]:::core
        TasksAPI["Tasks API: Python + FastAPI (7000)"]:::core
        Markdown["Markdown Service: Bun + Elysia (6700)"]:::core
    end

    subgraph "Background Processing"
        Workers["Celery Workers"]:::background
        Beat["Celery Beat"]:::background
        Flower["Flower (Monitor)"]:::background
    end

    subgraph "Data & Storage"
        Postgres["PostgreSQL"]:::storage
        Redis["Redis"]:::storage
        Meili["Meilisearch"]:::storage
        R2["Cloudflare R2"]:::storage
    end

    WebUI --> Gateway
    Desktop --> Gateway
    Gateway --> MainAPI
    MainAPI --> Postgres
    MainAPI --> Redis
    MainAPI --> Meili
    MainAPI --> R2
    MainAPI --> TasksAPI
    MainAPI --> Markdown
    TasksAPI --> Beat
    TasksAPI --> Workers
    Workers --> Postgres
    Workers --> Meili
    Workers --> R2
    Workers --> Flower

    click WebUI "https://github.com/levish0/mofumofu/tree/main/mofumofu-ui/"
    click Desktop "https://github.com/levish0/mofumofu/tree/main/mofumofu-desktop/"
    click Gateway "https://github.com/levish0/mofumofu/blob/main/mofumofu-backend/deploy_docker-compose.yml"
    click MainAPI "https://github.com/levish0/mofumofu/tree/main/mofumofu-backend/src/"
    click Migration "https://github.com/levish0/mofumofu/tree/main/mofumofu-backend/migration/"
    click TasksAPI "https://github.com/levish0/mofumofu/tree/main/mofumofu-backend/tasks/app/api/"
    click Markdown "https://github.com/levish0/mofumofu/tree/main/mofumofu-backend/markdown-service/"
    click Workers "https://github.com/levish0/mofumofu/blob/main/mofumofu-backend/tasks/start_worker.py"
    click Beat "https://github.com/levish0/mofumofu/blob/main/mofumofu-backend/tasks/start_beat.py"
    click Flower "https://github.com/levish0/mofumofu/blob/main/mofumofu-backend/tasks/monitor_celery.py"
    click Postgres "https://github.com/levish0/mofumofu/tree/main/mofumofu-backend/src/connection/"

    classDef frontend fill:#D0E8FF,stroke:#90C8FF,stroke-width:1px
    classDef gateway fill:#DFF2D8,stroke:#A6D68D,stroke-width:1px
    classDef core fill:#FFE4C4,stroke:#FFCC99,stroke-width:1px
    classDef background fill:#E5D3FF,stroke:#C0A3FF,stroke-width:1px
    classDef storage fill:#FFF4C1,stroke:#FFE58D,stroke-width:1px
```
