README.md (2199B)
1 # Family Tree 2 3 Self-hosted family tree builder, served at [familytree.piribauer.ch](https://familytree.piribauer.ch). 4 5 ## Stack 6 7 - Backend: FastAPI (Python 3.10+) with SQLAlchemy and SQLite 8 - Frontend: Vanilla JS/HTML/CSS with D3.js for the canvas (Nord theme) 9 - Auth: Authentik forward-auth via nginx 10 11 ## Features 12 13 Each user can create their own family tree. Others can be added directly by their Authentik username via the "Manage members" modal. Trees have three roles: owner, editor, and viewer. 14 15 The interface is a zoomable and pannable canvas. Each person is shown as a card; partnerships are drawn as horizontal connectors, parent-child links as vertical lines. Clicking a card opens a detail panel with full info (name, birth/death dates and places, burial place, biography) and a list of partners, children, parents, and siblings. Siblings are derived from shared parent links rather than stored as a direct relationship. 16 17 When adding a new person, a connection dialog appears to immediately link them to an existing person as a partner, child, parent, or sibling. 18 19 The layout uses a Sugiyama-style algorithm with barycentric crossing minimisation to minimise crossing edges across generations. 20 21 A **Download PDF** button renders the full tree at print resolution with all person details (name, dates, places, biography excerpt) embedded in each card. 22 23 ## Installation 24 25 ```console 26 $ python -m venv venv 27 $ venv/bin/pip install -r requirements.txt 28 ``` 29 30 Create the database directory: 31 32 ```console 33 # mkdir -p /var/lib/familytree 34 # chown julian:julian /var/lib/familytree 35 ``` 36 37 Create `.env` from `.env.example`, then install the service and nginx config: 38 39 ```console 40 # cp familytree.service /etc/systemd/system/ 41 # systemctl daemon-reload && systemctl enable --now familytree 42 # cp nginx/family /etc/nginx/sites-available/family 43 # ln -s /etc/nginx/sites-available/family /etc/nginx/sites-enabled/family 44 # nginx -t && systemctl reload nginx 45 ``` 46 47 ## Schema migrations 48 49 SQLAlchemy creates missing tables on startup but does not alter existing ones. Any new columns must be added manually, e.g.: 50 51 ```console 52 $ sqlite3 /var/lib/familytree/familytree.db "ALTER TABLE persons ADD COLUMN notes TEXT;" 53 ```