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.
erdus.v1.mp4
- 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)
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
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
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 |
- 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.
- 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
withfkSubIndex
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.
## ERDPlus module: how it works
- 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
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).
- Groups by (child → parent), orders by
- Assigns a stable
foreignKeyGroupId
based on the child, parent and ordered set of attributes.
- 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
references
pointing to the parent's PK andfkSubIndex
following the edge column order. - 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.
- 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.
## SQL module: how it works
- Scans
CREATE TABLE
statements and builds tables and columns. - Reads
FOREIGN KEY
clauses to reconstruct relationships.
- Iterates tables and columns to output
CREATE TABLE
definitions. - Emits
ALTER TABLE
for composite FKs and indexes.
- 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 module: how it works
- Parses
model
blocks extracting fields, types and relations.
- Generates
model
blocks with@id
,@unique
and@relation
attributes.
- 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 module: how it works
- Parses
@Entity
classes to extract columns and relations. - Reconstructs
@ManyToOne
/@OneToMany
links via@JoinColumn
, marking optional fields.
- Emits
@Entity
classes with@Column
,@PrimaryColumn
and@PrimaryGeneratedColumn
decorators. - Generates
@ManyToOne
/@OneToMany
relations and@Index
declarations. - Maps SQL types to TypeORM types and adds nullable/unique options.
- 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.
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
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
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);
- Contributing Guide - Detailed contribution process
- Development Setup - Local development guide
- Architecture - System design overview
- API Documentation - Programmatic usage guide
- Open the local app at
http://localhost:5173
. - Drag or select a
.erdplus
file (old or new) and press Convert. *-new.erdplus
or*-old.erdplus
will download automatically as appropriate.- In ERDPlus new: Restore → Upload to verify the diagram is identical.
On Windows/PowerShell, if peer dependency conflicts appear, pin ESLint 8.57:
npm i -D eslint@8.57.0
npm i
- Import the repository (Framework: Vite).
- Build:
npm run build
- Output directory:
dist/
vercel.json
already points to dist/
.
- Processing happens entirely in your browser.
- No files are sent to any server, not even Vercel.
- You can use it offline with
npm run build
followed bynpm run preview
.
- ERDPlus (new version) may route lines differently (curves) but connections and cardinalities are correct.
- If your NEW file comes from another tool with proprietary IDs, the converter will not clone those IDs. They are invisible and do not affect rendering.
Phase 0 – What exists today (base)
- ERDPlus old ⇄ new
- ✅ Full support for PK, FK, unique groups
- ✅ Lossless round-trip
- Audience: students, teachers, university exercises
Phase 1 – “Useful + viral” MVP
Goal: anyone can use it online and get value right away
- Canonical IR (v1) → core
- ✅ IR → PostgreSQL DDL → generate real
CREATE TABLE
- ✅ IR → Prisma schema → connect with Next.js/TypeScript
- ✅ Web demo (Vercel) → drag & drop, result tabs, loss report
- ✅ Simple CLI (
erdus convert ...
) - Attracts: fullstack devs, indie hackers, students → first stars
Phase 2 – Import & documentation
Goal: import existing models and document them
- ✅ PostgreSQL DDL → IR (robust parser)
- ✅ IR → dbml → use in dbdiagram.io
- ✅ IR → Mermaid ER → document in Markdown/repos
- ✅ Complete examples (blog, e‑commerce, school)
- Attracts: devs who document, OSS maintainers → visibility on GitHub
Phase 3 – Developer ecosystem
Goal: be useful in pipelines and serious projects
- IR → JSON Schema (APIs, validation)
- ✅ IR → TypeORM models
- IR → Sequelize models
- IR → Supabase schema (+ optional RLS policies)
- Diff/Migration plan: compare two IR → SQL
ALTER
script - Attracts: startups, SaaS projects → stars from productive folks
Phase 4 – Advanced / killer features
Goal: expand to NoSQL and modern APIs
- IR ↔ Mongoose schemas (MongoDB)
- IR ↔ OpenAPI schemas
- IR ↔ GraphQL SDL
- Visualizer: basic web editor with interactive ERD view
- Attracts: modern devs, API/GraphQL community
- This is where ERDUS could become the OSS standard
Recommended release order
- Phase 1 (MVP): Postgres + Prisma + web demo (fast value, viral)
- Phase 2: Documentation (dbml/Mermaid) → virality on GitHub/Reddit
- Phase 3: JSON Schema + Supabase + Diff → serious devs
- Phase 4: MongoDB + GraphQL + Visualizer → universal suite consolidation
Growth strategy
- Each phase = a release with changelog and post on Reddit/HN/Twitter
- README with short GIFs (drag & drop, instant output)
- CI badges + online demo → trust
- “Good first issues” to invite PRs → community
Please read the Contributing Guide before getting started.
- Fork and create a
feat/my-improvement
branch. - Run
npm i
andnpm run dev
. - Include an example
.erdplus
file when relevant. - Open a PR — contributions are welcome!
Thanks to everyone who contributes to the growth of this project. Your contribution can also be included here!
MIT — see LICENSE.