markdy-com
Health Pass
- License Γ’β¬β License: MIT
- Description Γ’β¬β Repository has a description
- Active repo Γ’β¬β Last push 0 days ago
- Community trust Γ’β¬β 84 GitHub stars
Code Pass
- Code scan Γ’β¬β Scanned 12 files during light audit, no dangerous patterns found
Permissions Pass
- Permissions Γ’β¬β No dangerous permissions requested
No AI report is available for this listing yet.
π¬ Open-source animated architecture diagrams as code. Diagram-native DSL, 17 layout engines, Web Animations API, and MCP server for AI agents.
Markdy
Open-source diagram-as-code DSL for animated architecture & system design explainers.
Write declarative MarkdyScript β render 60fps browser-native animated diagrams powered by the Web Animations API.
β‘ Launch Studio Playground Β β’Β π Documentation Β β’Β π 17+ Examples Gallery Β β’Β π€ AI & Agent Guide
β‘ Try the Interactive Studio & Live Playground on markdy.com β
What is Markdy?
Markdy is a framework-agnostic, diagram-native DSL for animated architecture and system diagrams. Declare semantic nodes, groups, beats, flows, and cues in MarkdyScript β Markdy handles layout, edge routing, timing, and browser-native rendering with the Web Animations API. No Canvas, no GSAP, zero bloated dependencies.
Markdy is built for animated architecture diagrams and system-design explainers.
The built-in vocabulary expresses architecture, cloud, Kubernetes, CI/CD, auth, data, messaging, state-machine, and flow diagrams.If you are searching for a Mermaid alternative with animation, animated architecture diagrams, diagram as code, AI-generated diagrams, text-to-diagram, architecture as code, or docs-as-code motion graphics, Markdy is designed for that workflow.
scene theme=paper
layout LR
browser Client
service API
database DB
beat main "Trace the request":
show $nodes
frame Client API zoom=1.12
Client -> API "GET /items" -> DB "query"
Client <- API "200 OK"
Key Features
| Feature | Detail |
|---|---|
| Zero-dep parser & engines | @markdy/core is pure TypeScript β AST parser, architecture linter, semantic classifier, AST diff engine, brand theme generator, and URL state codec |
| Web-native renderer | Web Animations API + CSS transforms. No Canvas, no GSAP, zero dependencies |
| 17 Specialized Layout Engines | architecture (LR, RL, TB, BT), flowchart, tree, state, sequence, constellation, loop/flywheel, medallion, quadrant, swimlane, pyramid, radar, timeline, gantt, venn, grid, and radial |
| 8 Semantic Themes | paper, editorial, nebula, midnight, blueprint, graphite, terminal (CLI/TUI dark mode), and sketchy (editorial hand-drawn) |
| Universal Ingestion | Instant transpilers for Mermaid, draw.io, Docker Compose, Kubernetes manifests, and Terraform state into animated MarkdyScript scenes (markdy import) |
| Brand Theme Generator | Extract and generate WCAG-compliant light and dark themes from any brand hex color (generateThemeFromBrand()) |
| Output Size Presets | 8 standard export presets (doc-inline, doc-wide, slide-16x9, slide-4x3, social-og, social-square, print-a4, print-letter) |
| Architecture Governance | Built-in Well-Architected validation: layer boundaries, deadlock cycle detection, gateway checks, and isolation rules (markdy lint --arch-rules) |
| Semantic AST Diffing | Compares architecture versions, outputs Markdown audit tables, and generates animated evolution scenes (markdy diff) |
| Media Exporters | Zero-dep GIF89a encoder with LZW compression for animated GitHub READMEs and vector SVG export for Figma |
| Model Context Protocol (MCP) | @markdy/mcp-server equips Claude, Cursor, Antigravity, and AI agents with validation, transpilation, and architecture explanation tools |
| Diagram-native DSL | Declare nodes, groups, and beats; the engine handles layout, routing, timing, and rendering |
| Auto-layout + routing | Rank-based layout and collision-aware orthogonal Manhattan edge routing are built in β no coordinates required |
| Flow operators | -> request, <- response, ~> event, -- dependency, each with its own edge style |
| Beats + cues | Sequence reveals with beat blocks, captions, and show/hide/glow/focus/frame cues; run cues together with & |
| Semantic node cards | Kind-aware SVG glyphs for browsers, services, gateways, queues, workers, databases, storage, CDN, security, hub, station, medals, and more |
| Editorial Callouts | Italic-serif annotations with dashed BΓ©zier leaders, landing dots, and color intents (accent, muted, neutral) |
| Astro & MDX Ready | <Markdy /> islands that hydrate on viewport entry with zero layout shift |
| AI-agent friendly | Structured DSL that LLMs can generate, validate, and iterate on (Agent Guide) |
Packages
| Package | Description | Size |
|---|---|---|
@markdy/core |
Parser + AST diff, architecture linter, semantic classifier, URL codec (zero runtime deps) | ~14 KB |
@markdy/compat |
Universal transpilers (Mermaid, Docker Compose, Kubernetes, Terraform) & snapshot gates | ~8 KB |
@markdy/renderer-dom |
Web Animations API renderer, GIF89a encoder, SVG exporter, presentation controller | ~24 KB |
@markdy/cli |
CLI for linting, architecture rules, formatting, importing, diffing, explaining, and sharing | Node package |
@markdy/mcp-server |
Official Model Context Protocol (MCP) server for AI coding assistants & agents | Node package |
@markdy/language-server |
Shared LSP server for editors and IDE integrations | Node package |
@markdy/astro |
Astro island component | ~2 KB |
@markdy/mdx |
MDX remark plugin + lazy React diagram component | ~4 KB |
@markdy/stdlib-systems |
Architecture nodes, visual primitives, and request/response/emit flows for animated diagrams | <1 KB |
π¦ Registries: All packages are published to both npmjs.com and GitHub Packages. See the GitHub Packages Guide for npm/pnpm authentication and configuration.
Search intent: when to use Markdy
Developers usually discover this problem through many names:
- "Mermaid but animated"
- "Markdown animation"
- "animated diagrams as code"
- "text-to-diagram with motion"
- "AI-generated architecture diagrams"
- "sequence diagrams for developer docs"
- "architecture visualization for docs"
- "docs-as-code animation"
- "LLM-friendly visual DSL"
Use Markdy when you want a diagram or explainer that is:
- Text-first β reviewable in pull requests and easy for AI agents to edit.
- Time-based β requests, responses, events, phased reveals, and emphasis happen in sequence.
- Browser-native β rendered with DOM/CSS/Web Animations instead of screenshots or video exports.
- Documentation-friendly β works in Astro, MDX, static sites, and package READMEs.
Use Mermaid, PlantUML, D2, Graphviz, Excalidraw, or draw.io when you need static diagrams. Use Markdy when the story depends on motion.
CLI install note
@markdy/cli provides the markdy binary, but a normal project install does not put that binary on your shell PATH.
Use one of these depending on where you installed it:
npx markdy render examples/showcase/url-shortener-architecture.markdy --out examples/xscene.html
npm exec markdy render examples/showcase/url-shortener-architecture.markdy --out examples/xscene.html
npm i -g @markdy/cli
--out writes the generated HTML to the path you pass in, relative to the current working directory unless you give an absolute path.
Ecosystem map (text)
@markdy/core
-> parses MarkdyScript into AST
@markdy/renderer-dom
-> renders AST in the browser with Web Animations API
@markdy/astro, @markdy/mdx
-> host integrations for site/content workflows
@markdy/cli
-> lint, format, render, explain, and preview commands
@markdy/language-server
-> diagnostics, completion, and hover in editors
@markdy/stdlib-systems
-> optional node vocabulary manifest for architecture and technical diagrams
Mermaid vs Markdy: Beyond Static Diagrams
| Capability | Mermaid.js / PlantUML | Markdy |
|---|---|---|
| Animation & Time | β Static SVG/PNG | β Browser-native 60fps WAAPI motion & seekable beats |
| Return Flows & Arcs | β οΈ Creates ranking cycles & layout distortion | β
Cycle-safe response flows (<-) and event arcs (~>) |
| Architectural Governance | β No validation rules | β Built-in Well-Architected linter & CI deadlock checks |
| AI Agent Support | β οΈ Basic text generation | β Official Model Context Protocol (MCP) server & AST self-healing |
| Universal Ingestion | β Manual rewrite | β 1-click import from Mermaid, Draw.io, K8s, Docker Compose, Terraform |
Universal Ingestion & 1-Command Migration
Convert existing static architecture definitions into animated MarkdyScript scenes in one command:
markdy import flow.mmd --out flow.markdy
markdy import docker-compose.yml --out architecture.markdy
markdy import k8s-manifests/ --out cluster.markdy
markdy import terraform.tfstate --out infra.markdy
ποΈ 17 Specialized Diagram Layout Engines
Explore the Live Examples Gallery or click any preview below to open it in the Markdy Studio:
| β‘ Systems & High Concurrency | π¦ Decision Logic & Consensus |
|---|---|
| Architecture (Cache-Aside Pattern) Sub-2ms Redis cache redirection & database fallback ![]() β‘ Open Interactive Scene in Studio β |
Concurrency Strategy Flowchart Thread safety, CAS atomics & mutex contention ![]() β‘ Open Interactive Scene in Studio β |
Consistent Hash Ring TreeO(k/N) minimal data rebalancing & vNode partitions![]() β‘ Open Interactive Scene in Studio β |
OAuth 2.0 PKCE Auth Sequence Zero-trust Single Page App authentication exchange ![]() β‘ Open Interactive Scene in Studio β |
| Distributed 2PC Consensus State Prepare/Commit/Abort multi-partition consensus ![]() β‘ Open Interactive Scene in Studio β |
OSI 7-Layer Protocol Stack Full-width horizontal packet encapsulation bands ![]() β‘ Open Interactive Scene in Studio β |
| Zero-Trust Security Perimeter Concentric defense-in-depth Kubernetes security enclaves ![]() β‘ Open Interactive Scene in Studio β |
Distributed Saga Order Swimlanes Cross-functional lanes & asynchronous rollback coordination ![]() β‘ Open Interactive Scene in Studio β |
| Database WAL & CDC Stream Timeline Zero-collision alternating milestone baseline ![]() β‘ Open Interactive Scene in Studio β |
Zero-Downtime Migration Gantt Multi-phase task spans & critical path dependencies ![]() β‘ Open Interactive Scene in Studio β |
| Lakehouse Medallion Data Pipeline Streaming Bronze β Silver β Gold transformations ![]() β‘ Open Interactive Scene in Studio β |
Decentralized Gossip Flywheel Circular closed-loop anti-entropy sync engine ![]() β‘ Open Interactive Scene in Studio β |
| Raft Quorum Constellation (Nebula) Radial orbit geometry & pulsating consensus halos ![]() β‘ Open Interactive Scene in Studio β |
CAP Theorem Decision Quadrant Automated 2Γ2 matrix trade-off positioning ![]() β‘ Open Interactive Scene in Studio β |
| Cloud Observability Pyramid Step-proportional telemetry & monitoring tier stack ![]() β‘ Open Interactive Scene in Studio β |
Storage Benchmark Radar Multi-axis polygon database performance evaluation ![]() β‘ Open Interactive Scene in Studio β |
| ACID vs BASE Consistency Venn 3-Circle concept intersection & sweet spot overlap ![]() β‘ Open Interactive Scene in Studio β |
AI Agent Workflow & Prompting Autonomous MCP tool execution & self-healing diagrams ![]() π€ Explore Agent Integration Guide β |
To preview a full scene result locally, run:
npx markdy render examples/showcase/url-shortener-architecture.markdy --out scene.html
Quick Start
Write a .markdy scene
Create architecture.markdy:
scene theme=paper
layout LR
browser WebApp
service CheckoutApi
database OrdersDb
beat main:
show $nodes stagger=80ms
WebApp -> CheckoutApi "GET /orders" -> OrdersDb "query"
WebApp <- CheckoutApi "200 OK"
Preview or validate it with the CLI:
pnpm add -D @markdy/cli
pnpm markdy lint architecture.markdy
pnpm markdy render architecture.markdy --out architecture.html
Astro / MDX
pnpm add @markdy/astro
---
import { Markdy } from "@markdy/astro";
const code = `
scene theme=paper width=800 height=400
browser WebApp
service CheckoutApi
beat main:
show $nodes
WebApp -> CheckoutApi "GET /users"
`;
---
<Markdy code={code} width={800} height={400} bg="#07111f" autoplay />
Parser Only (Node.js / Edge)
import { parse, ParseError } from "@markdy/core";
try {
const ast = parse(source);
console.log(ast.nodes); // { API: { kind: "service", ... } }
console.log(ast.beats); // [{ name: "main", cues: [...] }]
} catch (e) {
if (e instanceof ParseError) {
console.error(`Line ${e.line}: ${e.message}`);
}
}
DSL at a Glance
Full reference: docs/SYNTAX.md Β· Step-by-step tutorial: docs/TUTORIAL.md Β· Getting started: docs/GETTING_STARTED.md Β· Guides: docs/GUIDES.md Β· Comparisons: docs/COMPARISONS.md Β· Troubleshooting: docs/TROUBLESHOOTING.md Β· AI agent guide: markdy.com/agent
Nodes + Beats + Flows
scene theme=paper
layout LR
browser WebApp
service OrderService
database OrdersDb
beat main:
show $nodes stagger=80ms
WebApp -> OrderService "POST /order" -> OrdersDb "persist"
WebApp <- OrderService "201 Created"
Groups + Patterns
group storage: Redis OrdersDb
pattern lookup(client, store):
$client -> $store "lookup"
$client <- $store "result"
beat read:
use lookup(OrderService, Redis)
Flow operators
| Operator | Edge kind | Rendered as |
|---|---|---|
-> |
request | solid arrow |
<- |
response | dashed arrow, drawn back to the caller |
~> |
event | dotted arrow |
-- |
dependency | thin link |
Cues
Cues live inside a beat and are scheduled in order; put & between two cues to run them together.
| Cue | Description | Key parameters |
|---|---|---|
show |
Reveal nodes or groups | stagger, dur |
hide |
Fade nodes out | dur |
glow |
Emphasize with a colored glow | color, strength, dur |
focus |
Pulse-scale to draw attention | zoom, dur |
frame |
Move the scene camera to nodes or groups | zoom, dur |
use |
Expand a pattern |
pattern args |
Selectors: $nodes targets every node, $edges targets structural and animated edges, and a group name targets its members.
Player Configuration
Everything outside the scene itself can live in one optional player: block. Keep it at the bottom so the diagram remains the first thing readers see:
scene theme=paper
layout LR
browser Client
service API
beat request:
show $nodes
Client -> API "GET /orders"
player:
playback:
loop false
controls:
speed true
speeds "0.5 1"
fit true
share true
interaction:
zoom true
pan true
chrome:
badge true
progress boundary
| Group | Owns |
|---|---|
playback |
when and how fast the timeline runs |
controls |
which toolbar affordances are mounted |
interaction |
what pointer and key input do |
chrome |
non-interactive decoration (badge, progress) |
Controls are explicit opt-ins: only leaves set to true are mounted. fit frames every item and pins the camera so frame/focus zoom cues stop moving the view; prev_beat/next_beat step through beats. rate sets the initial multiplier, while speeds provides viewer choices; the speed selector needs at least two distinct positive values. The linked badge stays at the footer's right edge. keyboard is opt-in (β/β beats, Space play, Home restart) because it captures window key events. Legacy directives and flat keys normalize into the same groups; explicit host options gate or supply defaults for script settings.
Themes & Layout Modes
Themes (theme=):
paperβ clean light documentation canvas (default)editorialβ flat editorial paper with serif headings and semantic ink/accent rolesterminalβ dark CLI/TUI canvas with monospace font and neon glow accentssketchyβ organic hand-drawn whiteboard theme with displacement filternebulaβ deep-space canvas with orbit rings, signal halos, and starfieldmidnightβ modern dark developer canvasblueprintβ technical cyan-grid CAD canvasgraphiteβ restrained dark minimal canvas
Layout Types (type=):
architectureβ ranked multi-tier systems and platform topology (default)flowchartβ top-down steps, decisions, and mergestreeβ parent/child hierarchies with shared sibling busesstateβ cycle-safe state transitions and self-loopssequenceβ participant columns, lifelines, ordered messages, and activationstimelineβ horizontal hairline baseline with collision-free alternating milestone cardsganttβ phase-based horizontal bar stacking with temporal span trackingvennβ 2β3 circle concept intersection with proximity scalingradarβ multi-axis polygon comparison chart with series color palettemedallionβ multi-tier Bronze β Silver β Gold data lakehouse stagesflywheel/loopβ circular closed-loop engine with tangential flow pathsquadrantβ 2Γ2 decision and strategic positioning matrixswimlaneβ multi-tier cross-functional horizontal lane partitionspyramidβ hierarchical tier pyramid with step-proportional width scalingconstellationβ radial focal node with orbital signal rings
API Reference
parse(source: string, opts?: ParseOptions): DiagramAST
Parses MarkdyScript source into a typed diagram AST. Throws ParseError with line numbers on structural errors. Pure function with no side effects β runs in Node.js, Deno, edge runtimes, or the browser.
interface ParseOptions {
parseOnly?: boolean; // Skip layout/schedule compilation; parse structure only.
}
DiagramAST exposes ast.meta, ast.nodes, ast.edges, ast.groups, ast.patterns, ast.beats, and ast.diagnostics[] (soft warnings such as unknown scene properties). Call compile(ast) to produce a RenderPlan with positioned nodes, routed edges, and scheduled cues. See docs/AGENT.md for the full shape.
createDiagram(options: DiagramOptions): Diagram
Creates a DOM-based animated diagram.
interface DiagramOptions {
container: HTMLElement; // Mount point
code: string; // MarkdyScript source
autoplay?: boolean; // Start immediately (default: true)
loop?: boolean; // Loop at end (default: true)
copyright?: boolean; // "Powered by Markdy" badge (default: true)
progressBar?: boolean; // Deprecated: use sceneBoundaryProgress
sceneBoundaryProgress?: boolean; // Rainbow border progress bar (default: true)
playbackRate?: number; // Timeline speed multiplier (default: 1)
interactiveViewport?: boolean; // true: default gestures; false: suppress script gestures
controls?: boolean; // true: legacy defaults; false: suppress script controls
shareUrl?: string; // Base URL for Share links
onWarning?: (w: Diagnostic) => void; // Soft parse warnings
onTimeUpdate?: (seconds: number, duration: number) => void;
onPlayStateChange?: (playing: boolean) => void;
}
interface Diagram {
play(): void; // Start / resume
pause(): void; // Pause at current position
seek(seconds: number): void; // Jump to time
setPlaybackRate(rate: number): void; // Set timeline speed, e.g. 0.5 or 2
playbackRate(): number; // Current timeline speed multiplier
beats(): BeatRange[]; // Beat ranges in the compiled scene
seekToBeat(name: string): void; // Jump to a named beat
nextBeat(): void; // Step to the next beat from the current time
prevBeat(): void; // Step to the previous beat from the current time
destroy(): void; // Remove DOM + cancel animations
}
<Markdy /> (Astro Component)
| Prop | Type | Default | Description |
|---|---|---|---|
code |
string |
(required) | MarkdyScript source |
width |
number |
800 |
Placeholder width (px) |
height |
number |
400 |
Placeholder height (px) |
bg |
string |
"white" |
Placeholder background colour |
assets |
Record<string, string> |
{} |
Asset URL overrides |
autoplay |
boolean |
true |
Auto-play when fully visible in viewport |
loop |
boolean |
true |
Loop the animation when it ends |
copyright |
boolean |
script or true |
Show the linked badge at the footer's right edge |
progressBar |
boolean |
true |
Show a rainbow progress bar around the viewport border |
sceneBoundaryProgress |
boolean |
progressBar |
Preferred flag for the rainbow scene-boundary progress bar |
playbackRate |
number |
script or 1 |
Initial timeline speed multiplier |
interactiveViewport |
boolean |
script | true supplies default gestures; false suppresses script gestures |
controls |
boolean |
script | true supplies legacy defaults; false suppresses script controls |
class |
string |
β | CSS class for outer wrapper |
Architecture
See docs/ARCHITECTURE.md for technical details.
MarkdyScript source
β
βΌ
βββββββββββββββ
β @markdy/core β parse() β DiagramAST
β (parser) β Pure TS, zero deps
ββββββββ¬βββββββ
β DiagramAST
βΌ
ββββββββββββββββββββ
β @markdy/renderer β createDiagram() β Diagram
β -dom β WAAPI + rAF loop
ββββββββ¬ββββββββββββ
β Diagram
βΌ
ββββββββββββββββββββ
β @markdy/astro β <Markdy /> island
β (optional) β SSR placeholder + IntersectionObserver
ββββββββββββββββββββ
All WAAPI animations are permanently paused. A requestAnimationFrame loop manually sets anim.currentTime = sceneMs each frame. This avoids browser-specific quirks with startTime-based resumption and enables reliable seek().
Development
git clone https://github.com/HoangYell/markdy-com.git
cd markdy-com
pnpm install
pnpm build
pnpm test
Project Structure
packages/
core/ @markdy/core β Parser + AST types (zero deps)
renderer-dom/ @markdy/renderer-dom β WAAPI renderer
cli/ @markdy/cli β CLI for local authoring workflows
astro/ @markdy/astro β Astro island component
mdx/ @markdy/mdx β MDX plugin + React diagram component with viewport hydration
stdlib-systems/ @markdy/stdlib-systems β System-diagram node vocabulary
markdy-language-server/ @markdy/language-server β Shared LSP server for editors
website/ Official markdy.com playground & website (Astro)
docs/
SYNTAX.md Full DSL reference
TUTORIAL.md Step-by-step human tutorial
AGENT.md Guide for AI agents / LLMs
ARCHITECTURE.md Technical deep dive
Scripts
| Command | Description |
|---|---|
pnpm build |
Build all packages and website |
pnpm test |
Run all tests (vitest) |
pnpm typecheck |
Type-check all packages |
pnpm clean |
Remove all dist/ directories |
pnpm run release <version> |
Full release train: commit/bump/changelog/validate β release PR β merge β tag β publish |
Deployment (Cloudflare)
The project is deployed via Cloudflare Pages (Workers Assets).
- Project Name:
markdy-com - Build command:
pnpm build - Deploy command:
cd website && npx wrangler deploy - Path:
/(repo root)
Documentation
| Document | Audience | Description |
|---|---|---|
| SYNTAX.md | All users | Complete DSL language reference |
| TUTORIAL.md | Humans | Step-by-step guide from zero to animated scenes |
| AGENT.md | AI agents / LLMs | Maintained source for the hosted agent guide and LLM context bundle |
| ARCHITECTURE.md | Contributors | Technical design, renderer internals, AST shape |
| CONTRIBUTING.md | Contributors | Dev setup, code style, PR guidelines |
Contributing
See CONTRIBUTING.md for development setup and guidelines.

Loving Markdy? Star the repository on GitHub! β
Built with β€οΈ by Hoang Yell & the open-source community.
License
MIT Β© Hoang Yell
Reviews (0)
Sign in to leave a review.
Leave a reviewNo results found

















