How yacinebkt/modulo-editor works
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: Editor.tsx Block editor · server.ts API server · index.tsx Lists · file.routes.ts File routes
Components 24
Editor runtime
- Block editor
packages/core/src/components/Editor.tsx
Content tools
- Text blocks
packages/core/src/tools/ParagraphTool/index.tsx - Headings
packages/core/src/tools/HeadingTool/index.tsx - Lists
packages/core/src/tools/ListTool/index.tsx - Image and gallery
packages/core/src/tools/ImageTool/index.tsx - Attachments
packages/core/src/tools/AttachmentTool/index.tsx - Tables and quotes
packages/core/src/tools/TableTool/index.tsx - Links and embeds
packages/core/src/tools/LinkTool/index.tsx - Other block tools
packages/core/src/tools/RawHTMLTool/index.tsx
State and presentation
- Editor state
packages/core/src/store/editorStore.ts - Edit history
packages/core/src/store/historyStore.ts - Rich text toolbar
packages/core/src/components/RichTextToolbar.tsx - Theme defaults
packages/core/src/theme/defaultTheme.ts
Content API
- Express API
apps/api/src/app.ts - Content routes
apps/api/src/routes/content.routes.ts - Content operations
apps/api/src/controllers/content.controller.ts - Content records
apps/api/src/models/Content.ts - MongoDB connection
apps/api/src/config/db.ts - API server
apps/api/src/server.ts
File handling
- File routes
apps/api/src/routes/file.routes.ts - File operations
apps/api/src/controllers/file.controller.ts - File records
apps/api/src/models/File.ts - Cloudinary storage
apps/api/src/config/cloudinary.ts
Other components
- Editor user
Connections 25
- Editor user → Block editor: edits content
README.md - Block editor → Text blocks: configures tools
README.md - Block editor → Headings: configures tools
README.md - Block editor → Lists: configures tools
README.md - Block editor → Image and gallery: configures tools
README.md - Block editor → Attachments: configures tools
README.md - Block editor → Tables and quotes: configures tools
README.md - Block editor → Links and embeds: configures tools
README.md - Block editor → Other block tools: configures tools
README.md - Block editor → Editor state: manages state
- Editor state → Edit history: uses history
packages/core/src/store/editorStore.ts - Lists → Rich text toolbar: renders toolbar
packages/core/src/tools/ListTool/index.tsx - Lists → Editor state: reads and updates
packages/core/src/tools/ListTool/index.tsx - Block editor → Theme defaults: accepts theming
README.md - Express API → Content routes: mounts routes
apps/api/src/app.ts - Express API → File routes: mounts routes
apps/api/src/app.ts - Content routes → Content operations: dispatches requests
apps/api/src/routes/content.routes.ts - Content operations → Content records: reads and writes
apps/api/src/controllers/content.controller.ts - File routes → File operations: dispatches requests
apps/api/src/routes/file.routes.ts - File routes → Cloudinary storage: configures uploads
apps/api/src/routes/file.routes.ts - File operations → File records: reads and writes
apps/api/src/controllers/file.controller.ts - File operations → Cloudinary storage: deletes remote file
apps/api/src/controllers/file.controller.ts - API server → Express API: starts app
apps/api/src/server.ts - API server → MongoDB connection: connects database
apps/api/src/server.ts - API server → Cloudinary storage: configures service
apps/api/src/server.ts