Tandem

A day planner for Montreal that plans public transit trips straight from your calendar: when to leave, how to get there, and a greener walk when you have time to spare.

Why

A Tuesday for a student in Montreal might look like this: a 9:00 class at Concordia, a group meeting at McGill at 13:00, a shift in Verdun at 17:00, and dinner at a friend's place in Laval. All of that is already in their calendar. A transit app knows none of it.

So four times a day they copy an address out of an event, paste it into a search box, set "arrive by", read the leave time, and try to remember it. Miss that step once and they're running for a bus they could have caught calmly. If a class lets out 40 minutes early, nothing tells them there's a park on the way, or a café with outlets two stops from the next room.

That copy-and-paste routine is also part of why people who could ride transit end up driving. A car is one decision a day. Transit is a small planning job before every trip, and on a busy day that adds up.

Tandem starts from the calendar instead. It already knows where you have to be and when, so it plans every trip between your events, tells you when to leave, and turns spare minutes into a walk through a park or a stop you wouldn't otherwise have made. You open it to find out what's next, not to plan anything.

What it does

Routes are planned from the calendar, not from a search box: the app already knows where you have to be and when.

Your day

  • Routes between events. Each day starts and ends at home (or a place you choose for that day). Every trip is planned to arrive before the event, so its departure time is your time to leave.
  • The trip that matters now. The Day tab opens on the trip under way or next to leave, already unfolded and scrolled into view. The rest of the day is folded to one line per trip, and a dot marks where you are.
  • The day at a glance. Time travelled, CO₂ saved against driving, and steps walked, at the top of the day.
  • Time-to-leave reminders. Local notifications 10 minutes before and at the moment to leave (phone only).
  • Your events. Add and edit events on the Day tab, jump to any date, import an .ics calendar file from Settings, and optionally sync Google Calendar.

Hold an event for options

Hold an event (or the home marker) and it lifts out of a blurred screen with what you can do from there:

  • Optimize for Nature. The trip leaving it switches to its greenest way, with walks through parks marked by a pine tree. Before it applies, the app shows what changes: the steps and minutes it adds, the new lines, the parks it crosses.
  • Optimize for Steps or for CO₂ Saved. That trip takes the option with the most walking, or the lowest emissions, among those that fit your schedule.
  • Finished Early. Pick a café, a restaurant or a park nearby, narrowed down with a few words (study, coffee, terrace, pizza, vegetarian, large park…), or search for any place. Your most-picked places come first. The stop is fitted in before your next event, with the trips there and onwards planned around it.

Getting there

  • Map. The open trip drawn section by section (walk, bus, metro, REM, train) with your live position; tap a stretch to zoom to it.
  • Ranked for you. Routes are ordered by your settings (preferred and avoided modes, longest walk, step-free only) and by what you actually pick: choosing an alternative teaches a small ranking agent.
  • Free-time suggestions. When there is slack before you need to leave, the app suggests a café, library or park that fits.

And

  • Saved places. Keep the places you go to often and pick them as an event's location or a day's start or end.
  • Activity. Steps from the phone's own pedometer, a seven-day chart, a green-walk streak, and the week's CO₂ saved with a plain comparison such as "the exhaust of 311 km driven by car".
  • Light and dark themes.

How it works

Pathfinding is done by a transit engine. The app's own logic only chooses between the routes it returns.

Step Who What
1. Candidates Transit engine (MOTIS, public Transitous server or a local build) Real itineraries on real timetables for "arrive at B by 11:50"
2. Enrichment Go backend Steps, CO₂ against a car, share of the walk in green space, step-free access, slack before leaving
3. Ranking Go backend + Python agent score = weights · features; weights come from your settings plus what the agent learned from your past choices
4. Feedback App → backend → agent Picking an alternative pins it for that trip and becomes a training example
 React Native app (Expo)
        │ REST/JSON
        ▼
 Go backend ──────────────► MOTIS / Transitous   (pathfinding, geocoding)
   │  enrich + rank    └──► Open-Meteo           (weather)
   │  POST /rank, /feedback
   ▼
 Python ML agent            (optional: the backend falls back to settings-only ranking)

More detail: docs/ARCHITECTURE.md (design reasoning and a per-feature status table) and docs/API_SPEC.md (REST endpoints).

Quick start

