MCPcopy Index your code
hub / github.com/mauriceboe/TREK

github.com/mauriceboe/TREK @v3.1.4 sqlite

repository ↗ · DeepWiki ↗ · release v3.1.4 ↗
4,770 symbols 17,381 edges 1,978 files 133 documented · 3%
README

TREK

Your trips. Your plan. Your server.

A self-hosted, real-time collaborative travel planner — with maps, budgets, packing lists, a journal, and AI built in.

Demo   Docker   Discord   Roadmap

Ko-fi   BMAC

License Latest Release Docker Pulls Stars


TREK — 60-second tour

Dashboard Trip planner with 3D map Journey journal Costs · expense splitting Atlas · visited countries Vacay planner Trip planner · day plan and route Admin panel


What you get

TREK feature tiles

See all features

#### 🧭 Trip planning - **Drag & drop planner** — organise places into day plans with reordering and cross-day moves - **Interactive map** — Leaflet or Mapbox GL with 3D buildings, terrain, photo markers, clustering, route visualization - **Place search** — Google Places (photos, ratings, hours) or OpenStreetMap (free, no API key) - **Place import** — shared Google Maps / Naver Maps lists, plus GPX and KML/KMZ/GeoJSON map files - **Day notes** — timestamped, icon-tagged notes with drag-and-drop reordering - **Route optimisation** — auto-sort places and export to Google Maps - **Weather forecasts** — 16-day via Open-Meteo (no key) + historical climate fallback - **Category filter** — show only matching pins on the map #### 🧳 Travel management - **Reservations** — flights, accommodations, restaurants with status, confirmation numbers, files; import from booking confirmation emails and PDFs ([KDE Itinerary](https://invent.kde.org/pim/kitinerary)) - **Costs** — track and split trip expenses (Splitwise-style): per-person / per-day breakdowns, settle-up, multi-currency - **Packing lists** — categories, templates, user assignment, progress tracking - **Bag tracking** — optional weight tracking with iOS-style distribution - **Document manager** — attach docs, tickets, PDFs to trips / places / reservations (≤ 50 MB each) - **PDF export** — full trip plan as PDF with cover page, images, notes
#### 👥 Collaboration - **Real-time sync** — WebSocket. Changes appear instantly across all connected users - **Multi-user trips** — invite members with role-based access - **Invite links** — one-time or reusable links with expiry - **SSO (OIDC)** — Google, Apple, Authentik, Keycloak, or any OIDC provider - **2FA** — TOTP + backup codes - **Passkeys** — passwordless WebAuthn login (fingerprint / face / PIN / security key), admin-toggleable - **Collab suite** — group chat, shared notes, polls, day check-ins #### 📱 Mobile & PWA - **Installable** — iOS and Android, straight from the browser, no App Store needed - **Offline support** — Service Worker caches tiles, API, uploads via Workbox - **Native feel** — fullscreen standalone, themed status bar, splash screen - **Touch optimised** — mobile-specific layouts with safe-area handling
#### 🧩 Addons (admin-toggleable) - **Lists** — packing lists + to-dos with templates, member assignments, optional bag tracking - **Costs** — expense tracker with splits and settle-up (who owes whom), multi-currency - **Documents** — file attachments on trips, places, and reservations - **Collab** — chat, notes, polls, day-by-day attendance - **Vacay** — personal vacation planner with calendar, 100+ country holidays, carry-over tracking - **Atlas** — world map of visited countries, bucket list, travel stats, streak tracking, liquid-glass UI - **Journey** — magazine-style travel journal with entries, photos (Immich/Synology), maps, moods - **AirTrail** — connect a self-hosted AirTrail instance to import and sync flights into reservations - **MCP** — expose TREK to AI assistants via OAuth 2.1 #### 🤖 AI / MCP - **Built-in MCP server** — OAuth 2.1 authenticated. 150+ tools, 30 resources - **Granular scopes** — 27 OAuth scopes across 13 permission groups - **Full automation** — AI can create trips, plan days, build packing lists, manage budgets, mark countries visited - **Pre-built prompts** — `trip-summary`, `packing-list`, `budget-overview` - **Addon-aware** — exposes Atlas, Collab, Vacay when those addons are on
#### ⚙️ Admin & customisation - **Dashboard views** — card grid or compact list · **Dark mode** — full theme with matching status bar - **20 languages** — EN, DE, ES, FR, IT, NL, HU, RU, ZH, ZH-TW, PL, CS, AR (RTL), BR, ID, TR, JA, KO, UK, GR - **Admin panel** — users, invites, packing templates, categories, addons, API keys, backups, GitHub history - **Notifications** — per-user preferences across email (SMTP), webhook, ntfy, and an in-app notification center - **Auto-backups** — scheduled with configurable retention · **Units** — °C/°F, 12h/24h, map tile sources, default coordinates

