Client-Side Genealogy: Why I Built and Open-Sourced React Family Tree
Existing self-hosted genealogy tools needed heavy database containers, and commercial viewers cost $500+. So I built a client-side React genealogy viewer, open-sourced @fahim-a/react-family-tree on GitHub, and used it to publish my family's multi-century tree on fahim.ca.
After moving fahim.ca off Ghost/MySQL onto static React and Cloudflare Pages, I finally had a clean place to tackle another project: putting my family's multi-generational tree online without paying for a proprietary viewer or spinning up another database container on my Unraid box.
Nothing open-source fit what I wanted, so I built and open-sourced @fahim-a/react-family-tree—an MIT-licensed, client-side React library with GEDCOM and JSON support, bimodal DAG layout, pan/zoom canvas, photo tagging, living-person privacy redaction, and a built-in editor.
Why existing tools didn't fit
For over twenty years, our family records lived in desktop tools (mainly Gramps) and grew to 226 people across 9 generations. When I looked for a way to publish an interactive version for extended family, the options fell into four buckets:
| Category |
Typical Solutions |
Trade-offs |
| Self-hosted web stacks |
webtrees, Gramps Web |
Require dedicated Docker containers, MySQL/MariaDB, Redis, and PHP/Python runtimes. After just retiring MySQL on Unraid, adding another persistent database just for static family history wasn't appealing. |
| Desktop suites |
Gramps, RootsMagic, Family Tree Maker |
Great for research, but their HTML web exports are dated, static tables. |
| Commercial JS libraries |
Balkan FamilyTreeJS |
Closed-source core, $500+ commercial licenses, watermarked free tiers, and redistribution restrictions. |
| Legacy open-source viewers |
Old D3 v3 / jQuery scripts |
Dated UI, broken mobile touch controls, no TypeScript, and layouts that break on multi-spouse or intermarried branches. |
A family tree is a DAG
At its core, a family tree is a Directed Acyclic Graph (DAG): individuals are nodes, marriages/unions are gate nodes, and parent-child and spouse links are directed edges. A standard GEDCOM 5.5.1 / 7.0 file or normalized JSON already holds the whole graph.
You don't need a backend database to render that. Modern browsers can parse a 10,000-line GEDCOM file in ~15 ms, compute non-overlapping node positions, and render a 60 FPS canvas with SVG bezier connectors.
How @fahim-a/react-family-tree works

Parsing and normalization
The library accepts .ged strings or raw JSON objects. A treeNormalizer helper converts array-based people lists or dictionary records into indexed maps, resolves property aliases (husbandId vs husband, childrenIds vs children), and patches missing reciprocal famc (child) and fams (spouse) pointers.
Bimodal DAG layout
Unlike single-root org charts that only expand downward, genealogy needs bimodal rendering:
- Ancestors expand upwards into pedigree branches.
- Descendants expand downwards into family clusters.
- Spouses stay locked on the same horizontal generation plane.
- Generation labels track biological depth dynamically (e.g., Generation 1 great-grandparents down to Generation 9 children).
Canvas, detail drawer, and photo tagging
- Navigation: Mouse-wheel zoom (0.2x to 2.5x), drag-to-pan, two-finger mobile pinch-to-zoom, and an optional corner mini-map.
- Detail drawer: Clicking any person opens vitals, bio, quick-jumps (Parents, Spouses, Siblings, Children), and kinship labels (e.g., "2nd Cousin 1x Removed").
- Photo tagging: Group portraits support bounding-box tags for multiple relatives on one image.
Built-in editor and privacy filter
Edit mode lets you add relatives ([+] Parent, [+] Spouse, [+] Child), edit dates/places/notes, unlink or cascade-delete subtrees, undo/redo with Ctrl+Z / Ctrl+Y, and export back to GEDCOM 5.5.1 or JSON.
For public sites, a configurable privacy filter detects living relatives (missing death records or born after a cutoff year) and redacts full birthdates, maiden names, and sensitive notes.
Publishing my own family tree
Extracting the full 226-person graph from our draft diagram was too cluttered for a phone screen—intermarriages and in-law branches pulled in over 90 distant collateral relatives:
[226-Person Master Graph]
├── Core Direct Paternal Line (40 People: Multi-Century Pedigree)
├── Maternal & In-Law Branches (98 People: Collateral Lineages)
├── Extended Collateral Clusters (70 People: In-Laws & Extended Families)
└── Distant Regional Clusters (18 People)
I'm using the built-in editor to prune it down to the core lines: the direct patrilineal line from our earliest documented ancestor in the early 1800s, direct maternal grandparents and great-grandparents, and tagged historical portraits—trimming out distant in-law branches that clutter the canvas.
Since @fahim-a/react-family-tree is a React component styled with Tailwind CSS, it drops right into fahim.ca under its own route (/family or /tree), shares the site's light/dark theme, and runs on Cloudflare Pages with 0 MB of server RAM and $0/month hosting.
Install and usage
@fahim-a/react-family-tree is MIT-licensed:
npm install @fahim-a/react-family-tree
import React, { useState } from 'react';
import { FamilyTree, parseGedcom, TreeData } from '@fahim-a/react-family-tree';
import '@fahim-a/react-family-tree/style.css';
export function MyFamilyTree() {
const [treeData, setTreeData] = useState<TreeData>(() =>
parseGedcom(rawGedcomString)
);
return (
<div className="w-full h-screen bg-slate-950">
<FamilyTree
data={treeData}
isDark={true}
readOnly={false}
onTreeChange={updated => setTreeData(updated)}
/>
</div>
);
}
The repo includes historical benchmark datasets (the 487-person Queen Victoria descendants, House of Tudor, and House of Habsburg pedigree collapse) and 107 unit tests at 100% coverage.