Overview
Discover what makes Gramps Web powerful
Gramps Web is a fully self‑hosted genealogy platform that exposes the rich data model of the Gramps desktop application through a modern, stateless REST API. The backend is written in **Python 3** and built atop the **FastAPI** framework, leveraging asynchronous request handling to serve concurrent genealogy queries with low latency. The API layer sits directly on top of Gramps’ native SQLite or PostgreSQL database, exposing CRUD operations for persons, families, events, sources, and media. This separation of concerns allows developers to integrate genealogy data into custom dashboards, mobile apps, or third‑party analytics tools without duplicating the complex data model that Gramps already provides.
Framework
Data Layer
Serialization
Deployment
Overview
Gramps Web is a fully self‑hosted genealogy platform that exposes the rich data model of the Gramps desktop application through a modern, stateless REST API. The backend is written in Python 3 and built atop the FastAPI framework, leveraging asynchronous request handling to serve concurrent genealogy queries with low latency. The API layer sits directly on top of Gramps’ native SQLite or PostgreSQL database, exposing CRUD operations for persons, families, events, sources, and media. This separation of concerns allows developers to integrate genealogy data into custom dashboards, mobile apps, or third‑party analytics tools without duplicating the complex data model that Gramps already provides.
Architecture
- Framework: FastAPI (Python 3.11+) – offers automatic OpenAPI generation, dependency injection, and built‑in support for OAuth2/JWT authentication.
- Data Layer: Gramps’ own ORM (Python objects) backed by SQLite or PostgreSQL. The API uses the
grampsPython package to load, query, and persist the genealogy database. - Serialization: Pydantic models define request/response schemas, ensuring type safety and validation across the API surface.
- Deployment: The project ships a pre‑built Docker image (
gramps-project/gramps-web-api) that bundles Gunicorn with Uvicorn workers, making it trivial to run behind a reverse proxy (NGINX, Traefik) or within Kubernetes. - Observability: Structured JSON logs and Prometheus metrics endpoints (
/metrics) enable integration with Grafana or Loki for monitoring.
Core Capabilities
- Full CRUD: Create, read, update, and delete all Gramps entities via RESTful endpoints (
/api/persons,/api/families, etc.). - Advanced Querying: Filter, sort, and paginate results with query parameters (
?surname=Smith&limit=20). The API also supports complex searches (e.g., location, date ranges) through a dedicated/searchendpoint. - Batch Operations: Import or export entire GEDCOM files (
/api/import,/api/export) to migrate data between Gramps installations. - Webhooks & Events: Subscribe to database change events via a WebSocket endpoint (
/ws/events) for real‑time synchronization in collaborative environments. - Authentication & Authorization: Role‑based access control (admin, editor, viewer) is configurable through JSON Web Tokens, allowing fine‑grained permissions for multi‑user deployments.
Deployment & Infrastructure
The self‑hosted nature of Gramps Web makes it ideal for privacy‑centric genealogy projects. Key deployment considerations:
- Containerization: The Docker image is lightweight (~200 MB) and supports environment variables for database credentials, secret keys, and logging levels.
- Scalability: As a stateless API, multiple replicas can be spun up behind a load balancer. The underlying Gramps database can be switched from SQLite (single‑user) to PostgreSQL for concurrent access.
- Persistence: The Gramps database file or PostgreSQL cluster must be mounted as a persistent volume. Backups can be automated via cron jobs that snapshot the SQLite file or perform logical PostgreSQL dumps.
- Security: TLS termination is recommended at the reverse proxy. The API enforces HTTPS, HSTS headers, and rate limiting through middleware.
Integration & Extensibility
- Plugin System: Developers can write Python plugins that hook into Gramps’ event system and expose new API endpoints. The plugin registry is discovered at startup, allowing custom extensions without modifying core code.
- External APIs: Gramps Web can act as a data source for other genealogy tools (e.g., FamilySearch, Ancestry) via its OpenAPI spec. The API supports CORS configuration for cross‑origin consumption.
- Webhooks: Third‑party services can register webhook URLs to receive notifications on data changes, enabling real‑time updates in external dashboards or mobile apps.
- Custom Frontends: The provided Gramps Web frontend is a single‑page React application, but the API is framework agnostic. Developers can build their own UIs or embed Gramps data into existing web portals.
Developer Experience
- Documentation: The project hosts comprehensive API docs (Swagger UI) at
/docsand a dedicated developer portal with code samples, authentication flows, and plugin guides. - Community: An active GitHub repository with issue tracking, pull request reviews, and a Discord channel facilitates rapid feedback. The Gramps community has a long history of open‑source genealogy development, ensuring backward compatibility and shared best practices.
- Testing: The codebase includes extensive unit tests (pytest) and integration tests against a temporary SQLite database, allowing developers to run CI pipelines confidently.
Use Cases
| Scenario | How Gramps Web Helps |
|---|---|
| Collaborative Research Group | Multiple editors can simultaneously edit a shared family tree via the API, with real‑time event streams keeping everyone in sync. |
| Custom Mobile App | A native iOS/Android app can fetch genealogy data through the REST API, while keeping all privacy controls on the server. |
| Data Migration | Import legacy GEDCOM files into Gramps, expose them via the API, and then export to other genealogy platforms or analytics tools. |
| Educational Projects | Students can deploy a local Gramps Web instance, learn about RESTful design, and practice querying genealogical data programmatically. |
Advantages
- Native Gramps Integration: No
Open SourceReady to get started?
Join the community and start self-hosting Gramps Web today
Related Apps in other
Immich
Self‑hosted photo and video manager
Syncthing
Peer‑to‑peer file sync, no central server
Strapi
Open-source headless CMS for modern developers
reveal.js
Create stunning web‑based presentations with HTML, CSS and JavaScript
Stirling-PDF
Local web PDF editor with split, merge, convert and more
MinIO
Fast, S3-compatible object storage for AI and analytics
Weekly Views
Repository Health
Information
Explore More Apps
Plane
Open‑source project management for teams
Hatsu
Bridge static sites to the Fediverse automatically
DailyTxT
Encrypted diary web app with markdown, file uploads, and multi‑user support
SQLPage
Build data‑centric web apps with pure SQL
Minus Games
Sync and distribute games across devices
sish
Self-hosted SSH tunnel for web services