Get started in 30 seconds

ENCRYPTION_KEY=$(openssl rand -hex 32) docker run -d -p 3000:3000 \
  -e ENCRYPTION_KEY=$ENCRYPTION_KEY \
  -v ./data:/app/data -v ./uploads:/app/uploads mauriceboe/trek

Open http://localhost:3000. On first boot TREK seeds an admin account — if you set ADMIN_EMAIL/ADMIN_PASSWORD those are used, otherwise the credentials are printed to the container log (docker logs trek).

  ·  Docker Compose  ·  Helm / Kubernetes  ·  Install as PWA  ·  Reverse Proxy  ·  

Tech stack

Node.js NestJS SQLite React Vite TypeScript Tailwind Leaflet Docker

Real-time sync via WebSocket (ws). Backend on NestJS 11. State with Zustand. Auth via JWT + OAuth 2.1 + OIDC + Passkeys (WebAuthn) + TOTP MFA. Weather via Open-Meteo (no key required). Maps with Leaflet and Mapbox GL.

Docker Compose (production)

Full compose example with secure defaults

services:
  app:
    image: mauriceboe/trek:latest
    container_name: trek
    read_only: true
    security_opt:
      - no-new-privileges:true
    cap_drop:
      - ALL
    cap_add:
      - CHOWN
      - SETUID
      - SETGID
    tmpfs:
      - /tmp:noexec,nosuid,size=64m
    ports:
      - "3000:3000"
    environment:
      - NODE_ENV=production
      - PORT=3000
      - ENCRYPTION_KEY=${ENCRYPTION_KEY:-}   # generate with: openssl rand -hex 32
      - TZ=${TZ:-UTC}
      - LOG_LEVEL=${LOG_LEVEL:-info}
      - ALLOWED_ORIGINS=${ALLOWED_ORIGINS:-}
      - APP_URL=${APP_URL:-}                 # required for OIDC + email links
      # - FORCE_HTTPS=true                   # behind a TLS-terminating proxy
      # - TRUST_PROXY=1
      # - OIDC_ISSUER=https://auth.example.com
      # - OIDC_CLIENT_ID=trek
      # - OIDC_CLIENT_SECRET=supersecret
      # - OIDC_DISPLAY_NAME=SSO
      # - OIDC_ADMIN_CLAIM=groups
      # - OIDC_ADMIN_VALUE=app-trek-admins
    volumes:
      - ./data:/app/data
      - ./uploads:/app/uploads
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "wget", "-qO-", "http://localhost:3000/api/health"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 15s

Then:

docker compose up -d

HTTPS notes: FORCE_HTTPS=true is optional — it adds a 301 redirect, HSTS, CSP upgrade-insecure-requests, and forces the secure cookie flag. Only use it behind a TLS-terminating reverse proxy. TRUST_PROXY=1 tells the server how many proxies sit in front so real client IPs and X-Forwarded-Proto work.

Helm (Kubernetes)

helm repo add trek https://mauriceboe.github.io/TREK
helm repo update
helm install trek trek/trek

See charts/README.md for values.

Install as App (PWA)

TREK works as a Progressive Web App — no App Store needed.

  1. Open TREK in the browser (HTTPS required)
  2. iOS: Share ▸ Add to Home Screen
  3. Android: Menu ▸ Install app (or Add to Home Screen)

