# traccar/traccar-web architecture

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

- Interactive diagram: https://gitdiagram.com/traccar/traccar-web
- Repository: https://github.com/traccar/traccar-web

## Overview

Traccar Web is a React single-page GPS-tracking dashboard. Users authenticate, then monitor devices on a live map and use reports, replay, geofences, and management screens; the app exchanges REST and live updates with a Traccar server. The graph preserves these documented product branches and the sampled state, map, and localization layers. Some feature pages were not sampled, so their internal calls and routing are not asserted.

Main entry points: [`src/App.jsx`](https://github.com/traccar/traccar-web/blob/master/src/App.jsx) (Application shell), [`src/SocketController.jsx`](https://github.com/traccar/traccar-web/blob/master/src/SocketController.jsx) (Live update controller), [`src/main/MainPage.jsx`](https://github.com/traccar/traccar-web/blob/master/src/main/MainPage.jsx) (Live tracking workspace), [`src/map/core/MapView.jsx`](https://github.com/traccar/traccar-web/blob/master/src/map/core/MapView.jsx) (Interactive map)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["App shell"]
  node_app["Application shell<br/>[App.jsx]"]
  node_navigation["Navigation<br/>[Navigation.jsx]"]
  node_login["Login and registration<br/>[LoginPage.jsx]"]
end

subgraph group_tracking["Live tracking"]
  node_socket["Live update controller"]
  node_main["Live tracking workspace<br/>[MainPage.jsx]"]
  node_device_list["Device list<br/>[DeviceList.jsx]"]
  node_map_view["Interactive map<br/>[MapView.jsx]"]
  node_map_features["Map layers and overlays"]
  node_motion["Motion timeline"]
end

subgraph group_analysis["Reports and history"]
  node_replay["Position replay<br/>[ReplayPage.jsx]"]
  node_reports["Reports"]
end

subgraph group_management["Administration"]
  node_geofences["Geofence management<br/>[GeofencesPage.jsx]"]
  node_settings["Device and account settings"]
end

subgraph group_shared["Shared runtime"]
  node_state["Application state<br/>[index.js]"]
  node_fetch["HTTP response helper<br/>[fetchOrThrow.js]"]
  node_localization["Localization provider"]
  node_persisted["Persisted browser state"]
  node_map_util["Map geometry utilities<br/>[mapUtil.js]"]
end

node_user(("Dashboard user"))
node_server["Traccar server"]

node_user -->|"opens dashboard"| node_app
node_app -->|"renders navigation"| node_navigation
node_user -->|"authenticates"| node_login
node_login -->|"uses REST API"| node_server
node_app -->|"configures state"| node_state
node_app -->|"renders controller"| node_socket
node_socket -->|"loads devices and receives updates"| node_server
node_socket -->|"dispatches updates"| node_state
node_user -->|"monitors devices"| node_main
node_main -.->|"shows devices"| node_device_list
node_main -.->|"shows live map"| node_map_view
node_map_view -->|"saves map choice"| node_persisted
node_map_view -.->|"hosts map layers"| node_map_features
node_map_features -->|"uses geometry helpers"| node_map_util
node_app -->|"renders controller"| node_motion
node_motion -->|"loads motion events"| node_server
node_motion -->|"stores motion segments"| node_state
node_user -->|"reviews history"| node_replay
node_replay -.->|"loads historical data"| node_server
node_user -->|"runs reports"| node_reports
node_reports -.->|"requests report data"| node_server
node_user -->|"manages geofences"| node_geofences
node_user -->|"manages devices"| node_settings
node_app -->|"provides translations"| node_localization
node_localization -->|"persists language choice"| node_persisted
node_localization -->|"updates user language"| node_fetch

click node_app "https://github.com/traccar/traccar-web/blob/master/src/App.jsx"
click node_navigation "https://github.com/traccar/traccar-web/blob/master/src/Navigation.jsx"
click node_login "https://github.com/traccar/traccar-web/blob/master/src/login/LoginPage.jsx"
click node_socket "https://github.com/traccar/traccar-web/blob/master/src/SocketController.jsx"
click node_main "https://github.com/traccar/traccar-web/blob/master/src/main/MainPage.jsx"
click node_device_list "https://github.com/traccar/traccar-web/blob/master/src/main/DeviceList.jsx"
click node_map_view "https://github.com/traccar/traccar-web/blob/master/src/map/core/MapView.jsx"
click node_map_features "https://github.com/traccar/traccar-web/tree/master/src/map"
click node_motion "https://github.com/traccar/traccar-web/blob/master/src/main/MotionController.jsx"
click node_replay "https://github.com/traccar/traccar-web/blob/master/src/other/ReplayPage.jsx"
click node_reports "https://github.com/traccar/traccar-web/tree/master/src/reports"
click node_geofences "https://github.com/traccar/traccar-web/blob/master/src/other/GeofencesPage.jsx"
click node_settings "https://github.com/traccar/traccar-web/tree/master/src/settings"
click node_state "https://github.com/traccar/traccar-web/blob/master/src/store/index.js"
click node_fetch "https://github.com/traccar/traccar-web/blob/master/src/common/util/fetchOrThrow.js"
click node_localization "https://github.com/traccar/traccar-web/blob/master/src/common/components/LocalizationProvider.jsx"
click node_persisted "https://github.com/traccar/traccar-web/blob/master/src/common/util/usePersistedState.js"
click node_map_util "https://github.com/traccar/traccar-web/blob/master/src/map/core/mapUtil.js"

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,node_navigation,node_login,node_user toneBlue
class node_socket,node_main,node_device_list,node_map_view,node_map_features,node_motion toneAmber
class node_replay,node_reports,node_server toneMint
class node_geofences,node_settings toneRose
class node_state,node_fetch,node_localization,node_persisted,node_map_util toneIndigo
```

## Components

### App shell

- [Application shell](https://github.com/traccar/traccar-web/blob/master/src/App.jsx): `src/App.jsx`
- [Navigation](https://github.com/traccar/traccar-web/blob/master/src/Navigation.jsx): `src/Navigation.jsx`
- [Login and registration](https://github.com/traccar/traccar-web/blob/master/src/login/LoginPage.jsx): `src/login/LoginPage.jsx`

### Live tracking

- [Live update controller](https://github.com/traccar/traccar-web/blob/master/src/SocketController.jsx): `src/SocketController.jsx`
- [Live tracking workspace](https://github.com/traccar/traccar-web/blob/master/src/main/MainPage.jsx): `src/main/MainPage.jsx`
- [Device list](https://github.com/traccar/traccar-web/blob/master/src/main/DeviceList.jsx): `src/main/DeviceList.jsx`
- [Interactive map](https://github.com/traccar/traccar-web/blob/master/src/map/core/MapView.jsx): `src/map/core/MapView.jsx`
- [Map layers and overlays](https://github.com/traccar/traccar-web/tree/master/src/map): `src/map`
- [Motion timeline](https://github.com/traccar/traccar-web/blob/master/src/main/MotionController.jsx): `src/main/MotionController.jsx`

### Reports and history

- [Position replay](https://github.com/traccar/traccar-web/blob/master/src/other/ReplayPage.jsx): `src/other/ReplayPage.jsx`
- [Reports](https://github.com/traccar/traccar-web/tree/master/src/reports): `src/reports`

### Administration

- [Geofence management](https://github.com/traccar/traccar-web/blob/master/src/other/GeofencesPage.jsx): `src/other/GeofencesPage.jsx`
- [Device and account settings](https://github.com/traccar/traccar-web/tree/master/src/settings): `src/settings`

### Shared runtime

- [Application state](https://github.com/traccar/traccar-web/blob/master/src/store/index.js): `src/store/index.js`
- [HTTP response helper](https://github.com/traccar/traccar-web/blob/master/src/common/util/fetchOrThrow.js): `src/common/util/fetchOrThrow.js`
- [Localization provider](https://github.com/traccar/traccar-web/blob/master/src/common/components/LocalizationProvider.jsx): `src/common/components/LocalizationProvider.jsx`
- [Persisted browser state](https://github.com/traccar/traccar-web/blob/master/src/common/util/usePersistedState.js): `src/common/util/usePersistedState.js`
- [Map geometry utilities](https://github.com/traccar/traccar-web/blob/master/src/map/core/mapUtil.js): `src/map/core/mapUtil.js`

### Other components

- **Dashboard user**
- **Traccar server**

## Connections

- Dashboard user → Application shell: opens dashboard (evidence: `README.md`)
- Application shell → Navigation: renders navigation (evidence: `src/App.jsx`)
- Dashboard user → Login and registration: authenticates (evidence: `README.md`)
- Login and registration → Traccar server: uses REST API (evidence: `README.md`)
- Application shell → Application state: configures state (evidence: `src/App.jsx`)
- Application shell → Live update controller: renders controller (evidence: `src/App.jsx`)
- Live update controller → Traccar server: loads devices and receives updates (evidence: `src/SocketController.jsx`)
- Live update controller → Application state: dispatches updates (evidence: `src/SocketController.jsx`)
- Dashboard user → Live tracking workspace: monitors devices (evidence: `README.md`)
- Live tracking workspace → Device list: shows devices
- Live tracking workspace → Interactive map: shows live map (evidence: `README.md`)
- Interactive map → Persisted browser state: saves map choice (evidence: `src/map/core/MapView.jsx`)
- Interactive map → Map layers and overlays: hosts map layers (evidence: `src/map/core/MapView.jsx`)
- Map layers and overlays → Map geometry utilities: uses geometry helpers (evidence: `src/map/MapGeofence.js`)
- Application shell → Motion timeline: renders controller (evidence: `src/App.jsx`)
- Motion timeline → Traccar server: loads motion events (evidence: `src/main/MotionController.jsx`)
- Motion timeline → Application state: stores motion segments (evidence: `src/main/MotionController.jsx`)
- Dashboard user → Position replay: reviews history (evidence: `README.md`)
- Position replay → Traccar server: loads historical data
- Dashboard user → Reports: runs reports (evidence: `README.md`)
- Reports → Traccar server: requests report data
- Dashboard user → Geofence management: manages geofences (evidence: `README.md`)
- Dashboard user → Device and account settings: manages devices (evidence: `README.md`)
- Application shell → Localization provider: provides translations (evidence: `src/App.jsx`)
- Localization provider → Persisted browser state: persists language choice (evidence: `src/common/components/LocalizationProvider.jsx`)
- Localization provider → HTTP response helper: updates user language (evidence: `src/common/components/LocalizationProvider.jsx`)
