# autofleet/locomotion architecture

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

- Interactive diagram: https://gitdiagram.com/autofleet/locomotion
- Repository: https://github.com/autofleet/locomotion

## Overview

Locomotion is a React Native rider app for ride-hailing, ride-sharing, and mobility services, pre-integrated with Autofleet’s ride engine. The documented user journey is to enter a destination, receive ride offers, and book a ride; the app also includes payment setup and ride-related screens. The tree shows separate contexts and pages for these domains, but no source excerpts were provided, so internal call relationships cannot be verified. The diagram therefore limits edges to the README-documented user interaction and backend integration.

Main entry points: [`examples/client/Locomotion/src/index.js`](https://github.com/autofleet/locomotion/blob/master/examples/client/Locomotion/src/index.js) (Locomotion app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Mobile app"]
  node_app["Locomotion app<br/>[index.js]"]
  node_router["App routing"]
end

subgraph group_trip["Ride experience"]
  node_newride["Request a ride"]
  node_places["Places"]
  node_availability["Vehicle availability"]
  node_active["Active ride"]
  node_future["Future rides"]
  node_history["Ride history"]
end

subgraph group_account["Rider services"]
  node_payments["Payments"]
  node_user["Rider account"]
  node_onboarding["Onboarding"]
end

subgraph group_platform["Ride platform"]
  node_autofleet{{"Autofleet ride engine"}}
end

node_rider(("Rider"))

node_rider -->|"uses"| node_app
node_app -->|"uses ride engine"| node_autofleet

click node_app "https://github.com/autofleet/locomotion/blob/master/examples/client/Locomotion/src/index.js"
click node_router "https://github.com/autofleet/locomotion/blob/master/examples/client/Locomotion/src/LocomotionRouter.js"
click node_newride "https://github.com/autofleet/locomotion/tree/master/examples/client/Locomotion/src/context/newRideContext"
click node_places "https://github.com/autofleet/locomotion/tree/master/examples/client/Locomotion/src/context/places"
click node_availability "https://github.com/autofleet/locomotion/tree/master/examples/client/Locomotion/src/context/availability"
click node_active "https://github.com/autofleet/locomotion/tree/master/examples/client/Locomotion/src/pages/ActiveRide"
click node_future "https://github.com/autofleet/locomotion/tree/master/examples/client/Locomotion/src/context/futureRides"
click node_history "https://github.com/autofleet/locomotion/tree/master/examples/client/Locomotion/src/context/rideHistory"
click node_payments "https://github.com/autofleet/locomotion/tree/master/examples/client/Locomotion/src/context/payments"
click node_user "https://github.com/autofleet/locomotion/tree/master/examples/client/Locomotion/src/context/user"
click node_onboarding "https://github.com/autofleet/locomotion/tree/master/examples/client/Locomotion/src/context/onboarding"

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_router toneBlue
class node_newride,node_places,node_availability,node_active,node_future,node_history toneAmber
class node_payments,node_user,node_onboarding toneMint
class node_autofleet toneRose
class node_rider toneIndigo
```

## Components

### Mobile app

- [Locomotion app](https://github.com/autofleet/locomotion/blob/master/examples/client/Locomotion/src/index.js): `examples/client/Locomotion/src/index.js`
- [App routing](https://github.com/autofleet/locomotion/blob/master/examples/client/Locomotion/src/LocomotionRouter.js): `examples/client/Locomotion/src/LocomotionRouter.js`

### Ride experience

- [Request a ride](https://github.com/autofleet/locomotion/tree/master/examples/client/Locomotion/src/context/newRideContext): `examples/client/Locomotion/src/context/newRideContext`
- [Places](https://github.com/autofleet/locomotion/tree/master/examples/client/Locomotion/src/context/places): `examples/client/Locomotion/src/context/places`
- [Vehicle availability](https://github.com/autofleet/locomotion/tree/master/examples/client/Locomotion/src/context/availability): `examples/client/Locomotion/src/context/availability`
- [Active ride](https://github.com/autofleet/locomotion/tree/master/examples/client/Locomotion/src/pages/ActiveRide): `examples/client/Locomotion/src/pages/ActiveRide`
- [Future rides](https://github.com/autofleet/locomotion/tree/master/examples/client/Locomotion/src/context/futureRides): `examples/client/Locomotion/src/context/futureRides`
- [Ride history](https://github.com/autofleet/locomotion/tree/master/examples/client/Locomotion/src/context/rideHistory): `examples/client/Locomotion/src/context/rideHistory`

### Rider services

- [Payments](https://github.com/autofleet/locomotion/tree/master/examples/client/Locomotion/src/context/payments): `examples/client/Locomotion/src/context/payments`
- [Rider account](https://github.com/autofleet/locomotion/tree/master/examples/client/Locomotion/src/context/user): `examples/client/Locomotion/src/context/user`
- [Onboarding](https://github.com/autofleet/locomotion/tree/master/examples/client/Locomotion/src/context/onboarding): `examples/client/Locomotion/src/context/onboarding`

### Ride platform

- **Autofleet ride engine**

### Other components

- **Rider**

## Connections

- Rider → Locomotion app: uses (evidence: `README.md`)
- Locomotion app → Autofleet ride engine: uses ride engine (evidence: `README.md`)
