# commaai/connect architecture

> Architecture diagram of the GitHub repository commaai/connect, 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/commaai/connect
- Repository: https://github.com/commaai/connect

## Overview

comma connect is the web and mobile companion for openpilot devices. The user-facing flow begins at the app shell, enters the Explorer, and branches into device management, drive review, and live teleoperation; account, Prime, referrals, and file handling are additional capabilities. Redux and the timeline playback state form an important internal layer. Source excerpts establish some links, while several feature modules are unsampled, so their likely connections are shown as unverified rather than asserted.

Main entry points: [`src/components/explorer.jsx`](https://github.com/commaai/connect/blob/master/src/components/explorer.jsx) (Explorer and routing), [`src/components/DeviceInfo/index.jsx`](https://github.com/commaai/connect/blob/master/src/components/DeviceInfo/index.jsx) (Device details), [`src/components/DriveView/index.jsx`](https://github.com/commaai/connect/blob/master/src/components/DriveView/index.jsx) (Drive viewer), [`src/api/backend.js`](https://github.com/commaai/connect/blob/master/src/api/backend.js) (Backend facade)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and state"]
  node_shell["App shell<br/>[App.jsx]"]
  node_explorer["Explorer and routing<br/>[explorer.jsx]"]
  node_store["Redux store<br/>[store.js]"]
  node_globalstate["Global state<br/>[globalState.js]"]
  node_playback["Playback state<br/>[playback.js]"]
end

subgraph group_devices["Device workflows"]
  node_dashboard["Device dashboard"]
  node_deviceinfo["Device details<br/>[index.jsx]"]
  node_teleop["Live teleoperation"]
  node_navigation["Map navigation<br/>[index.jsx]"]
  node_deviceactions["Device actions<br/>[index.js]"]
end

subgraph group_drives["Drive review"]
  node_driveview["Drive viewer<br/>[index.jsx]"]
  node_timeline["Drive timeline<br/>[index.jsx]"]
  node_clipmenu["Clip management<br/>[ClipMenu.jsx]"]
  node_drivemap["Drive map<br/>[index.jsx]"]
  node_drivevideo["Drive video<br/>[index.jsx]"]
  node_files["File uploads<br/>[UploadQueue.jsx]"]
end

subgraph group_services["Services and account"]
  node_backend["Backend facade<br/>[backend.js]"]
  node_api["Comma APIs<br/>[api.js]"]
  node_clipsapi["Clip API<br/>[clips.js]"]
  node_demo["Demo backend<br/>[demo.js]"]
  node_prime["Prime subscription"]
  node_referrals["Referrals<br/>[index.jsx]"]
end

node_user(("Openpilot user"))
node_externalapis{{"Comma services"}}

node_user -->|"opens"| node_shell
node_shell -->|"routes to"| node_explorer
node_shell -->|"provides"| node_store
node_store -->|"reduces state"| node_globalstate
node_store -->|"uses reducer"| node_playback
node_explorer -.->|"offers"| node_dashboard
node_explorer -.->|"offers"| node_driveview
node_explorer -.->|"offers"| node_deviceinfo
node_deviceinfo -->|"dispatches"| node_deviceactions
node_deviceinfo -->|"checks support"| node_clipsapi
node_deviceinfo -.->|"opens"| node_teleop
node_deviceinfo -.->|"links to"| node_navigation
node_deviceactions -->|"calls device API"| node_backend
node_driveview -.->|"shows timeline"| node_timeline
node_driveview -.->|"shows map"| node_drivemap
node_driveview -.->|"plays video"| node_drivevideo
node_timeline -->|"uses controls"| node_playback
node_driveview -.->|"offers clips"| node_clipmenu
node_clipmenu -->|"uses"| node_clipsapi
node_backend -->|"wraps"| node_api
node_backend -->|"selects demo"| node_demo
node_api -->|"requests"| node_externalapis
node_clipsapi -->|"uses"| node_api
node_explorer -.->|"offers"| node_prime
node_explorer -.->|"offers"| node_referrals
node_prime -.->|"uses billing"| node_backend
node_referrals -->|"uses account API"| node_backend
node_explorer -.->|"offers uploads"| node_files

click node_shell "https://github.com/commaai/connect/blob/master/src/App.jsx"
click node_explorer "https://github.com/commaai/connect/blob/master/src/components/explorer.jsx"
click node_store "https://github.com/commaai/connect/blob/master/src/store.js"
click node_globalstate "https://github.com/commaai/connect/blob/master/src/reducers/globalState.js"
click node_playback "https://github.com/commaai/connect/blob/master/src/timeline/playback.js"
click node_dashboard "https://github.com/commaai/connect/tree/master/src/components/Dashboard"
click node_deviceinfo "https://github.com/commaai/connect/blob/master/src/components/DeviceInfo/index.jsx"
click node_teleop "https://github.com/commaai/connect/tree/master/src/components/BodyTeleop"
click node_navigation "https://github.com/commaai/connect/blob/master/src/components/Navigation/index.jsx"
click node_deviceactions "https://github.com/commaai/connect/blob/master/src/actions/index.js"
click node_driveview "https://github.com/commaai/connect/blob/master/src/components/DriveView/index.jsx"
click node_timeline "https://github.com/commaai/connect/blob/master/src/components/Timeline/index.jsx"
click node_clipmenu "https://github.com/commaai/connect/blob/master/src/components/DriveView/ClipMenu.jsx"
click node_drivemap "https://github.com/commaai/connect/blob/master/src/components/DriveMap/index.jsx"
click node_drivevideo "https://github.com/commaai/connect/blob/master/src/components/DriveVideo/index.jsx"
click node_files "https://github.com/commaai/connect/blob/master/src/components/Files/UploadQueue.jsx"
click node_backend "https://github.com/commaai/connect/blob/master/src/api/backend.js"
click node_api "https://github.com/commaai/connect/blob/master/src/api.js"
click node_clipsapi "https://github.com/commaai/connect/blob/master/src/api/clips.js"
click node_demo "https://github.com/commaai/connect/blob/master/src/api/demo.js"
click node_prime "https://github.com/commaai/connect/tree/master/src/components/Prime"
click node_referrals "https://github.com/commaai/connect/blob/master/src/components/Referrals/index.jsx"

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_shell,node_explorer,node_store,node_globalstate,node_playback,node_user toneBlue
class node_dashboard,node_deviceinfo,node_teleop,node_navigation,node_deviceactions toneAmber
class node_driveview,node_timeline,node_clipmenu,node_drivemap,node_drivevideo,node_files toneMint
class node_backend,node_api,node_clipsapi,node_demo,node_prime,node_referrals toneRose
class node_externalapis toneIndigo
```

## Components

### App and state

- [App shell](https://github.com/commaai/connect/blob/master/src/App.jsx): `src/App.jsx`
- [Explorer and routing](https://github.com/commaai/connect/blob/master/src/components/explorer.jsx): `src/components/explorer.jsx`
- [Redux store](https://github.com/commaai/connect/blob/master/src/store.js): `src/store.js`
- [Global state](https://github.com/commaai/connect/blob/master/src/reducers/globalState.js): `src/reducers/globalState.js`
- [Playback state](https://github.com/commaai/connect/blob/master/src/timeline/playback.js): `src/timeline/playback.js`

### Device workflows

- [Device dashboard](https://github.com/commaai/connect/tree/master/src/components/Dashboard): `src/components/Dashboard`
- [Device details](https://github.com/commaai/connect/blob/master/src/components/DeviceInfo/index.jsx): `src/components/DeviceInfo/index.jsx`
- [Live teleoperation](https://github.com/commaai/connect/tree/master/src/components/BodyTeleop): `src/components/BodyTeleop`
- [Map navigation](https://github.com/commaai/connect/blob/master/src/components/Navigation/index.jsx): `src/components/Navigation/index.jsx`
- [Device actions](https://github.com/commaai/connect/blob/master/src/actions/index.js): `src/actions/index.js`

### Drive review

- [Drive viewer](https://github.com/commaai/connect/blob/master/src/components/DriveView/index.jsx): `src/components/DriveView/index.jsx`
- [Drive timeline](https://github.com/commaai/connect/blob/master/src/components/Timeline/index.jsx): `src/components/Timeline/index.jsx`
- [Clip management](https://github.com/commaai/connect/blob/master/src/components/DriveView/ClipMenu.jsx): `src/components/DriveView/ClipMenu.jsx`
- [Drive map](https://github.com/commaai/connect/blob/master/src/components/DriveMap/index.jsx): `src/components/DriveMap/index.jsx`
- [Drive video](https://github.com/commaai/connect/blob/master/src/components/DriveVideo/index.jsx): `src/components/DriveVideo/index.jsx`
- [File uploads](https://github.com/commaai/connect/blob/master/src/components/Files/UploadQueue.jsx): `src/components/Files/UploadQueue.jsx`

### Services and account

- [Backend facade](https://github.com/commaai/connect/blob/master/src/api/backend.js): `src/api/backend.js`
- [Comma APIs](https://github.com/commaai/connect/blob/master/src/api.js): `src/api.js`
- [Clip API](https://github.com/commaai/connect/blob/master/src/api/clips.js): `src/api/clips.js`
- [Demo backend](https://github.com/commaai/connect/blob/master/src/api/demo.js): `src/api/demo.js`
- [Prime subscription](https://github.com/commaai/connect/tree/master/src/components/Prime): `src/components/Prime`
- [Referrals](https://github.com/commaai/connect/blob/master/src/components/Referrals/index.jsx): `src/components/Referrals/index.jsx`

### Other components

- **Openpilot user**
- **Comma services**

## Connections

- Openpilot user → App shell: opens
- App shell → Explorer and routing: routes to (evidence: `src/App.jsx`)
- App shell → Redux store: provides (evidence: `src/App.jsx`)
- Redux store → Global state: reduces state (evidence: `src/store.js`)
- Redux store → Playback state: uses reducer
- Explorer and routing → Device dashboard: offers
- Explorer and routing → Drive viewer: offers
- Explorer and routing → Device details: offers
- Device details → Device actions: dispatches (evidence: `src/components/DeviceInfo/index.jsx`)
- Device details → Clip API: checks support (evidence: `src/components/DeviceInfo/index.jsx`)
- Device details → Live teleoperation: opens
- Device details → Map navigation: links to
- Device actions → Backend facade: calls device API (evidence: `src/actions/index.js`)
- Drive viewer → Drive timeline: shows timeline
- Drive viewer → Drive map: shows map
- Drive viewer → Drive video: plays video
- Drive timeline → Playback state: uses controls (evidence: `src/components/Timeline/index.jsx`)
- Drive viewer → Clip management: offers clips
- Clip management → Clip API: uses (evidence: `src/components/DriveView/ClipMenu.jsx`)
- Backend facade → Comma APIs: wraps (evidence: `src/api/backend.js`)
- Backend facade → Demo backend: selects demo (evidence: `src/api/backend.js`)
- Comma APIs → Comma services: requests (evidence: `src/api.js`)
- Clip API → Comma APIs: uses (evidence: `src/api/clips.js`)
- Explorer and routing → Prime subscription: offers
- Explorer and routing → Referrals: offers
- Prime subscription → Backend facade: uses billing
- Referrals → Backend facade: uses account API (evidence: `src/components/Referrals/index.jsx`)
- Explorer and routing → File uploads: offers uploads
