A visual drag-and-drop tool for designing Magento 2 module architectures. Built on the Flowy library, it lets you compose module components on a canvas, configure them via a properties panel, and export an AI-friendly JSON specification for code generation.
Project can run from any broswer. Open Index.html
No build step required - pure HTML/CSS/JS.
- Drag component blocks from the sidebar onto the canvas
- Click a block to configure it in the properties panel
- Connect blocks by dragging children onto parents (Flowy tree structure)
- Export the design as JSON (Ctrl+E) or copy to clipboard (Ctrl+Shift+C)
The exported JSON includes:
- Module identity (vendor, name, namespace, composer name)
- All components with their configuration
- File manifest - complete list of files with Magento-convention paths (e.g.
app/code/Vendor/Module/Model/Post.php) - Auto-detected dependencies (e.g. admin blocks add
Magento_Backend) - Phased AI instructions - ordered generation steps matching Magento's dependency chain (Foundation -> Database -> API Contracts -> Models -> DI -> Frontend -> Admin -> API)
- Validation warnings
| Category | Color | Blocks |
|---|---|---|
| Foundation | Blue | Module Registration |
| Data | Amber | Database Schema, Model/Entity, Repository, Data Patch |
| Routes | Green | Frontend Controller, Admin Controller, Custom Router |
| Logic | Purple | Plugin, Observer, Cron Job, CLI Command, ViewModel |
| Config | Cyan | System Config, ACL Resource, Admin Menu |
| API | Pink | REST API, GraphQL, Message Queue |
| Frontend | Orange | UI Component, jQuery Widget, JS Mixin, Admin Grid, Admin Form |
The builder infers sensible defaults from naming conventions:
- Column type inference:
*_id-> int,is_*-> boolean,*_at-> timestamp,price-> decimal(12,4),content-> text - Table name suggestions: Entity "BlogPost" in Acme/Blog ->
acme_blog_blog_post - Route front name: Derived from module name
- ACL resource IDs: Suggested from vendor/module
- Composer package name: Auto-generated as
vendor/module-name
The builder warns you about common issues:
- Missing Module Registration block
- Empty vendor/module name
- Model without Database Schema
- Repository without Model
- Admin Controller without ACL Resource
- Admin Grid/Form without Model
- Missing required fields per block type
Warnings appear as a badge in the navbar and orange borders on affected blocks.
| Shortcut | Action |
|---|---|
Ctrl/Cmd + E |
Export as JSON file |
Ctrl/Cmd + Shift + C |
Copy JSON to clipboard |
Escape |
Close panel/modal |
magento-module-builder/
index.html # App shell - 7-category sidebar, canvas, properties panel
css/styles.css # Dark theme with Magento orange accent (#f26322)
js/
blocks.js # 24 block definitions + sidebar/canvas rendering
smart-defaults.js # Column inference, naming conventions, file path resolution
properties.js # Property forms for all 24 block types
validators.js # Module validation rules + warning UI
exporter.js # JSON export with file manifest + AI instructions
main.js # App initialization, Flowy callbacks, event wiring
lib/
flowy.js # Flowy library (drag-and-drop tree builder)
flowy.css # Flowy styles
The exported JSON is designed to be fed directly to an AI coding assistant:
{
"version": "1.0",
"tool": "magento-module-builder",
"module": {
"vendor": "Acme",
"name": "Blog",
"fullName": "Acme_Blog",
"namespace": "Acme\\Blog",
"composerName": "acme/module-blog"
},
"components": [ ... ],
"architecture": {
"layers": { "foundation": [], "data": [], "routing": [], ... },
"dependencies": { "autoDetected": ["Magento_Backend"], "userSpecified": [] }
},
"fileManifest": {
"totalFiles": 12,
"basePath": "app/code/Acme/Blog",
"files": [ "app/code/Acme/Blog/registration.php", ... ],
"byDirectory": { ... }
},
"aiInstructions": [
{ "phase": 1, "phaseName": "Foundation", "instruction": "Create module foundation..." },
{ "phase": 2, "phaseName": "Database", "instruction": "Create db_schema.xml..." }
]
}- system-designer - The generic system architecture builder this project is based on, which is not currently available on github
- Magento 2 skill files (
~/.claude/skills/m2-generate/) - Reference patterns for M2 module generation
- ** Will be adding 3 claude skill files to the repository shortly
- This project will be updated to expand functionality, add blocks, validations, definitions