SparseTree/
├── client/ # React + Vite + Tailwind frontend
├── server/ # Express API backend
├── shared/ # TypeScript types shared between client/server
├── lib/ # Core library (API client, path finding, etc.)
├── scripts/ # Migration and utility scripts
├── data/ # Local data storage (git-ignored)
├── .browser/ # Browser automation profile
├── docs/ # Documentation
└── .changelog/ # Release notes by version
- Node.js 18+
- npm 9+
git clone https://github.com/atomantic/SparseTree.git
cd SparseTree
npm install
npm run buildThe app runs via PM2 with auto-restart on file changes:
pm2 start ecosystem.config.cjs- Frontend: http://localhost:6373
- Backend: http://localhost:6374
To restart after config changes:
pm2 restart ecosystem.config.cjsNote: Don't use pm2 kill or pm2 delete all as this server may have multiple PM2 apps running.
npm run build # Build all workspaces
npm run build -w client # Build client only
npm run build -w server # Build server only
npm run build -w shared # Build shared types only| Script | Description |
|---|---|
npm run build |
Build all packages |
npm run dev |
Start development servers |
npm run migrate |
Run pending data migrations |
npm run migrate:status |
Check migration status |
npm run migrate:dry-run |
Preview migrations |
SparseTree uses Playwright to connect to a persistent Chrome instance for genealogy provider scraping.
./.browser/start.shOr with custom CDP port:
CDP_PORT=9920 ./.browser/start.shThe browser profile is stored in .browser/data/ to persist logins.
- Navigate to
/settings/browser - Click "Connect" to attach Playwright
- Navigate to
/providers/genealogyto log into providers
- Default port:
9920 - Config file:
data/browser-config.json - Auto-connect: Can be enabled to connect on server start
- main: Active development
- release: Push
maintoreleaseto trigger the GitHub Release workflow
Always use rebase:
git pull --rebase --autostash && git push# 1. Bump version in package.json
# 2. Ensure .changelog/v{major}.{minor}.x.md is up to date
# 3. Push to main, then trigger release:
git push origin main:releaseThe release workflow will create a GitHub Release, archive the changelog on main, and fast-forward the release branch to match.
- Create commits after each feature or bug fix
- Run lint before committing
- Update
.changelog/v{major}.{minor}.x.mdwith changes
All release notes are maintained in .changelog/v{major}.{minor}.x.md files:
- Add entries under appropriate emoji sections during development
- Keep version as
0.3.x(CI replaces with actual version on release) - Final review before pushing to
release
See .changelog/README.md for detailed format.
npm test # Run all tests
npm test -w server # Server tests only
npm test -w client # Client tests only- ES modules (
"type": "module"in package.json) - Functional programming preferred over classes
- No
try/catchif it can be avoided - No
window.alert/window.confirm- use toast and modals - DRY and YAGNI design patterns
- Full URL paths for routes (no spawning modals without deep links)
CSS variables in client/src/index.css with Tailwind utilities:
- Use
text-app-*,bg-app-*,border-app-*classes - Theme toggle in sidebar footer
- Dark mode:
.darkclass on<html>
See client/tailwind.config.js for all theme utilities.