This directory contains a detailed architectural analysis of the wwwsqldesigner project, comparing it to DrawDB's architecture and evaluating the feasibility of adding WebSocket/MCP integration.
Comprehensive deep-dive into the wwwsqldesigner codebase
- Tech stack and architecture (vanilla JS, no build system)
- Complete data model (Tables, Rows, Relations, Keys)
- State management approach (singleton + pub/sub)
- API capabilities (XML serialization only)
- Detailed file structure and responsibilities
- Strengths and weaknesses
- Key findings about integration complexity
Start here for architectural overview and code structure understanding.
Side-by-side comparison of wwwsqldesigner vs DrawDB
- Architecture differences at a glance
- Why DrawDB's design wins for AI integration
- State management philosophy comparison
- Programmatic API comparison
- When to use each tool
- Concrete code examples
Start here for quick understanding of why DrawDB is better suited for WebSocket/MCP.
In-depth technical analysis of integration challenges
8 major architectural challenges explained:
- Monolithic singleton pattern
- State stored in DOM (not separate)
- No clear command boundaries
- Complex visual system (Bezier relations)
- Multiple overlapping managers with shared state
- No undo/redo system
- XML-only serialization
- No type definitions
Includes:
- Effort estimates for each challenge
- Why each problem is fundamentally hard
- DrawDB's solutions for comparison
- Total refactoring effort: 3-4 weeks
Start here for detailed understanding of why WebSocket/MCP integration is hard.
| Aspect | WWW SQL Designer | DrawDB |
|---|---|---|
| Age | 15+ years (2007-2025) | Modern (React 18 + Vite) |
| Framework | Vanilla JavaScript | React + TypeScript |
| Backend | 12 separate PHP/Perl/ColdFusion scripts | Single unified NestJS server |
| API | XML export/import only | 40+ MCP tools |
| Real-time | None | WebSocket + heartbeat |
| State Model | Monolithic singleton | Modular contexts |
| Build System | None | Turborepo + Vite |
| Type Safety | None | Full TypeScript |
| Undo/Redo | None | Full system |
| WebSocket Ready | NO - requires complete rewrite | YES - already built in |
Adding WebSocket/MCP to WWW SQL Designer:
- Estimated effort: 3-4 weeks
- Risk level: Very High
- Result: Would essentially rewrite entire app
- Alternative approach: easier to rewrite as React like DrawDB
Using DrawDB as-is:
- Effort: 0 weeks (already done!)
- Risk: Minimal (battle-tested)
- Result: Professional-grade MCP integration immediately available
The core issue: Architecture mismatch
WWW SQL Designer was designed (2007-2012) for:
- Single browser instance
- Manual save button
- Optional server backend for persistence
- XML data format
DrawDB was designed for:
- Multiple simultaneous users
- Real-time synchronization
- Integrated server with MCP
- Programmatic API
Adding real-time sync to WWW SQL Designer would require:
- Extracting state from DOM
- Breaking up monolithic singleton
- Creating command/transaction model
- Adding undo/redo system
- Replacing 12 backend implementations with unified Node.js server
- Adding WebSocket layer
- Complete TypeScript migration
- Extensive testing
Each step has cascading dependencies and high risk of breaking existing functionality.
WWW SQL Designer:
- Total JavaScript: 4,122 lines (18 files)
- No build tools, no package.json
- Largest file: io.js (605 lines)
- Last update: August 2025 (Ukrainian locale)
- Actively maintained (15+ years)
Backend implementations:
- PHP (6 variants)
- ColdFusion, Perl, ASP.NET, Web2Py
- 12+ different languages/platforms
- No unified interface
Frontend data model:
- Tables (with rows/fields and keys/indices)
- Relations (foreign keys)
- Visual state (positions, z-index, colors)
- Selection state (tables, rows, keys)
- Modular contexts - enable efficient WebSocket sync
- Unified backend - single source of truth
- TypeScript - catches integration bugs
- MCP-first design - was built for AI integration
- React state management - predictable updates
- Vanilla JS has limits - no framework makes extensibility hard
- Singleton pattern doesn't scale - can't support multiple instances
- State in DOM is a trap - makes real-time sync nearly impossible
- Multiple backends = maintenance burden - unified backend is better
- XML serialization is dated - JSON/structured commands are needed
Use DrawDB. It's already built for this.
- Start with
/js/oz.js- the utility framework - Then
/js/visual.js- the base class - Then
/js/table.jsand/js/row.js- the data model - Then
/js/io.js- how save/load works - Finally
/js/wwwsqldesigner.js- the main Designer class
- Fork it
- Add TypeScript
- Extract state from DOM
- Create NestJS backend
- Essentially rewrite as DrawDB
- Ask yourself: why not just use DrawDB?
oz.js(466 lines) - Utility frameworkvisual.js(43 lines) - Base classtable.js(396 lines) - Table entityrow.js(513 lines) - Field/column entityrelation.js(234 lines) - Foreign key relationskey.js(81 lines) - Index definitionstablemanager.js(257 lines) - Table selection/editingrowmanager.js(239 lines) - Field selection/editingkeymanager.js(224 lines) - Index managementio.js(605 lines) - Save/load/exportwindow.js(110 lines) - Modal dialogsoptions.js(112 lines) - User preferences- And 6 more files...
- php-mysql (MySQL database)
- php-postgresql (PostgreSQL)
- php-sqlite (SQLite)
- php-s3 (Amazon S3)
- php-dropbox (Dropbox)
- php-pdo (PDO abstraction)
- php-file (File-based storage)
- ColdFusion, Perl, ASP.NET variants
- Web2Py (Python)
- MySQL, PostgreSQL, SQLite, MSSQL, Oracle
- Web2Py, SQLAlchemy, CUBRID, VFP9
- Each with datatype definitions in XML
- GitHub: https://github.com/ondras/wwwsqldesigner
- Language: JavaScript (no TypeScript)
- License: New BSD
- Status: Actively maintained (August 2025)
- Age: 15+ years
- Latest commit: Ukrainian locale addition
- Docker image: 8 MB (BusyBox httpd)
- No dependencies: Zero npm packages
For comparison, see DrawDB's architecture docs:
/apps/backend/README.md- Backend architecture/CLAUDE.md- Project overview (includes MCP design)/apps/backend/src/mcp/primitives/- MCP tools implementation
wwwsqldesigner is a mature, stable, zero-dependency diagram editor that prioritizes simplicity over extensibility.
DrawDB is a modern, modular, real-time-ready diagram editor designed for AI integration via MCP.
If you need WebSocket/MCP integration for AI assistants, use DrawDB.
If you're interested in understanding web-based diagram editors, wwwsqldesigner is an excellent example of the "classic" approach (pre-framework, pre-real-time).
The architectural differences show why modern frameworks and backend integration patterns evolved.
Analysis completed: October 28, 2025 Explorer: Claude Code Repository: https://github.com/ondras/wwwsqldesigner (cloned to /tmp)