Lands sections 6 and 8 of relocate-brouter-to-dedicated-host on top of the host compose in #291. ## Observability (section 6) - **Prometheus**: new `brouter-cadvisor` job scraping `10.0.1.10:8080` over the vSwitch, labeled `host="brouter"`. - **cAdvisor sidecar** on the dedicated host's compose (`--docker_only --whitelisted_container_labels=trails.cool.service`) so metrics only cover trails containers, never the operator's unrelated workloads on the shared box. - **Promtail sidecar** on the dedicated host, Docker SD with relabel- drop on missing `trails.cool.service` label, pushing to flagship Loki at `http://10.0.0.2:3100/loki/api/v1/push`. - **Flagship compose**: Loki now publishes port 3100 on the vSwitch IP only (10.0.0.2:3100) — Hetzner Cloud firewall blocks it from the public internet. - **Grafana dashboard**: `brouter.json` — scrape up/down, request rate (from Planner-side `brouter_request_duration_seconds`), p50/p95/p99, container memory/CPU, Loki logs panel. - **Alert**: `brouter-scrape-down` fires on `up{job="brouter-cadvisor"} < 1 for 2m`; `noDataState: Alerting` so a total scrape failure still pages. Operator needs one UFW rule on the dedicated host for the cAdvisor port — documented in `infrastructure/brouter-host/README.md`. ## Documentation (section 8) - `CLAUDE.md` — hosts table + updated deployment table with SSH targets per workflow; BRouter host SSH is `-p 2232 trails@...`, different key. - `docs/architecture.md` — Hosting section rewritten to cover both hosts, vSwitch boundary, and the observability-scoping rationale for the shared dedicated host. - `docs/deployment.md` (new) — full operator runbook: host layout, first-time BRouter provisioning, SOPS rotation (including the macOS `SOPS_AGE_KEY_FILE` gotcha), cutover procedure with rollback, manual workflow triggers. Task 8.4 (infrastructure/README.md) skipped: that file doesn't exist and the ground is covered by brouter-host/README.md + docs/deployment.md. ## Validation - `docker compose config` on both the flagship and brouter-host compose files — both validate. - `pnpm typecheck`, `pnpm lint`, `pnpm test` — all clean (full turbo cache hits; no code changes in this commit). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .claude | ||
| .github | ||
| apps | ||
| docker/brouter | ||
| docs | ||
| e2e | ||
| infrastructure | ||
| openspec | ||
| packages | ||
| scripts | ||
| .gitignore | ||
| .gitleaks.toml | ||
| .mcp.json | ||
| .prettierrc | ||
| .sops.yaml | ||
| CLAUDE.md | ||
| docker-compose.dev.yml | ||
| eslint.config.js | ||
| LICENSE | ||
| package.json | ||
| playwright.config.ts | ||
| pnpm-lock.yaml | ||
| pnpm-workspace.yaml | ||
| README.md | ||
| SECURITY.md | ||
| tsconfig.base.json | ||
| turbo.json | ||
| vitest.config.ts | ||
| vitest.setup.ts | ||
| vitest.shared.ts | ||
trails.cool
Collaborative route planning and federated activity sharing for outdoor enthusiasts.
Planner — Plan routes together in real-time. Share a link, invite friends, edit waypoints collaboratively. Powered by BRouter for intelligent routing with elevation awareness.
Journal — Track your adventures. Import activities from Garmin, Strava, or Wahoo. Share routes and rides with friends. Self-host your own instance and federate with others via ActivityPub.
Status
Early development. See the architecture plan and project philosophy.
Project Structure
This is a TypeScript monorepo using pnpm workspaces and Turborepo.
apps/
planner/ Collaborative route editor (React Router 7 + Yjs + Leaflet)
journal/ Activity social platform (React Router 7 + Fedify + PostGIS)
packages/
types/ Shared TypeScript interfaces
ui/ Shared React components (Tailwind)
map/ Leaflet map wrappers
gpx/ GPX parsing and generation
i18n/ Internationalization (English + German)
Getting Started
Prerequisites: Node.js 20+, pnpm, Docker
# Clone
git clone https://github.com/trails-cool/trails.git
cd trails
# Install dependencies
pnpm install
# Start development (apps only, no database or routing)
pnpm dev
# Start full stack (PostgreSQL + BRouter + apps)
pnpm dev:full
Full Local Dev Setup
pnpm dev:full starts everything needed to test the Planner end-to-end:
- PostgreSQL + PostGIS on port 5432 (via Docker)
- BRouter routing engine on port 17777 (via Docker)
- Database schema pushed automatically via Drizzle
- BRouter segment downloaded for Berlin area (~124MB, cached)
- Journal on http://localhost:3000
- Planner on http://localhost:3001
Other useful commands:
pnpm dev:services # Start Docker services only (DB + BRouter)
pnpm db:push # Push database schema changes
pnpm db:studio # Open Drizzle Studio (DB browser)
Development Tools
This project uses AI-assisted, spec-driven development. See docs/tooling.md for details.
| Tool | Purpose |
|---|---|
| cmux | Native macOS terminal for running multiple AI coding sessions |
| Claude Code | AI coding assistant (primary development tool) |
| GitHub Copilot | AI coding assistant |
| Crit | Browser-based inline code review |
| OpenSpec | Spec-driven development workflow |
Self-Hosting
The Journal is designed to be self-hosted. A single Docker Compose file gets you running:
curl -O https://raw.githubusercontent.com/trails-cool/trails/main/infrastructure/docker-compose.yml
docker compose up -d
See docs/architecture.md for details on self-hosting configuration.
Philosophy
- Privacy by design — The Planner collects zero user data
- Data ownership — Export everything, self-host, no lock-in
- Open source — MIT licensed, built on open standards
- Simplicity — Start simple, add complexity only when needed
Read more: docs/philosophy.md
Contributing
Human contributions are welcome! This project is built with AI-assisted development (Claude Code + OpenSpec), but we value human judgment, design taste, and community input.
License
MIT