Erdus
Universal ER diagram converter.
Install / Use
/learn @tobiager/ErdusREADME
<a href="https://www.producthunt.com/products/erdus?embed=true&utm_source=badge-featured&utm_medium=badge&utm_source=badge-erdus" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=1012222&theme=dark&t=1756930414298" alt="Erdus - Universal converter | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54" /></a>
</div> <br>Erdus
Universal ER Diagram Converter
Also available in Spanish ✦ Demo ✦ Docs ✦ Contributing ✦ Roadmap
One IR to map them all. Erdus is the open-source universal converter for ER diagrams and database schemas.
It unifies ERDPlus, SQL DDL, Prisma, TypeORM, JSON Schema and more under a strict Intermediate Representation (IR).
Build once, convert everywhere.
https://github.com/user-attachments/assets/ad18f7ab-0b26-4033-9eae-6a9b209543b8
</div>- 100% client side (privacy): files never leave the browser.
- Input:
.erdplusor.jsonfiles (format detected automatically). - Output: file with the extension matching the desired target format (e.g.,
name-old.erdplus,schema.sql,schema.prisma). - Relationships: draws a single link for each FK (including composites) and anchors it to the actual child columns.
Available modules
- ERDPlus Old ⇄ New (bundled)
- SQL (PostgreSQL DDL)
- Prisma
- TypeORM (IR → entity models)
- DBML (for dbdiagram.io)
- Mermaid ER (for documentation)
Project structure
Erdus/
├── src/ # Core application source
│ ├── converters/ # Format conversion modules
│ ├── components/ # React UI components
│ ├── pages/ # Application pages
│ ├── utils/ # Utility functions
│ ├── types/ # TypeScript definitions
│ └── docs/ # In-app documentation
├── examples/ # Example schemas & conversions
│ ├── blog/ # Blog system example
│ ├── ecommerce/ # E-commerce schema
│ └── school/ # Educational system
├── tests/ # Comprehensive test suite
├── docs/ # Documentation website (Docusaurus)
├── public/ # Static assets
└── assets/ # README images & media
Supported Formats
<div align="center">Input Formats → Intermediate Representation → Output Formats
graph LR
subgraph "Input"
A[ERDPlus Old]
B[ERDPlus New]
C[SQL DDL]
D[Prisma]
E[TypeORM]
end
subgraph "Core"
IR[Intermediate<br/>Representation]
end
subgraph "Output"
F[SQL DDL]
G[Prisma]
H[TypeORM]
I[DBML]
J[Mermaid]
end
A --> IR
B --> IR
C --> IR
D --> IR
E --> IR
IR --> F
IR --> G
IR --> H
IR --> I
IR --> J
</div>
| Format | Input | Output | Use Case | |--------|:-----:|:------:|----------| | ERDPlus | ✅ | ✅ | Educational projects, visual design | | SQL DDL | ✅ | ✅ | Database creation, migrations | | Prisma | ✅ | ✅ | Modern Node.js development | | TypeORM | ✅ | ✅ | Enterprise TypeScript apps | | DBML | — | ✅ | Documentation with dbdiagram.io | | Mermaid | — | ✅ | README files, technical docs |
Demo
- Production: https://erdus-inky.vercel.app
- StackBlitz: Interactive sandbox
[!TIP] In ERDPlus (new version) choose Menu → Restore → Upload to open the converted file. Positions, types, constraints and connections remain intact.
ERDPlus module features
- Automatic detection of the input format (old or new).
- Old → New: tables → nodes, attributes → columns, simple or composite FKs → a single grouped edge with stable
foreignKeyGroupId. - New → Old: edges → FK attributes and
connectorswithfkSubIndexto preserve order. - Deterministic IDs for columns in NEW (
c-<tableId>-<attrId>) allowing ERDPlus to anchor lines and tag columns as (FK). - Private by design: all processing happens locally; there is no backend or file upload.
- Works on Windows, macOS and Linux. Vite's dev server provides instant HMR.
Old → New (identical visuals)
- Reads
shapes[]tables and creates nodes withid = t-<id>and columnsid = c-<tableId>-<attrId>. - Reconstructs FKs prioritizing
connectors[](source of truth in Old).- Groups by (child → parent), orders by
fkSubIndexand generates a single edge per composite FK. - Uses the real child column ID in
foreignKeyProps.columns[].id; ERDPlus draws the line and labels (FK).
- Groups by (child → parent), orders by
- Assigns a stable
foreignKeyGroupIdbased on the child, parent and ordered set of attributes.
New → Old (equivalent structure)
- Converts nodes and columns to tables and attributes preserving PK, UNIQUE, NULL and types.
- From each edge creates FK attributes in the child table with
referencespointing to the parent's PK andfkSubIndexfollowing the edge column order. - Creates
connectorsper FK column so that legacy viewers can draw the connections.
</details>Guarantees
- Round-trip old → new → old without loss: structure, keys, order and positions are preserved.
- Round-trip new → old → new: nodes, edges and FK columns are preserved.
- The “new” JSON may differ in internal invisible IDs but is visually and semantically equivalent.
SQL module features
- Auto-detects PostgreSQL
CREATE TABLEscripts. - IR ⇔ SQL: converts the canonical IR to PostgreSQL DDL and parses SQL back to IR.
- Preserves PK, FK and unique constraints.
SQL → IR
- Scans
CREATE TABLEstatements and builds tables and columns. - Reads
FOREIGN KEYclauses to reconstruct relationships.
IR → SQL
- Iterates tables and columns to output
CREATE TABLEdefinitions. - Emits
ALTER TABLEfor composite FKs and indexes.
Prisma module features
- Auto-detects Prisma schema files.
- IR ⇔ Prisma: generates Prisma models from IR and parses schemas back.
- Maps SQL types to Prisma scalars and relations.
Prisma → IR
- Parses
modelblocks extracting fields, types and relations.
IR → Prisma
- Generates
modelblocks with@id,@uniqueand@relationattributes.
TypeORM module features
- Auto-detects TypeORM entity classes.
- IR ⇔ TypeORM: generates entity models and parses them back to IR.
- Maps SQL types to TypeScript types and decorators, preserving relations and indexes.
TypeORM → IR
- Parses
@Entityclasses to extract columns and relations. - Reconstructs
@ManyToOne/@OneToManylinks via@JoinColumn, marking optional fields.
IR → TypeORM
- Emits
@Entityclasses with@Column,@PrimaryColumnand@PrimaryGeneratedColumndecorators. - Generates
@ManyToOne/@OneToManyrelations and@Indexdeclarations. - Maps SQL types to TypeORM types and adds nullable/unique options.
Open source & scalable
- MIT-licensed with a lightweight, modular core.
- New converters or exporters can plug in as simple modules.
- Ships a CLI and minimal API so it fits CI/CD pipelines, serverless functions or container clusters.
Quick Start
Web Interface (Recommended)
Get started in seconds with our web interface:
- Visit erdus-inky.vercel.app
- Upload your ER diagram or schema file
- Select your desired output format
- Download the converted result
Local Installation
For development or offline use:
# Clone and install
git clone https://github.com/tobiager/Erdus.git
cd Erdus
npm install --legacy-peer-deps
# Start development server
npm run dev
# → Open http://localhost:5173
Programmatic Usage
import { erdplusToIR, irToSQL, irToPrisma } from 'erdus';
// Convert ERDPlus to SQL
const erdplusData = JSON.parse(fileContent);
const schema = erdplusToIR(erdplusData);
const sqlScript = irToSQL(schema);
// Or convert to Prisma
const prismaSchema = irToPrisma(schema
Related Skills
oracle
326.5kBest practices for using the oracle CLI (prompt + file bundling, engines, sessions, and file attachment patterns).
prose
326.5kOpenProse VM skill pack. Activate on any `prose` command, .prose files, or OpenProse mentions; orchestrates multi-agent workflows.
Writing Hookify Rules
80.4kThis skill should be used when the user asks to "create a hookify rule", "write a hook rule", "configure hookify", "add a hookify rule", or needs guidance on hookify rule syntax and patterns.
Command Development
80.4kThis skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
