# yacinebkt/modulo-editor architecture

> Architecture diagram of the GitHub repository yacinebkt/modulo-editor, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yacinebkt/modulo-editor
- Repository: https://github.com/yacinebkt/modulo-editor

## Overview

Modulo is a React block-based content editor that turns user edits into structured JSON. Its main workflow is configuring an Editor with block tools, editing content, and receiving changes through the editor API; state and history support editing and undo/redo. The repository also includes an Express API for storing content and managing uploaded files. The README documents editor capabilities that are not all represented in sampled source; those branches are included, but only evidenced connections are drawn.

Main entry points: [`packages/core/src/components/Editor.tsx`](https://github.com/yacinebkt/modulo-editor/blob/main/packages/core/src/components/Editor.tsx) (Block editor), [`apps/api/src/server.ts`](https://github.com/yacinebkt/modulo-editor/blob/main/apps/api/src/server.ts) (API server), [`packages/core/src/tools/ListTool/index.tsx`](https://github.com/yacinebkt/modulo-editor/blob/main/packages/core/src/tools/ListTool/index.tsx) (Lists), [`apps/api/src/routes/file.routes.ts`](https://github.com/yacinebkt/modulo-editor/blob/main/apps/api/src/routes/file.routes.ts) (File routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_editor["Editor runtime"]
  node_editor["Block editor<br/>[Editor.tsx]"]
end

subgraph group_tools["Content tools"]
  node_text["Text blocks<br/>[index.tsx]"]
  node_heading["Headings<br/>[index.tsx]"]
  node_lists["Lists<br/>[index.tsx]"]
  node_media["Image and gallery<br/>[index.tsx]"]
  node_attachments["Attachments<br/>[index.tsx]"]
  node_structures["Tables and quotes<br/>[index.tsx]"]
  node_interactive["Links and embeds<br/>[index.tsx]"]
  node_otherblocks["Other block tools<br/>[index.tsx]"]
end

subgraph group_state["State and presentation"]
  node_editorstate["Editor state<br/>[editorStore.ts]"]
  node_history["Edit history<br/>[historyStore.ts]"]
  node_richtext["Rich text toolbar"]
  node_theme["Theme defaults<br/>[defaultTheme.ts]"]
end

subgraph group_api["Content API"]
  node_api["Express API<br/>[app.ts]"]
  node_contentroutes["Content routes<br/>[content.routes.ts]"]
  node_contentcontroller["Content operations"]
  node_contentstore[("Content records<br/>[Content.ts]")]
  node_mongodb["MongoDB connection<br/>[db.ts]"]
  node_server["API server<br/>[server.ts]"]
end

subgraph group_files["File handling"]
  node_fileroutes["File routes<br/>[file.routes.ts]"]
  node_filecontroller["File operations<br/>[file.controller.ts]"]
  node_filestore[("File records<br/>[File.ts]")]
  node_cloudinary["Cloudinary storage<br/>[cloudinary.ts]"]
end

node_author(("Editor user"))

node_author -->|"edits content"| node_editor
node_editor -->|"configures tools"| node_text
node_editor -->|"configures tools"| node_heading
node_editor -->|"configures tools"| node_lists
node_editor -->|"configures tools"| node_media
node_editor -->|"configures tools"| node_attachments
node_editor -->|"configures tools"| node_structures
node_editor -->|"configures tools"| node_interactive
node_editor -->|"configures tools"| node_otherblocks
node_editor -.->|"manages state"| node_editorstate
node_editorstate -->|"uses history"| node_history
node_lists -->|"renders toolbar"| node_richtext
node_lists -->|"reads and updates"| node_editorstate
node_editor -->|"accepts theming"| node_theme
node_api -->|"mounts routes"| node_contentroutes
node_api -->|"mounts routes"| node_fileroutes
node_contentroutes -->|"dispatches requests"| node_contentcontroller
node_contentcontroller -->|"reads and writes"| node_contentstore
node_fileroutes -->|"dispatches requests"| node_filecontroller
node_fileroutes -->|"configures uploads"| node_cloudinary
node_filecontroller -->|"reads and writes"| node_filestore
node_filecontroller -->|"deletes remote file"| node_cloudinary
node_server -->|"starts app"| node_api
node_server -->|"connects database"| node_mongodb
node_server -->|"configures service"| node_cloudinary

click node_editor "https://github.com/yacinebkt/modulo-editor/blob/main/packages/core/src/components/Editor.tsx"
click node_text "https://github.com/yacinebkt/modulo-editor/blob/main/packages/core/src/tools/ParagraphTool/index.tsx"
click node_heading "https://github.com/yacinebkt/modulo-editor/blob/main/packages/core/src/tools/HeadingTool/index.tsx"
click node_lists "https://github.com/yacinebkt/modulo-editor/blob/main/packages/core/src/tools/ListTool/index.tsx"
click node_media "https://github.com/yacinebkt/modulo-editor/blob/main/packages/core/src/tools/ImageTool/index.tsx"
click node_attachments "https://github.com/yacinebkt/modulo-editor/blob/main/packages/core/src/tools/AttachmentTool/index.tsx"
click node_structures "https://github.com/yacinebkt/modulo-editor/blob/main/packages/core/src/tools/TableTool/index.tsx"
click node_interactive "https://github.com/yacinebkt/modulo-editor/blob/main/packages/core/src/tools/LinkTool/index.tsx"
click node_otherblocks "https://github.com/yacinebkt/modulo-editor/blob/main/packages/core/src/tools/RawHTMLTool/index.tsx"
click node_editorstate "https://github.com/yacinebkt/modulo-editor/blob/main/packages/core/src/store/editorStore.ts"
click node_history "https://github.com/yacinebkt/modulo-editor/blob/main/packages/core/src/store/historyStore.ts"
click node_richtext "https://github.com/yacinebkt/modulo-editor/blob/main/packages/core/src/components/RichTextToolbar.tsx"
click node_theme "https://github.com/yacinebkt/modulo-editor/blob/main/packages/core/src/theme/defaultTheme.ts"
click node_api "https://github.com/yacinebkt/modulo-editor/blob/main/apps/api/src/app.ts"
click node_contentroutes "https://github.com/yacinebkt/modulo-editor/blob/main/apps/api/src/routes/content.routes.ts"
click node_contentcontroller "https://github.com/yacinebkt/modulo-editor/blob/main/apps/api/src/controllers/content.controller.ts"
click node_contentstore "https://github.com/yacinebkt/modulo-editor/blob/main/apps/api/src/models/Content.ts"
click node_fileroutes "https://github.com/yacinebkt/modulo-editor/blob/main/apps/api/src/routes/file.routes.ts"
click node_filecontroller "https://github.com/yacinebkt/modulo-editor/blob/main/apps/api/src/controllers/file.controller.ts"
click node_filestore "https://github.com/yacinebkt/modulo-editor/blob/main/apps/api/src/models/File.ts"
click node_cloudinary "https://github.com/yacinebkt/modulo-editor/blob/main/apps/api/src/config/cloudinary.ts"
click node_mongodb "https://github.com/yacinebkt/modulo-editor/blob/main/apps/api/src/config/db.ts"
click node_server "https://github.com/yacinebkt/modulo-editor/blob/main/apps/api/src/server.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_editor,node_author toneBlue
class node_text,node_heading,node_lists,node_media,node_attachments,node_structures,node_interactive,node_otherblocks toneAmber
class node_editorstate,node_history,node_richtext,node_theme toneMint
class node_api,node_contentroutes,node_contentcontroller,node_contentstore,node_mongodb,node_server toneRose
class node_fileroutes,node_filecontroller,node_filestore,node_cloudinary toneIndigo
```

## Components

### Editor runtime

- [Block editor](https://github.com/yacinebkt/modulo-editor/blob/main/packages/core/src/components/Editor.tsx): `packages/core/src/components/Editor.tsx`

### Content tools

- [Text blocks](https://github.com/yacinebkt/modulo-editor/blob/main/packages/core/src/tools/ParagraphTool/index.tsx): `packages/core/src/tools/ParagraphTool/index.tsx`
- [Headings](https://github.com/yacinebkt/modulo-editor/blob/main/packages/core/src/tools/HeadingTool/index.tsx): `packages/core/src/tools/HeadingTool/index.tsx`
- [Lists](https://github.com/yacinebkt/modulo-editor/blob/main/packages/core/src/tools/ListTool/index.tsx): `packages/core/src/tools/ListTool/index.tsx`
- [Image and gallery](https://github.com/yacinebkt/modulo-editor/blob/main/packages/core/src/tools/ImageTool/index.tsx): `packages/core/src/tools/ImageTool/index.tsx`
- [Attachments](https://github.com/yacinebkt/modulo-editor/blob/main/packages/core/src/tools/AttachmentTool/index.tsx): `packages/core/src/tools/AttachmentTool/index.tsx`
- [Tables and quotes](https://github.com/yacinebkt/modulo-editor/blob/main/packages/core/src/tools/TableTool/index.tsx): `packages/core/src/tools/TableTool/index.tsx`
- [Links and embeds](https://github.com/yacinebkt/modulo-editor/blob/main/packages/core/src/tools/LinkTool/index.tsx): `packages/core/src/tools/LinkTool/index.tsx`
- [Other block tools](https://github.com/yacinebkt/modulo-editor/blob/main/packages/core/src/tools/RawHTMLTool/index.tsx): `packages/core/src/tools/RawHTMLTool/index.tsx`

### State and presentation

- [Editor state](https://github.com/yacinebkt/modulo-editor/blob/main/packages/core/src/store/editorStore.ts): `packages/core/src/store/editorStore.ts`
- [Edit history](https://github.com/yacinebkt/modulo-editor/blob/main/packages/core/src/store/historyStore.ts): `packages/core/src/store/historyStore.ts`
- [Rich text toolbar](https://github.com/yacinebkt/modulo-editor/blob/main/packages/core/src/components/RichTextToolbar.tsx): `packages/core/src/components/RichTextToolbar.tsx`
- [Theme defaults](https://github.com/yacinebkt/modulo-editor/blob/main/packages/core/src/theme/defaultTheme.ts): `packages/core/src/theme/defaultTheme.ts`

### Content API

- [Express API](https://github.com/yacinebkt/modulo-editor/blob/main/apps/api/src/app.ts): `apps/api/src/app.ts`
- [Content routes](https://github.com/yacinebkt/modulo-editor/blob/main/apps/api/src/routes/content.routes.ts): `apps/api/src/routes/content.routes.ts`
- [Content operations](https://github.com/yacinebkt/modulo-editor/blob/main/apps/api/src/controllers/content.controller.ts): `apps/api/src/controllers/content.controller.ts`
- [Content records](https://github.com/yacinebkt/modulo-editor/blob/main/apps/api/src/models/Content.ts): `apps/api/src/models/Content.ts`
- [MongoDB connection](https://github.com/yacinebkt/modulo-editor/blob/main/apps/api/src/config/db.ts): `apps/api/src/config/db.ts`
- [API server](https://github.com/yacinebkt/modulo-editor/blob/main/apps/api/src/server.ts): `apps/api/src/server.ts`

### File handling

- [File routes](https://github.com/yacinebkt/modulo-editor/blob/main/apps/api/src/routes/file.routes.ts): `apps/api/src/routes/file.routes.ts`
- [File operations](https://github.com/yacinebkt/modulo-editor/blob/main/apps/api/src/controllers/file.controller.ts): `apps/api/src/controllers/file.controller.ts`
- [File records](https://github.com/yacinebkt/modulo-editor/blob/main/apps/api/src/models/File.ts): `apps/api/src/models/File.ts`
- [Cloudinary storage](https://github.com/yacinebkt/modulo-editor/blob/main/apps/api/src/config/cloudinary.ts): `apps/api/src/config/cloudinary.ts`

### Other components

- **Editor user**

## Connections

- Editor user → Block editor: edits content (evidence: `README.md`)
- Block editor → Text blocks: configures tools (evidence: `README.md`)
- Block editor → Headings: configures tools (evidence: `README.md`)
- Block editor → Lists: configures tools (evidence: `README.md`)
- Block editor → Image and gallery: configures tools (evidence: `README.md`)
- Block editor → Attachments: configures tools (evidence: `README.md`)
- Block editor → Tables and quotes: configures tools (evidence: `README.md`)
- Block editor → Links and embeds: configures tools (evidence: `README.md`)
- Block editor → Other block tools: configures tools (evidence: `README.md`)
- Block editor → Editor state: manages state
- Editor state → Edit history: uses history (evidence: `packages/core/src/store/editorStore.ts`)
- Lists → Rich text toolbar: renders toolbar (evidence: `packages/core/src/tools/ListTool/index.tsx`)
- Lists → Editor state: reads and updates (evidence: `packages/core/src/tools/ListTool/index.tsx`)
- Block editor → Theme defaults: accepts theming (evidence: `README.md`)
- Express API → Content routes: mounts routes (evidence: `apps/api/src/app.ts`)
- Express API → File routes: mounts routes (evidence: `apps/api/src/app.ts`)
- Content routes → Content operations: dispatches requests (evidence: `apps/api/src/routes/content.routes.ts`)
- Content operations → Content records: reads and writes (evidence: `apps/api/src/controllers/content.controller.ts`)
- File routes → File operations: dispatches requests (evidence: `apps/api/src/routes/file.routes.ts`)
- File routes → Cloudinary storage: configures uploads (evidence: `apps/api/src/routes/file.routes.ts`)
- File operations → File records: reads and writes (evidence: `apps/api/src/controllers/file.controller.ts`)
- File operations → Cloudinary storage: deletes remote file (evidence: `apps/api/src/controllers/file.controller.ts`)
- API server → Express API: starts app (evidence: `apps/api/src/server.ts`)
- API server → MongoDB connection: connects database (evidence: `apps/api/src/server.ts`)
- API server → Cloudinary storage: configures service (evidence: `apps/api/src/server.ts`)
