SkillAgentSearch skills...

Erdus

Universal ER diagram converter.

Install / Use

/learn @tobiager/Erdus

README

<div align="center">

Erdus

<!-- Social --> <p style="margin-top:20px;"> <a href="https://github.com/tobiager"> <img src="https://img.shields.io/github/followers/tobiager?label=Follow%20@tobiager&style=social" alt="Follow @tobiager" /> </a> <a href="https://github.com/tobiager/Erdus/stargazers"> <img src="https://img.shields.io/github/stars/tobiager/Erdus" alt="Stars Badge"/> </a> <a href="https://github.com/tobiager/UNNE-LSI/network/members"> <img src="https://img.shields.io/github/forks/tobiager/Erdus" alt="Forks Badge"/> </a> </p>

MIT Vercel

React TailwindCSS TypeScript Vite Node

<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&#0032;converter | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54" /></a>

</div> <br>

Erdus

Universal ER Diagram Converter

Also available in SpanishDemoDocsContributingRoadmap

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: .erdplus or .json files (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

[!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 connectors with fkSubIndex to 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.
<details> <summary>## ERDPlus module: how it works</summary>

Old → New (identical visuals)

  1. Reads shapes[] tables and creates nodes with id = t-<id> and columns id = c-<tableId>-<attrId>.
  2. Reconstructs FKs prioritizing connectors[] (source of truth in Old).
    • Groups by (child → parent), orders by fkSubIndex and generates a single edge per composite FK.
    • Uses the real child column ID in foreignKeyProps.columns[].id; ERDPlus draws the line and labels (FK).
  3. Assigns a stable foreignKeyGroupId based on the child, parent and ordered set of attributes.

New → Old (equivalent structure)

  1. Converts nodes and columns to tables and attributes preserving PK, UNIQUE, NULL and types.
  2. From each edge creates FK attributes in the child table with references pointing to the parent's PK and fkSubIndex following the edge column order.
  3. Creates connectors per FK column so that legacy viewers can draw the connections.

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.
</details>

SQL module features

  • Auto-detects PostgreSQL CREATE TABLE scripts.
  • IR ⇔ SQL: converts the canonical IR to PostgreSQL DDL and parses SQL back to IR.
  • Preserves PK, FK and unique constraints.
<details> <summary>## SQL module: how it works</summary>

SQL → IR

  1. Scans CREATE TABLE statements and builds tables and columns.
  2. Reads FOREIGN KEY clauses to reconstruct relationships.

IR → SQL

  1. Iterates tables and columns to output CREATE TABLE definitions.
  2. Emits ALTER TABLE for composite FKs and indexes.
</details>

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.
<details> <summary>## Prisma module: how it works</summary>

Prisma → IR

  1. Parses model blocks extracting fields, types and relations.

IR → Prisma

  1. Generates model blocks with @id, @unique and @relation attributes.
</details>

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.
<details> <summary>## TypeORM module: how it works</summary>

TypeORM → IR

  1. Parses @Entity classes to extract columns and relations.
  2. Reconstructs @ManyToOne/@OneToMany links via @JoinColumn, marking optional fields.

IR → TypeORM

  1. Emits @Entity classes with @Column, @PrimaryColumn and @PrimaryGeneratedColumn decorators.
  2. Generates @ManyToOne/@OneToMany relations and @Index declarations.
  3. Maps SQL types to TypeORM types and adds nullable/unique options.
</details>

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:

  1. Visit erdus-inky.vercel.app
  2. Upload your ER diagram or schema file
  3. Select your desired output format
  4. 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

View on GitHub
GitHub Stars13
CategoryData
Updated5mo ago
Forks1

Languages

TypeScript

Security Score

77/100

Audited on Oct 9, 2025

No findings