TREK then launches fullscreen with its own icon, just like a native app.

Updating

Docker Compose:

docker compose pull && docker compose up -d

Docker run — reuse the original volume paths:

docker pull mauriceboe/trek
docker rm -f trek
docker run -d --name trek -p 3000:3000 -v ./data:/app/data -v ./uploads:/app/uploads --restart unless-stopped mauriceboe/trek

Not sure which paths you used? docker inspect trek --format '{{json .Mounts}}' before removing the container.

Your data stays in the mounted data and uploads volumes — updates never touch it.

[!IMPORTANT] Mount only the data and uploads directories — -v ./data:/app/data -v ./uploads:/app/uploads. Never mount a volume at /app. Doing so hides the application code shipped in the image and the container fails to start with Cannot find module 'tsconfig-paths/register'. If you previously mounted /app, switch to the two mounts above; your data in data/ and uploads/ is preserved.

Rotating the Encryption Key

If you need to rotate ENCRYPTION_KEY (e.g. upgrading from a version that derived encryption from JWT_SECRET):

docker exec -it trek node --import tsx scripts/migrate-encryption.ts

The script creates a timestamped DB backup before making changes and prompts for old + new keys (input is not echoed).

Reverse Proxy

For production, put TREK behind a TLS-terminating reverse proxy. TREK uses WebSockets for real-time sync, so the prox

Extension points exported contracts — how you extend this code

PurgeDb (Interface)
(no doc) [1 implementers]
server/src/scheduler.ts
ProtectedRouteProps (Interface)
(no doc)
client/src/App.tsx
Window (Interface)
(no doc)
client/tests/integration/hooks/useDayNotes.test.ts
EmailStrings (Interface)
(no doc)
shared/src/i18n/externalNotifications/types.ts
MigrationResult (Interface)
(no doc)
server/scripts/migrate-encryption.ts
WsMessage (Interface)
(no doc)
server/tests/helpers/ws-client.ts
NomadWebSocket (Interface)
(no doc)
server/src/websocket.ts
User (Interface)
(no doc)
client/src/types.ts

Core symbols most depended-on inside this repo

get
called by 2783
server/src/nest/share/share.service.ts
prepare
called by 2322
server/src/scheduler.ts
createUser
called by 1967
server/tests/helpers/factories.ts
request
called by 1424
server/src/services/airtrail/airtrailClient.ts
run
called by 1019
server/src/nest/database/database.service.ts
authCookie
called by 978
server/tests/helpers/auth.ts
createTrip
called by 911
server/tests/helpers/factories.ts
send
called by 694
server/tests/helpers/ws-client.ts

Shape

Function 2,880
Method 1,021
Interface 557
Class 312

Languages

TypeScript100%

Modules by API surface

server/src/nest/admin/admin.controller.ts54 symbols
server/src/services/adminService.ts53 symbols
server/src/nest/admin/admin.service.ts52 symbols
server/tests/helpers/factories.ts51 symbols
server/src/services/authService.ts51 symbols
server/src/nest/journey/journey.service.ts42 symbols
server/src/services/journeyService.ts41 symbols
server/src/services/mapsService.ts39 symbols
client/src/components/Planner/DayPlanSidebar.tsx39 symbols
server/src/services/vacayService.ts37 symbols
server/src/services/atlasService.ts37 symbols
server/src/nest/auth/auth.service.ts36 symbols

Dependencies from manifests, versioned

@eslint/js10.0.1 · 1×
@fontsource/geist-sans5.2.5 · 1×
@fontsource/poppins5.2.7 · 1×
@modelcontextprotocol/sdk1.28.0 · 1×
@nestjs/common11.1.24 · 1×
@nestjs/core11.1.24 · 1×
@nestjs/platform-express11.1.24 · 1×
@nestjs/testing11.1.24 · 1×
@playwright/test1.60.0 · 1×
@react-pdf/renderer4.5.1 · 1×
@simplewebauthn/server13.1.2 · 1×

For agents

$ claude mcp add TREK \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact