# gowtham11112007/waytogether architecture

> Architecture diagram of the GitHub repository gowtham11112007/waytogether, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gowtham11112007/waytogether
- Repository: https://github.com/gowtham11112007/waytogether

## Overview

WayTogether is a live group-travel app: riders sign in, get a location fix, search or choose a destination, create or join a coded trip, then share positions and trip updates while viewing the group on a map. The trip engine manages rider state, route progress, alerts, and actions; screens expose chat, status, regrouping, music, and SOS. README documents routing, map providers, background sharing, and Android plugins. Some subsystem links below rely on README or source-index references because their implementation excerpts were not provided.

Main entry points: [`src/state/TripContext.jsx`](https://github.com/gowtham11112007/waytogether/blob/main/src/state/TripContext.jsx) (Trip engine), [`src/screens/TripScreen.jsx`](https://github.com/gowtham11112007/waytogether/blob/main/src/screens/TripScreen.jsx) (Live trip screen), [`src/App.jsx`](https://github.com/gowtham11112007/waytogether/blob/main/src/App.jsx) (App shell), [`src/lib/places.js`](https://github.com/gowtham11112007/waytogether/blob/main/src/lib/places.js) (Search and routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and entry"]
  node_app_shell["App shell<br/>[App.jsx]"]
  node_setup["Sign-in setup<br/>[Setup.jsx]"]
  node_home["Home and trip entry<br/>[HomeScreen.jsx]"]
  node_search_view["Place search UI<br/>[SearchView.jsx]"]
  node_trip_screen["Live trip screen<br/>[TripScreen.jsx]"]
end

subgraph group_trip["Trip engine"]
  node_trip_state["Trip engine<br/>[TripContext.jsx]"]
  node_trip_data["Trip statuses<br/>[trip.js]"]
end

subgraph group_features["Trip features"]
  node_map["Live map<br/>[MapView.jsx]"]
  node_convoy["Convoy health<br/>[ConvoySheet.jsx]"]
  node_chat["Group chat<br/>[ChatPanel.jsx]"]
  node_sos["SOS interface<br/>[SOSScreen.jsx]"]
  node_music["Music controls<br/>[MusicSheet.jsx]"]
end

subgraph group_services["Location and services"]
  node_realtime["Trip realtime<br/>[realtime.js]"]
  node_location["GPS and battery<br/>[location.js]"]
  node_places["Search and routing<br/>[places.js]"]
  node_geo["Geospatial calculations<br/>[geo.js]"]
  node_profile["Profile and trip storage<br/>[profile.js]"]
  node_alerts["Trip notifications<br/>[notify.js]"]
end

subgraph group_native["Android support"]
  node_android_plugins["Android trip plugins"]
  node_main_activity["Plugin registration<br/>[MainActivity.java]"]
  node_media_plugin["Media key plugin"]
end

node_rider(("Rider"))
node_supabase["Supabase Realtime"]
node_photon["Photon and OSRM"]
node_map_tiles["Map tile providers"]

node_rider -->|"opens app"| node_app_shell
node_app_shell -->|"shows setup"| node_setup
node_app_shell -->|"shows when idle"| node_home
node_app_shell -->|"shows when active"| node_trip_screen
node_app_shell -->|"provides trip state"| node_trip_state
node_home -->|"opens search"| node_search_view
node_home -->|"creates or joins"| node_trip_state
node_search_view -->|"searches places"| node_places
node_trip_screen -->|"uses trip state"| node_trip_state
node_trip_screen -->|"renders map"| node_map
node_trip_screen -->|"opens health"| node_convoy
node_trip_screen -->|"opens chat"| node_chat
node_trip_screen -->|"opens SOS"| node_sos
node_trip_screen -->|"opens controls"| node_music
node_trip_state -->|"exchanges trip events"| node_realtime
node_trip_state -->|"uses rider fix"| node_location
node_trip_state -->|"uses route data"| node_places
node_trip_state -->|"computes trip progress"| node_geo
node_trip_state -->|"loads and saves state"| node_profile
node_trip_state -->|"posts trip alerts"| node_alerts
node_trip_state -->|"uses status definitions"| node_trip_data
node_realtime -->|"uses channels"| node_supabase
node_places -->|"searches with"| node_photon
node_places -->|"routes with OSRM"| node_photon
node_map -->|"renders map styles"| node_map_tiles
node_android_plugins -->|"registered by"| node_main_activity
node_trip_screen -.->|"controls player"| node_media_plugin
node_alerts -.->|"uses native alerts"| node_android_plugins

click node_app_shell "https://github.com/gowtham11112007/waytogether/blob/main/src/App.jsx"
click node_setup "https://github.com/gowtham11112007/waytogether/blob/main/src/screens/Setup.jsx"
click node_home "https://github.com/gowtham11112007/waytogether/blob/main/src/screens/HomeScreen.jsx"
click node_search_view "https://github.com/gowtham11112007/waytogether/blob/main/src/components/SearchView.jsx"
click node_trip_screen "https://github.com/gowtham11112007/waytogether/blob/main/src/screens/TripScreen.jsx"
click node_trip_state "https://github.com/gowtham11112007/waytogether/blob/main/src/state/TripContext.jsx"
click node_trip_data "https://github.com/gowtham11112007/waytogether/blob/main/src/data/trip.js"
click node_map "https://github.com/gowtham11112007/waytogether/blob/main/src/components/MapView.jsx"
click node_convoy "https://github.com/gowtham11112007/waytogether/blob/main/src/components/ConvoySheet.jsx"
click node_chat "https://github.com/gowtham11112007/waytogether/blob/main/src/components/ChatPanel.jsx"
click node_sos "https://github.com/gowtham11112007/waytogether/blob/main/src/components/SOSScreen.jsx"
click node_music "https://github.com/gowtham11112007/waytogether/blob/main/src/components/MusicSheet.jsx"
click node_realtime "https://github.com/gowtham11112007/waytogether/blob/main/src/lib/realtime.js"
click node_location "https://github.com/gowtham11112007/waytogether/blob/main/src/lib/location.js"
click node_places "https://github.com/gowtham11112007/waytogether/blob/main/src/lib/places.js"
click node_geo "https://github.com/gowtham11112007/waytogether/blob/main/src/lib/geo.js"
click node_profile "https://github.com/gowtham11112007/waytogether/blob/main/src/lib/profile.js"
click node_alerts "https://github.com/gowtham11112007/waytogether/blob/main/src/lib/notify.js"
click node_android_plugins "https://github.com/gowtham11112007/waytogether/blob/main/android/app/src/main/java/app/convoya/trip/TripAlertsPlugin.java"
click node_main_activity "https://github.com/gowtham11112007/waytogether/blob/main/android/app/src/main/java/app/convoya/trip/MainActivity.java"
click node_media_plugin "https://github.com/gowtham11112007/waytogether/blob/main/android/app/src/main/java/app/convoya/trip/MediaControlPlugin.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app_shell,node_setup,node_home,node_search_view,node_trip_screen toneBlue
class node_trip_state,node_trip_data toneAmber
class node_map,node_convoy,node_chat,node_sos,node_music toneMint
class node_realtime,node_location,node_places,node_geo,node_profile,node_alerts toneRose
class node_android_plugins,node_main_activity,node_media_plugin,node_rider,node_supabase,node_photon,node_map_tiles toneIndigo
```

## Components

### App and entry

- [App shell](https://github.com/gowtham11112007/waytogether/blob/main/src/App.jsx): `src/App.jsx`
- [Sign-in setup](https://github.com/gowtham11112007/waytogether/blob/main/src/screens/Setup.jsx): `src/screens/Setup.jsx`
- [Home and trip entry](https://github.com/gowtham11112007/waytogether/blob/main/src/screens/HomeScreen.jsx): `src/screens/HomeScreen.jsx`
- [Place search UI](https://github.com/gowtham11112007/waytogether/blob/main/src/components/SearchView.jsx): `src/components/SearchView.jsx`
- [Live trip screen](https://github.com/gowtham11112007/waytogether/blob/main/src/screens/TripScreen.jsx): `src/screens/TripScreen.jsx`

### Trip engine

- [Trip engine](https://github.com/gowtham11112007/waytogether/blob/main/src/state/TripContext.jsx): `src/state/TripContext.jsx`
- [Trip statuses](https://github.com/gowtham11112007/waytogether/blob/main/src/data/trip.js): `src/data/trip.js`

### Trip features

- [Live map](https://github.com/gowtham11112007/waytogether/blob/main/src/components/MapView.jsx): `src/components/MapView.jsx`
- [Convoy health](https://github.com/gowtham11112007/waytogether/blob/main/src/components/ConvoySheet.jsx): `src/components/ConvoySheet.jsx`
- [Group chat](https://github.com/gowtham11112007/waytogether/blob/main/src/components/ChatPanel.jsx): `src/components/ChatPanel.jsx`
- [SOS interface](https://github.com/gowtham11112007/waytogether/blob/main/src/components/SOSScreen.jsx): `src/components/SOSScreen.jsx`
- [Music controls](https://github.com/gowtham11112007/waytogether/blob/main/src/components/MusicSheet.jsx): `src/components/MusicSheet.jsx`

### Location and services

- [Trip realtime](https://github.com/gowtham11112007/waytogether/blob/main/src/lib/realtime.js): `src/lib/realtime.js`
- [GPS and battery](https://github.com/gowtham11112007/waytogether/blob/main/src/lib/location.js): `src/lib/location.js`
- [Search and routing](https://github.com/gowtham11112007/waytogether/blob/main/src/lib/places.js): `src/lib/places.js`
- [Geospatial calculations](https://github.com/gowtham11112007/waytogether/blob/main/src/lib/geo.js): `src/lib/geo.js`
- [Profile and trip storage](https://github.com/gowtham11112007/waytogether/blob/main/src/lib/profile.js): `src/lib/profile.js`
- [Trip notifications](https://github.com/gowtham11112007/waytogether/blob/main/src/lib/notify.js): `src/lib/notify.js`

### Android support

- [Android trip plugins](https://github.com/gowtham11112007/waytogether/blob/main/android/app/src/main/java/app/convoya/trip/TripAlertsPlugin.java): `android/app/src/main/java/app/convoya/trip/TripAlertsPlugin.java`
- [Plugin registration](https://github.com/gowtham11112007/waytogether/blob/main/android/app/src/main/java/app/convoya/trip/MainActivity.java): `android/app/src/main/java/app/convoya/trip/MainActivity.java`
- [Media key plugin](https://github.com/gowtham11112007/waytogether/blob/main/android/app/src/main/java/app/convoya/trip/MediaControlPlugin.java): `android/app/src/main/java/app/convoya/trip/MediaControlPlugin.java`

### Other components

- **Rider**
- **Supabase Realtime**
- **Photon and OSRM**
- **Map tile providers**

## Connections

- Rider → App shell: opens app (evidence: `README.md`)
- App shell → Sign-in setup: shows setup (evidence: `src/App.jsx`)
- App shell → Home and trip entry: shows when idle (evidence: `src/App.jsx`)
- App shell → Live trip screen: shows when active (evidence: `src/App.jsx`)
- App shell → Trip engine: provides trip state (evidence: `src/App.jsx`)
- Home and trip entry → Place search UI: opens search (evidence: `src/screens/HomeScreen.jsx`)
- Home and trip entry → Trip engine: creates or joins (evidence: `src/screens/HomeScreen.jsx`)
- Place search UI → Search and routing: searches places (evidence: `src/components/SearchView.jsx`)
- Live trip screen → Trip engine: uses trip state (evidence: `src/screens/TripScreen.jsx`)
- Live trip screen → Live map: renders map (evidence: `src/screens/TripScreen.jsx`)
- Live trip screen → Convoy health: opens health (evidence: `src/screens/TripScreen.jsx`)
- Live trip screen → Group chat: opens chat (evidence: `src/screens/TripScreen.jsx`)
- Live trip screen → SOS interface: opens SOS (evidence: `src/screens/TripScreen.jsx`)
- Live trip screen → Music controls: opens controls (evidence: `src/screens/TripScreen.jsx`)
- Trip engine → Trip realtime: exchanges trip events (evidence: `README.md`)
- Trip engine → GPS and battery: uses rider fix (evidence: `README.md`)
- Trip engine → Search and routing: uses route data (evidence: `src/state/TripContext.jsx`)
- Trip engine → Geospatial calculations: computes trip progress (evidence: `src/state/TripContext.jsx`)
- Trip engine → Profile and trip storage: loads and saves state (evidence: `src/state/TripContext.jsx`)
- Trip engine → Trip notifications: posts trip alerts (evidence: `src/state/TripContext.jsx`)
- Trip engine → Trip statuses: uses status definitions (evidence: `src/state/TripContext.jsx`)
- Trip realtime → Supabase Realtime: uses channels (evidence: `README.md`)
- Search and routing → Photon and OSRM: searches with (evidence: `README.md`)
- Search and routing → Photon and OSRM: routes with OSRM (evidence: `README.md`)
- Live map → Map tile providers: renders map styles (evidence: `README.md`)
- Android trip plugins → Plugin registration: registered by (evidence: `android/app/src/main/java/app/convoya/trip/MainActivity.java`)
- Live trip screen → Media key plugin: controls player (evidence: `README.md`)
- Trip notifications → Android trip plugins: uses native alerts (evidence: `README.md`)
