Restore, secure, test, and deploy the legacy OCaml genealogy software GeneWeb (1995-2008) without altering its core behavior.
GeneWeb is an open-source genealogy application written in OCaml that:
- Imports/exports GEDCOM files (genealogical data format)
- Stores data in proprietary
.gwbbinary databases - Serves family tree web pages via the
gwddaemon - Provides admin UI via
gwsetupdaemon
- macOS or Linux (x86_64)
- Python 3.11+ (for running tests and Python proxy server)
- Basic terminal/command-line knowledge
- A web browser
There are two ways to use GeneWeb depending on your needs:
This is what CI uses and what you need for running Python tests:
# 1. Clone the repository
git clone https://github.com/Antonyjin/Legacy-Project.git
cd Legacy-Project
# 2. Start gwd on test port (23179)
cd GeneWeb
./gw/gwd -hd ./gw -bd ./bases -p 23179 -lang en &
cd ..
# 3. Verify it's running
curl http://localhost:23179/test
# Should return HTML with "GeneWeb"
# 4. Setup Python virtual environment (recommended)
python3 -m venv venv
source venv/bin/activate # On macOS/Linux
pip install -r requirements.txt
# 5. Run Python tests
pytest tests/python/ -v
# 6. Stop gwd when done
pkill -f gwd
# 7. Deactivate venv when done (optional)
deactivateAccess test database:
- π Main app: http://localhost:23179/test
- π€ Person page: http://localhost:23179/test?p=Charles&n=Windsor
- π Statistics: http://localhost:23179/test?m=STAT
Database: test.gwb contains British Royal Family data (188 persons)
If you want to explore GeneWeb manually (not for testing):
macOS/Linux - Manual Start (Recommended):
cd Legacy-Project/GeneWeb
# Start gwd (web server) on port 2317
./gw/gwd -hd ./gw -bd ./bases -p 2317 -lang en &
# Start gwsetup (admin interface) on port 2316 - optional
./gw/gwsetup -gd ./gw -lang en &
# Access application
echo "Main app: http://localhost:2317/test"
echo "Admin: http://localhost:2316"macOS - Using geneweb.sh (Alternative):
cd GeneWeb
./geneweb.sh
# Note: This legacy script may have path issues. Use manual start above if it fails.Access application:
- π Main app: http://localhost:2317/test
- βοΈ Admin panel: http://localhost:2316
- π Landing page: Open
GeneWeb/START.htmin browser
Stop servers:
pkill -f gwd
pkill -f gwsetupTry these pages (adjust port as needed: 23179 for testing, 2317 for manual):
- π Home:
http://localhost:23179/test - π€ Person:
http://localhost:23179/test?p=Charles&n=Windsor - π¨βπ©βπ§βπ¦ Family:
http://localhost:23179/test?m=F&p=charles&n=windsor - π
Calendar:
http://localhost:23179/test?m=CAL - π First names:
http://localhost:23179/test?m=P - π Surnames:
http://localhost:23179/test?m=N - π Statistics:
http://localhost:23179/test?m=STAT
Create and activate a virtual environment (recommended):
# Create virtual environment
python3 -m venv venv
# Activate it
source venv/bin/activate # On macOS/Linux
# On Windows: venv\Scripts\activate
# Install Python dependencies
pip install -r requirements.txt
# Verify installation
pip list | grep -E "(pytest|flask|requests)"Or use the setup script:
./python_app/setup_venv.sh
source venv/bin/activateNote: Always activate the virtual environment before running tests or the Python server.
We have comprehensive Python tests that validate OCaml behavior:
# From project root (Legacy-Project/)
# Run all Python tests
pytest tests/python/ -v
# Run with coverage
pytest tests/python/ --cov=tests/python --cov-report=html
# Run specific test type
pytest tests/python/unit/ -v # Unit tests- β
CI BLOCKING
pytest tests/python/integration/ -v # Integration tests β
CI BLOCKING
pytest tests/python/functional/ -v # Functional tests
# Run by marker
pytest -m unit # Unit tests only
pytest -m integration # Integration tests only
pytest -m functional # Functional tests onlyTest Status:
- β Unit Tests: Test OCaml behavior via HTTP/Python utilities β CI blocks on failure
β οΈ Integration Tests: gwd lifecycle, port conflicts, concurrency β CI blocksβ οΈ Functional Tests: End-to-end user workflows β nonβblocking during development
Problem: Some integration tests fail due to OCaml gwd daemonization behavior.
Root Cause: OCaml gwd daemonizes (parent process exits immediately after forking), causing tests to fail with:
RuntimeError: gwd exited unexpectedly while starting
Solution: Apply the process management fix from IT-PY-003 to affected test files:
- Replace
proc.poll()checks with HTTP readiness checks - Use
pkillfor reliable cleanup - Check
is_running()instead of process status
Files Needing Fix:
test_html_generation.py(10 tests)test_authentication.py(9 tests)test_error_handling.py(13 tests)test_localization.py(9 tests)test_performance.py(11 tests)
Golden tests validate that OCaml output remains unchanged. They are optional and disabled by default in CI; run them locally or on-demand in CI.
# From project root
export LC_ALL=C.UTF-8 TZ=UTC
chmod +x ./scripts/golden/run_golden.sh
./scripts/golden/run_golden.sh validateWhat this tests:
- GEDCOM export consistency
- HTML rendering stability (10 page types)
- Data normalization (whitespace, timestamps, random IDs)
Note: Golden tests are disabled by default in CI and can be triggered on demand (see .github/workflows/ci.yml).
- This README - Quick start
- Wiki Home - Full documentation
- Product Runbook - How to run GeneWeb
- OCaml Overview - Understanding the codebase
- CI Workflow Guide - Understanding CI setup
- Code Quality Guide - Running quality checks locally
- Branch Protection Setup - Protect
mainwith CI checks - Golden Tests - Create/validate golden references
- Test Policy - QA strategy
- Test Protocols - Test types (UT/IT/FT)
- Architecture - System design
- Unit Test README - Python unit testing strategy
- Integration Test README - Integration testing guide
- Python Proxy Server - Proxy server documentation
Legacy-Project/
βββ GeneWeb/ # Main OCaml application (prebuilt binaries)
β βββ gw/ # Binaries (gwd, gwsetup, ged2gwb, gwb2ged)
β βββ bases/ # Databases (test.gwb with 188 persons)
β βββ geneweb.sh # Launcher script (macOS)
β βββ START.htm # Landing page
βββ scripts/ # Test and utility scripts
β βββ golden/ # Golden test harness (currently disabled)
β βββ run_golden.sh # Main golden test script
β βββ test_gedcom_import.sh # GEDCOM roundtrip test
βββ tests/ # Python tests
β βββ python/
β β βββ unit/ # Unit tests β
β β βββ integration/ # Integration tests β οΈ
β β βββ functional/ # Functional tests β οΈ
β βββ golden/ # Golden references (disabled)
β βββ goldens/v1/ # Versioned golden snapshots
βββ docs/ # Project documentation
β βββ CI_WORKFLOW_GUIDE.md # CI setup guide
βββ .github/workflows/ # CI/CD pipelines
β βββ ci.yml # Main CI workflow
βββ pytest.ini # Pytest configuration
βββ .coveragerc # Coverage configuration
βββ requirements.txt # Python dependencies
| Binary | Purpose | Example Usage |
|---|---|---|
gwd |
Web daemon (serves pages) | gwd -hd ./gw -bd ./bases -p 2317 -lang en |
gwsetup |
Admin interface | gwsetup -gd ./gw -lang en |
ged2gwb |
GEDCOM β GeneWeb import | ged2gwb input.ged -o bases/mybase |
gwb2ged |
GeneWeb β GEDCOM export | gwb2ged bases/mybase.gwb -o output.ged |
gwu |
Text export utility | gwu bases/mybase.gwb > dump.gw |
We have 3 test categories (4th coming soon):
- β Unit Tests - Test OCaml functions via HTTP/Python β Blocks CI
β οΈ Integration Tests - gwd lifecycle, ports, concurrency β Blocks CIβ οΈ Functional Tests - End-to-end user workflows β In development (nonβblocking)- π Golden Tests - Regression detection β Optional/onβdemand
See Test Protocols and CI Workflow Guide for details.
# macOS/Linux - Find and kill processes
lsof -ti:2317 | xargs kill -9
lsof -ti:2316 | xargs kill -9
# Or use pkill
pkill -f gwd
pkill -f gwsetup# Make sure gwd is running on the correct port
ps aux | grep gwd
# Check if test database exists
ls -la GeneWeb/bases/test.gwb/
# Verify Python dependencies
pip list | grep pytest- The bundled binaries in
GeneWeb/are for macOS only - Download Linux binaries from GeneWeb releases
- Follow the Linux setup instructions above
- Tree and search pages require Sosa reference configuration
- Use gwsetup to configure a Sosa root person
- Access gwsetup at http://localhost:2316
- See ISSUE_50_SKIPPED.md for details
# Regenerate goldens if changes are intentional
export LC_ALL=C.UTF-8 TZ=UTC
./scripts/golden/run_golden.sh create
# Note: Golden tests are currently disabled in CI
# They will be re-enabled during Week 2-3 migration phase# Make sure you're in the project root
cd Legacy-Project
# Install dependencies
pip install -r requirements.txt
# Verify pytest works
pytest --versionDay 1: Understand the basics
- Read this README
- Launch GeneWeb with
./GeneWeb/geneweb.sh(macOS) or follow Linux instructions - Explore the test database pages
- Read OCaml Overview
Day 2: Understand the tests
- Install Python dependencies:
pip install -r requirements.txt - Run Python tests:
pytest tests/python/ -v - Review Test Protocols
- Check CI Workflow Guide
- Check CI results on GitHub Actions
Day 3: Understand the architecture
- Read Architecture
- Read Runbook
- Try importing your own GEDCOM file
- Unit and integration tests are enforced in CI; functional tests are allowed to fail during development.
- Coverage is reported; thresholds may not be enforced yet.
- See
docs/CI_WORKFLOW_GUIDE.mdfor current details.
New! Python Flask proxy server with backend toggle (OCaml/Python).
See python_app/README.md for full documentation.
Quick start:
# Setup virtual environment (if not done)
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Run server with OCaml backend (default)
BACKEND=ocaml python -m python_app.app
# Run with Python backend (uses migrated functions)
BACKEND=python python -m python_app.appAccess: http://localhost:2318/test
Issue: #225 - [MIG-INF-001] Create Python proxy server with BACKEND toggle
- Create a feature branch:
git checkout -b feature-name - Setup virtual environment:
python3 -m venv venv && source venv/bin/activate - Install dependencies:
pip install -r requirements.txt - Make changes and test locally:
pytest tests/python/ -v - Commit with conventional commits:
feat:,fix:,docs:, etc. - Push and create a PR
- CI will automatically run all tests
Branch Protection Rules:
- β Unit tests must pass
- β Integration tests must pass
β οΈ Functional tests may fail (in development)
- Wiki: https://github.com/Antonyjin/Legacy-Project/wiki
- Issues: https://github.com/Antonyjin/Legacy-Project/issues
- Upstream GeneWeb: https://geneweb.tuxfamily.org/
- CI Status: https://github.com/Antonyjin/Legacy-Project/actions
GeneWeb is distributed under the GNU General Public License. See LICENSE.txt.
# ==========================================
# Start GeneWeb - FOR TESTING (Port 23179)
# ==========================================
# Start gwd (what CI uses)
cd Legacy-Project/GeneWeb
./gw/gwd -hd ./gw -bd ./bases -p 23179 -lang en &
cd ..
# Verify it's running
curl http://localhost:23179/test
# Stop
pkill -f gwd
# ==========================================
# Start GeneWeb - FOR MANUAL USE (Port 2317)
# ==========================================
# Recommended manual start
cd Legacy-Project/GeneWeb
./gw/gwd -hd ./gw -bd ./bases -p 2317 -lang en &
./gw/gwsetup -gd ./gw -lang en &
# Alternative: Use legacy script (may have issues)
./geneweb.sh
# Stop
pkill -f gwd
pkill -f gwsetup
# ==========================================
# Python Tests (from project root)
# ==========================================
# IMPORTANT: Start gwd on port 23179 first (see above)
# Setup virtual environment (recommended)
python3 -m venv venv
source venv/bin/activate # On macOS/Linux
pip install -r requirements.txt
# Run all tests
pytest tests/python/ -v
# Deactivate venv when done
# deactivate
# Run by type
pytest tests/python/unit/ -v # Unit tests
pytest tests/python/integration/ -v # Integration tests
pytest -m unit # Unit marker
pytest -m integration # Integration marker
# With coverage
pytest tests/python/ --cov=tests/python --cov-report=html
# Specific test file
pytest tests/python/unit/test_http_params.py -v
# ==========================================
# Golden Tests (disabled, for reference)
# ==========================================
# Validate (when re-enabled)
export LC_ALL=C.UTF-8 TZ=UTC
./scripts/golden/run_golden.sh validate
# Regenerate goldens
./scripts/golden/run_golden.sh create
# ==========================================
# GEDCOM Import/Export
# ==========================================
# Export GEDCOM
GeneWeb/gw/gwb2ged GeneWeb/bases/test.gwb -o export.ged
# Import GEDCOM
GeneWeb/gw/ged2gwb input.ged -o GeneWeb/bases/newbase
# ==========================================
# Check Status
# ==========================================
# Check if gwd is running
ps aux | grep gwd
# Check CI status
# Visit: https://github.com/Antonyjin/Legacy-Project/actions
# Check test database
ls -la GeneWeb/bases/test.gwb/
# Check Python installation
python --version # Should be 3.11+
pytest --version
# ==========================================
# Python Proxy Server (MIG-INF-001)
# ==========================================
# Setup (one-time)
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Run with OCaml backend (default)
BACKEND=ocaml python -m python_app.app
# Run with Python backend
BACKEND=python python -m python_app.app
# Access: http://localhost:2318/testNeed help? Start with the Wiki Home, check CI Workflow Guide, or ask in Issues! π
- Deployment Guide - Complete guide for local, Docker, and production deployment
- CI/CD Guide - How the CI/CD pipeline works and how to debug issues
The following architectural decision records document all major decisions made during the project:
- ADR-004: Migration Strategy - Phased, test-driven approach with black-box testing
- ADR-005: Testing Approach - Four-tier testing strategy (unit, integration, golden, smoke)
- ADR-006: Deployment Platform - Docker on VPS with docker-compose
- ADR-007: CI/CD Pipeline - GitHub Actions-based automation