Graphdraft
LiveIs this graph model right before anyone writes a line of Cypher?
A property graph modelling tool. Define node labels, relationships and typed properties, see the model as a live diagram, and catch schema mistakes before they reach production. The standalone edition is a single offline HTML file; the hosted edition adds accounts, comments and review.

Case study
How it was built, tested, and where it stops
The problem
Graph models go wrong in ways that surface only once data and queries depend on them. The most natural-looking design is often the one that breaks: Airport -[FLIGHT]-> Airport reads well, but an edge cannot hold a booking, a crew or a gate, and two flights between the same airports on the same day become the same edge twice. Graphdraft is for designing and checking a model before anyone writes Cypher.
How it works
- Define node labels and typed properties (key, required, unique, indexed), then relationships with a cardinality. An importer can start a model from SQL: tables become nodes and foreign keys become relationships.
- Validation runs as you model. Errors (a relationship with no type or endpoint), warnings (no key property, duplicate or reciprocal relationships, orphan nodes) and advisories (missing descriptions) are listed beside the diagram.
- Exports Cypher constraints, indexes and parameterized MERGE statements, plus a data dictionary in CSV or Markdown to circulate for review.
- The standalone edition is one HTML file with zero dependencies that runs offline. The hosted edition reuses its modelling core and adds accounts, comments and review requests on Firebase Hosting, Auth and Firestore, with no backend server.
Decisions, and why
- The standalone edition is a single file: no CDN link, font or build step, ever.
- That is the product. It opens from a share drive or a laptop with no network, and needs no account.
- Review instead of live co-editing.
- Live co-editing needs conflict-free data types and an always-on relay, a fixed cost of $60 to $95 a month before the first user. Comments, a change log and review requests cover the need without it.
- One database document per node and per relationship, and diagram layout stored per user.
- Two people editing different nodes must not overwrite each other, and dragging a node must not collide with someone else's schema edit.
- Gallery models chosen by the mistake they teach.
- Each one answers a modelling question a competent person gets wrong on the first try.
Testing and validation
- A browser test harness drives real Chrome with no dependencies, built that way rather than on Playwright to keep the no-dependencies rule. It has 17 suites. A pre-commit hook checks that the two editions have not drifted apart.
- Every gallery model must load in the real app with zero validation issues and round-trip unchanged through JSON, YAML and XML.
- The Firestore security rules passed a 216-check matrix across five roles against the Firebase emulator. Its first run found two bugs that reading the rules had missed.
- There is no CI pipeline.
Limitations
- There is no undo in either edition. Version snapshots cover the catastrophic case.
- When two people edit the same field at the same moment, the last write wins.
- The force-directed layout stays smooth into the low hundreds of nodes. Past that, a grid or layered layout is needed.
- The YAML reader covers what the tool itself writes, not the full YAML specification.
Built by directing AI coding agents, with acceptance testing done by hand. How I build
What it does
- Validation flags duplicate labels, missing endpoints, nodes without a key property and orphans as you model.
- Exports Cypher (constraints, indexes, MERGE statements), GraphML, Mermaid, JSON, YAML, XML, CSV and a Markdown data dictionary.
- Seven importers, including one that turns SQL table definitions into a starting graph model.
- Collaborative edition with roles, comment threads pinned to a node or relationship, version snapshots and review requests.
- A gallery of worked models, each built around a common modelling mistake.
What a model exports
An excerpt of the Cypher that Graphdraft generates for its flight bookings gallery model, where a flight is a node with its own key, not an edge between two airports.
CREATE CONSTRAINT Flight_flightId_unique IF NOT EXISTS FOR (n:Flight) REQUIRE n.flightId IS UNIQUE;
CREATE CONSTRAINT Flight_departureDate_exists IF NOT EXISTS FOR (n:Flight) REQUIRE n.departureDate IS NOT NULL;
CREATE INDEX Flight_departureDate_idx IF NOT EXISTS FOR (n:Flight) ON (n.departureDate);
MATCH (a:Flight {flightId: $from_flightId}),
(b:Airport {iataCode: $to_iataCode})
MERGE (a)-[:DEPARTS_FROM]->(b); // n-1
MATCH (a:Flight {flightId: $from_flightId}),
(b:Airport {iataCode: $to_iataCode})
MERGE (a)-[:ARRIVES_AT]->(b); // n-1