Skip to content

ltmoerdani/stemmagraph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

41 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

🌳 Stemmagraph

Build, visualize, and share beautiful family trees.
Open-source, interactive, and free β€” forever.

Live Demo License: AGPL v3 Commercial License CI Deploy

TypeScript React Vite Prisma React Flow

✨ 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.

✨ Features

  • 🎨 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

πŸš€ Live Demo

Try Stemmagraph right now β€” no signup, no backend, no install:

πŸ”— https://ltmoerdani.github.io/stemmagraph/

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.

πŸ“¦ Quick Start

Prerequisites

  • Node.js 20.19+ or 22.12+ (recommend LTS 24)
  • npm 10+

Option A β€” Local development (full stack)

# 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

Option B β€” Frontend-only demo (no backend)

git clone https://github.com/ltmoerdani/stemmagraph.git
cd stemmagraph
npm install

# Use the mock data adapter
cp .env.github-pages .env
npm run dev

The 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

πŸ› οΈ Tech Stack

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

πŸ“œ Scripts

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

πŸ—οΈ Architecture

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.

🀝 Contributing

Contributions of all sizes are welcome β€” bug reports, feature ideas, UI polish, docs, tests, or just a typo fix.

  1. ⭐ Star the repo to follow along
  2. 🍴 Fork & clone your fork
  3. πŸ”€ Create a branch: feat/my-awesome-idea
  4. βœ… Run checks: npm run lint && npx tsc --noEmit && npm run build
  5. πŸ“€ Open a PR following the conventions

See CONTRIBUTING.md for the full workflow, branching, and commit conventions.

Good first issues

New to the codebase? Look for issues labeled good first issue β€” these are scoped to be friendly on-ramps.

Roadmap

  • 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.

πŸ” Security

  • Passwords hashed with bcrypt (12 rounds)
  • JWT sessions with 7-day expiry
  • Auth middleware protects all API routes except /auth/login and /auth/register
  • Input validation on every auth endpoint

See SECURITY.md for responsible disclosure.

πŸ“„ License β€” dual-licensed

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.

About

🌳 Open-source interactive family tree platform β€” build, visualize, and export genealogical graphs. React + Vite + React Flow.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages