# romannjoroge/little-cab-dummy-server architecture

> Architecture diagram of the GitHub repository romannjoroge/little-cab-dummy-server, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/romannjoroge/little-cab-dummy-server
- Repository: https://github.com/romannjoroge/little-cab-dummy-server

## Overview

Little Cab Dummy Server is an in-memory FastAPI mock for testing the Odoo carrier integration. Odoo obtains a token, requests estimates, books a ride, and polls trip details; booking starts an optional timed status simulation, while cancellation and status changes can POST callbacks to Odoo. The main routes coordinate these operations; trip data and deterministic estimates live in the store. The README documents the endpoint set and debug advancement. The sampled source shows route-to-module calls and webhook delivery; unsampled components are not inferred.

Main entry points: [`app/main.py`](https://github.com/romannjoroge/little-cab-dummy-server/blob/main/app/main.py) (API routes), [`app/simulator.py`](https://github.com/romannjoroge/little-cab-dummy-server/blob/main/app/simulator.py) (Status simulation), [`app/webhooks.py`](https://github.com/romannjoroge/little-cab-dummy-server/blob/main/app/webhooks.py) (Webhook sender), [`app/config.py`](https://github.com/romannjoroge/little-cab-dummy-server/blob/main/app/config.py) (Runtime config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and trips"]
  node_routes["API routes<br/>[main.py]"]
  node_auth["Token and auth<br/>[main.py]"]
  node_estimates["Ride estimates<br/>[store.py]"]
  node_booking["Ride booking<br/>[main.py]"]
  node_trip_api["Trip details<br/>[main.py]"]
end

subgraph group_lifecycle["Trip lifecycle"]
  node_trip_store[("In-memory trips<br/>[store.py]")]
  node_simulation["Status simulation<br/>[simulator.py]"]
end

subgraph group_settings["Settings and callbacks"]
  node_webhooks["Webhook sender<br/>[webhooks.py]"]
  node_config["Runtime config<br/>[config.py]"]
end

node_odoo(("Odoo carrier"))
node_callback(("Odoo webhook"))

node_odoo -->|"calls endpoints"| node_routes
node_routes -->|"validates credentials"| node_auth
node_routes -->|"reads settings"| node_config
node_routes -->|"gets estimates"| node_estimates
node_routes -->|"creates and reads"| node_trip_store
node_routes -->|"starts and stops"| node_simulation
node_routes -->|"sends callbacks"| node_webhooks
node_simulation -->|"advances trips"| node_trip_store
node_simulation -->|"sends updates"| node_webhooks
node_simulation -->|"reads timing"| node_config
node_webhooks -->|"reads department"| node_config
node_webhooks -->|"posts status"| node_callback

click node_routes "https://github.com/romannjoroge/little-cab-dummy-server/blob/main/app/main.py"
click node_auth "https://github.com/romannjoroge/little-cab-dummy-server/blob/main/app/main.py"
click node_estimates "https://github.com/romannjoroge/little-cab-dummy-server/blob/main/app/store.py"
click node_booking "https://github.com/romannjoroge/little-cab-dummy-server/blob/main/app/main.py"
click node_trip_api "https://github.com/romannjoroge/little-cab-dummy-server/blob/main/app/main.py"
click node_trip_store "https://github.com/romannjoroge/little-cab-dummy-server/blob/main/app/store.py"
click node_simulation "https://github.com/romannjoroge/little-cab-dummy-server/blob/main/app/simulator.py"
click node_webhooks "https://github.com/romannjoroge/little-cab-dummy-server/blob/main/app/webhooks.py"
click node_config "https://github.com/romannjoroge/little-cab-dummy-server/blob/main/app/config.py"

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_routes,node_auth,node_estimates,node_booking,node_trip_api toneBlue
class node_trip_store,node_simulation toneAmber
class node_webhooks,node_config,node_callback toneMint
class node_odoo toneIndigo
```

## Components

### API and trips

- [API routes](https://github.com/romannjoroge/little-cab-dummy-server/blob/main/app/main.py): `app/main.py`
- [Token and auth](https://github.com/romannjoroge/little-cab-dummy-server/blob/main/app/main.py): `app/main.py`
- [Ride estimates](https://github.com/romannjoroge/little-cab-dummy-server/blob/main/app/store.py): `app/store.py`
- [Ride booking](https://github.com/romannjoroge/little-cab-dummy-server/blob/main/app/main.py): `app/main.py`
- [Trip details](https://github.com/romannjoroge/little-cab-dummy-server/blob/main/app/main.py): `app/main.py`

### Trip lifecycle

- [In-memory trips](https://github.com/romannjoroge/little-cab-dummy-server/blob/main/app/store.py): `app/store.py`
- [Status simulation](https://github.com/romannjoroge/little-cab-dummy-server/blob/main/app/simulator.py): `app/simulator.py`

### Settings and callbacks

- [Webhook sender](https://github.com/romannjoroge/little-cab-dummy-server/blob/main/app/webhooks.py): `app/webhooks.py`
- [Runtime config](https://github.com/romannjoroge/little-cab-dummy-server/blob/main/app/config.py): `app/config.py`

### Other components

- **Odoo carrier**
- **Odoo webhook**

## Connections

- Odoo carrier → API routes: calls endpoints (evidence: `README.md`)
- API routes → Token and auth: validates credentials (evidence: `app/main.py`)
- API routes → Runtime config: reads settings (evidence: `app/main.py`)
- API routes → Ride estimates: gets estimates (evidence: `app/main.py`)
- API routes → In-memory trips: creates and reads (evidence: `app/main.py`)
- API routes → Status simulation: starts and stops (evidence: `app/main.py`)
- API routes → Webhook sender: sends callbacks (evidence: `app/main.py`)
- Status simulation → In-memory trips: advances trips (evidence: `app/simulator.py`)
- Status simulation → Webhook sender: sends updates (evidence: `app/simulator.py`)
- Status simulation → Runtime config: reads timing (evidence: `app/simulator.py`)
- Webhook sender → Runtime config: reads department (evidence: `app/webhooks.py`)
- Webhook sender → Odoo webhook: posts status (evidence: `app/webhooks.py`)
