TripBrain

Duration
6 months
Date
March 2026
Homepage of tripbrain.fr with the live demo embedded in a phone mockup
Homepage of tripbrain.fr with the live demo embedded in a phone mockup
The day-by-day roadbook view of the app
The day-by-day roadbook view of the app
Leaflet map of the whole itinerary with one marker per day
Leaflet map of the whole itinerary with one marker per day
+6

Preface

TripBrain started from a simple frustration: on the ground, a trip lives in five open apps and ten browser tabs. Bookings are in the mailbox, the plan is in a notes app, the tickets are somewhere in a PDF, and the map has no network. TripBrain puts all of that in one place that keeps working offline.

The product is made of two pieces I built and maintain:

  • The app at app.tripbrain.fr: an installable, mobile-first PWA where the trip is stored on the device.
  • The marketing site at tripbrain.fr: SEO landing page and a free AI itinerary generator.

Both are open source: tripbrain and tripbrain-landing. You can try the live demo here: app.tripbrain.fr?demo=true.

Stacks involved

  • Next.js 16 (App Router) and React 19
  • TypeScript, Tailwind CSS v4, shadcn/ui, Framer Motion
  • IndexedDB (local-first storage, no user database on the server)
  • Cloudflare R2 through my own library bucketcode
  • Leaflet and OpenStreetMap
  • PostHog (EU) and Vercel Analytics, both consent-gated
  • Vitest, GitHub Actions, Bun, Vercel

Key capabilities

  • Day-by-day roadbook with transport, accommodation, activities and notes
  • Full offline consultation with a hand-written service worker
  • Documents vault for tickets and bookings, searchable and viewable offline
  • Sharing by QR code, link or 8-digit code that expires after one hour
  • AI itinerary generator with no account, no API key and no inference cost
  • Calendar export (.ics), Excel and JSON import, PWA install flow

Details

The app is deliberately local-first. Three IndexedDB databases hold the trip, the cached images and the documents. The only server-side code is the sharing API, so there is no account, no sign-up and nothing personal stored on my side. The trip is the user's, on their phone.

Sharing works in two tiers. A small itinerary is packed with msgpack, deflated and encoded into the QR code itself, so it never leaves the device. A larger one, or one that has to be dictated, is stored as a compressed snapshot on Cloudflare R2 under a numeric 8-digit code, chosen so phones show the numeric keypad. Snapshots expire after an hour and the API is rate-limited with an explicit CORS allow-list.

The generator on tripbrain.fr takes a different route from most "AI travel" products. It builds a prompt from a short brief or a 17-question form, the visitor pastes it in their own ChatGPT or Claude, and pastes the answer back. The site then validates the JSON with Zod, computes a confidence index that flags the classic hallucinations (fake dates in the past, missing coordinates, invented titles), and hands the result to the app. On the same device the itinerary travels in a URL fragment, so it never touches a server. From desktop to phone it goes through the share API and a QR code.

Role

Solo project: product, design, front-end, the share API, the SEO and legal work, and the deployment. A good part of the development went through AI-assisted pull requests that I specified, reviewed and integrated.

What I built

The offline roadbook

  • Day timeline with swipe navigation and a two-level map (whole trip, then per-day activities)
  • Long-press quick-action menu on every editable piece of information
  • Declarative edit system with field descriptors, draft validation and a diff review before saving
  • Service worker with cache-first assets and network-first map tiles, plus an IndexedDB image cache
  • Documents vault with search, sort, preview and export
  • Hand-rolled ICS export respecting RFC 5545 line folding
  • PWA install orchestration with platform-specific instructions and re-prompt cadence

Sharing and hand-off

  • msgpack + deflate + base64url pipeline shared between the app and the landing
  • Inline QR codes under 2,000 characters, R2 snapshots above
  • 8-digit numeric codes, one-hour expiry, conditional writes so a code is never overwritten
  • Open Graph landing route for share links that never resolves the code, so link previews stay generic

The marketing site and generator

  • BYO-LLM generator: prompt out, JSON back, Zod validation and a hallucination score
  • Hand-written Schema.org graph (Organization, SoftwareApplication, FAQPage, HowTo) with character-budgeted titles
  • Per-page Open Graph cards generated at request time with next/og
  • Live iPhone mockup embedding the real app demo

Privacy by construction

  • Typed, closed analytics event catalogue enforced in code and in a before_send hook
  • No consent, no SDK loaded at all; no cookies before consent
  • Legal pages generated from a single config naming every processor

Technical achievements

Zero backend for user data

A complete travel app with editing, documents and maps where the server stores nothing about the user. The whole trust model fits in one sentence: your trip lives on your device.

An AI feature with zero running cost

The generator produces day-by-day itineraries for any destination without a single API call from my side. The user brings the model; the site brings the structure, the validation and the hand-off.

Test coverage on the core

About 376 unit tests on the library layer (share, import, calendar, itinerary data), at roughly 98% statement coverage, run on every pull request.

In short

TripBrain is the travel companion I wanted for my own trips, shipped as a free and open-source product. It combines a local-first PWA, a privacy-first sharing pipeline and an AI generator that costs nothing to run, and it is live at tripbrain.fr.

Similar projects

Homepage of onmangekoi
Homepage of onmangekoi on mobile
onmangekoi
onmangekoi
Duration
4 months
Date
April 2026
Homepage of song choicer
Homepage of song choicer mobile
Song choicer logo
Song Choicer
Duration
3 week
Date
July 2024
Documentation homepage of bucketcode
Documentation homepage of bucketcode on mobile
bucketcode
bucketcode
Duration
2 weeks
Date
August 2026
Logo

© All rights reserved by Abderrahmane Mouzoune