Build, visualize, and share beautiful family trees.
Open-source, interactive, and free β forever.
β¨ Features Β· π Live Demo Β· π¦ Quick Start Β· π€ Contributing Β· π¬ Discussions
Stemma (noun) β a genealogical chart; from Greek ΟΟΞΞΌΞΌΞ±, "garland of ancestors." Stemmagraph turns that garland into an interactive, exportable graph anyone can explore.
- π¨ Interactive family tree canvas β drag, zoom, and pan a live genealogy graph built on React Flow
- π§ Multiple views β canvas, grid, table, and list for browsing members however you like
- π€ Rich member profiles β birth/death dates, places, profession, education, photos, contact info
- π Relationship types β parentβchild, marriage, and sibling edges with custom rendering
- π€ Export anywhere β download your tree as PDF or PNG image
- π Adapter pattern β swap between REST API, Supabase, or in-memory mock without touching UI code
- π Secure auth β JWT sessions + bcrypt password hashing
- π± Responsive β works seamlessly on desktop and mobile
Try Stemmagraph right now β no signup, no backend, no install:
The demo runs entirely in your browser using the in-memory mock adapter with the pre-seeded Wijaya family tree (11 members, 3 generations).
Demo login: demo@familytree.app / demo123
Want to run it locally? See Quick Start.
- Node.js 20.19+ or 22.12+ (recommend LTS 24)
- npm 10+
# Clone
git clone https://github.com/ltmoerdani/stemmagraph.git
cd stemmagraph
npm install
# Configure environment
cp .env.example .env
# Initialize the database
npm run db:migrate
npm run db:seed
# Start frontend + API together
npm run dev:full- Frontend: http://localhost:5201
- API: http://localhost:3001/api/v1
- Demo login:
demo@familytree.app/demo123
git clone https://github.com/ltmoerdani/stemmagraph.git
cd stemmagraph
npm install
# Use the mock data adapter
cp .env.github-pages .env
npm run devThe mock adapter serves seed data in-memory β perfect for exploring the UI or previewing your changes.
π Choose a data adapter
Stemmagraph uses an adapter pattern so the UI is backend-agnostic. Set VITE_DATA_ADAPTER in .env:
| Value | Backend | Use case |
|---|---|---|
mock |
In-memory | Demos, UI development, GitHub Pages |
rest |
Express API (this repo) | Full-featured local or self-hosted |
supabase |
Supabase | Managed PostgreSQL + auth |
# REST (default for full-stack dev)
VITE_DATA_ADAPTER=rest
VITE_API_BASE_URL=http://localhost:3001/api/v1
# Supabase
VITE_DATA_ADAPTER=supabase
VITE_SUPABASE_URL=https://your-project.supabase.co
VITE_SUPABASE_ANON_KEY=your-anon-key| Layer | Technology |
|---|---|
| Frontend | React 19, Vite 8, TypeScript 6 |
| Styling | Tailwind CSS v4 |
| Canvas | @xyflow/react v12 (React Flow) |
| State | Zustand 5 |
| Backend | Express 5, Prisma 7 |
| Database | SQLite (dev), PostgreSQL/MySQL ready |
| Auth | JWT + bcryptjs |
| Export | jsPDF, html2canvas |
| Script | Description |
|---|---|
npm run dev |
Start Vite dev server (frontend, port 5201) |
npm run dev:server |
Start Express API server (port 3001) |
npm run dev:full |
Start both frontend + API concurrently |
npm run build |
Production build (set GITHUB_PAGES=true for demo build) |
npm run preview |
Preview production build |
npm run lint |
Run ESLint |
npm run db:migrate |
Run Prisma migrations |
npm run db:seed |
Seed database with demo data |
npm run db:studio |
Open Prisma Studio GUI |
stemmagraph/
βββ src/ # Frontend (React + Vite)
β βββ components/ # UI components
β β βββ FamilyTree/ # Canvas, nodes, edges, controls
β β βββ Dashboard/ # Landing + tree management
β β βββ Forms/ # Member add/edit forms
β β βββ Sidebar/ # Stats + member detail panels
β β βββ Auth/ # Login page
β βββ store/ # Zustand state stores
β βββ lib/adapters/ # Data adapter pattern (REST/Supabase/Mock)
β βββ types/ # Shared TypeScript types
β βββ data/ # Mock data
βββ server/ # Backend (Express + Prisma)
β βββ index.ts # API server with JWT auth
βββ prisma/ # Database schema + migrations + seed
β βββ schema.prisma # Data models
β βββ migrations/ # SQL migrations
β βββ seed.ts # Demo data
βββ .github/workflows/ # CI + GitHub Pages deploy
βββ vite.config.ts # Vite config (base-path aware)
The adapter pattern (src/lib/adapters/) is the heart of Stemmagraph's flexibility β the entire UI talks to a single DataAdapter interface, so you can plug in any backend (or run fully client-side) without changing a line of component code.
Contributions of all sizes are welcome β bug reports, feature ideas, UI polish, docs, tests, or just a typo fix.
- β Star the repo to follow along
- π΄ Fork & clone your fork
- π Create a branch:
feat/my-awesome-idea - β
Run checks:
npm run lint && npx tsc --noEmit && npm run build - π€ Open a PR following the conventions
See CONTRIBUTING.md for the full workflow, branching, and commit conventions.
New to the codebase? Look for issues labeled good first issue β these are scoped to be friendly on-ramps.
- Internationalization (i18n) β share your locale in Discussions
- GEDCOM import/export
- Collaborative editing
- Photo gallery per member
- Automated tests (Vitest + Playwright)
Have an idea? Open a Discussion or an issue.
- Passwords hashed with bcrypt (12 rounds)
- JWT sessions with 7-day expiry
- Auth middleware protects all API routes except
/auth/loginand/auth/register - Input validation on every auth endpoint
See SECURITY.md for responsible disclosure.
Stemmagraph uses a dual-license model: open source + commercial.
| Use case | License |
|---|---|
| Personal use, study, modify, share | AGPL-3.0 β free |
| Self-host as SaaS (you publish your source) | AGPL-3.0 β free |
| Closed-source SaaS or proprietary product | Commercial License β paid |
TL;DR: AGPL-3.0 means anyone who offers Stemmagraph as a network service must publish their modifications. If that doesn't work for you (e.g. you're building a closed-source SaaS), you can purchase a commercial license β contact ltmoerdani@gmail.com.
Contributors: by submitting a PR, you agree to the CLA so we can
offer both licenses. See COMMERCIAL_LICENSE.md for details.
This model is used by Mattermost, MinIO, Sentry, Plausible, Mastodon β it keeps the project open source forever while funding development.
β Star Β· π Report bug Β· π‘ Request feature Β· π¬ Discuss
Made with π³ for everyone who wants to remember where they came from.