You need: Go 1.26+, Node.js 18+ with npm, Python 3.10+.

git clone [email protected]:nim-sam/tandem.git
cd tandem
make setup      # install backend, frontend and ML agent dependencies
make dev-web    # start everything and open the app in the browser

make dev does the same without opening a browser (press w for web or a for Android in the Expo prompt), and make dev-android opens the app in an Android emulator. Quitting Expo stops the backend and the agent.

The app starts empty. Set a home address in Settings, add a few events with addresses, and the Day tab plans the routes.

The public Transitous server has no timetable for the STL (Laval), so trips to, from or across Laval come back as long detours. To route on every agency of the region (STM, STL, RTL, REM, exo buses and commuter trains):

make routing    # a few minutes, about 2 GB in ./routing

make dev then uses the local engine automatically. Rebuild every few weeks: agencies publish new timetables each season, and an expired timetable returns no trips. The local engine has no live delays.

Commands

Command What it does
make setup Install dependencies for the backend, frontend and ML agent
make dev Run the whole stack; Expo in the foreground
make dev-web Same, opening the app in the browser
make dev-android Same, opening the app in an Android emulator
make routing Build the local routing engine with every Montreal-area agency
make test Go tests, ML agent tests and the frontend typecheck
make logs Follow the backend and ML agent logs
make stop Stop background servers left over from make dev
make data Refresh bundled data: parks, places to stop at (cafés, restaurants, libraries), step-free stations
make reset-data Delete saved events, places, settings and planned routes

Configuration

All settings are optional environment variables.

Variable Used by Default Purpose
EXPO_PUBLIC_API_URL app (frontend/.env) http://localhost:8080/api Where the app finds the backend
EXPO_PUBLIC_GOOGLE_CLIENT_ID app (frontend/.env) unset Google OAuth client ID; shows the Google Calendar sync button
TRANSIT_PROVIDER backend transitous mock runs offline with hardcoded demo routes
TRANSIT_API_URL backend https://api.transitous.org MOTIS server to route with; make dev sets it to the local engine when built
TRANSIT_USER_AGENT backend tandem/0.1 (hackathon prototype) Sent to the transit API; Transitous asks for an app name and a contact
ML_AGENT_URL backend http://localhost:8000 Ranking agent
DATA_PATH backend data/app.db SQLite database file
PORT backend 8080 Backend port

Project layout

├── backend/                     # Go REST API (:8080)
│   ├── cmd/api/                 # entry point
│   ├── internal/domain/         # entities: events, routes, preferences, ranking weights
│   ├── internal/service/        # routing, calendar, places, health, ranking
│   ├── internal/adapter/        # transit engine, .ics and Google Calendar, parks, weather, SQLite
│   └── internal/transport/http/ # handlers
├── frontend/                    # React Native app (Expo): Android, iOS, web
│   └── src/
│       ├── screens/             # Day, Map, Places, Activity, Settings
│       ├── components/          # CommuteCard, TripMap, dialogs
│       ├── store/               # app state
│       └── theme/               # colours and type
├── ml-agent/                    # route-ranking agent (FastAPI, :8000)
├── scripts/                     # routing engine setup, bundled-data refresh, icon, pattern and banner generators
├── docs/                        # architecture, API, UI concept
├── mockups/                     # screenshots, light and dark
└── Makefile

Status and limits

Tandem is a hackathon prototype for a single user.

  • No accounts. One hardcoded user; everything is stored in backend/data/app.db.
  • Google Calendar sync is hidden until OAuth client IDs are set, and has only been tested against a fake server.
  • Step counts are exact on iOS; Android counts only while the app is open; a browser has no step sensor.
  • Time-to-leave notifications are not available in a browser.
  • CO₂ figures are estimates from per-mode averages, and the comparisons (car distance, gasoline, trees) are rough.
  • Places to stop at come from OpenStreetMap, which has no prices: restaurants can be narrowed down by cuisine and service, not by cost. Walking times to them are straight-line estimates.
  • Blur effects (frosted cards, the blurred screen behind options) need a browser; on a phone those surfaces are translucent or nearly opaque instead.
  • Step-free access comes from a static station list, not live elevator outages.
  • Live delays appear only with the public Transitous server and are cached for 15 minutes.

Data and attribution

Built With

Share this project:

Updates

Submission history