# tonimwas/timeapp architecture

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

- Interactive diagram: https://gitdiagram.com/tonimwas/timeapp
- Repository: https://github.com/tonimwas/timeapp

## Overview

GeoSpend Kenya is a trip-planning app that helps users choose a starting neighbourhood, budget, available time, categories, and vibes, then view a ranked itinerary with spending and time summaries. The React app also provides map and route features; Django serves place data and accepts a user’s current location. Data-loading commands populate the trip domain. Source excerpts show backend routing and data access, but not the full frontend request flow or all itinerary calculations, so those connections are omitted where unverified.

Main entry points: [`trips/models.py`](https://github.com/tonimwas/timeapp/blob/main/trips/models.py) (Places and transport), [`trips/urls.py`](https://github.com/tonimwas/timeapp/blob/main/trips/urls.py) (Trip URL routes), [`trips/views.py`](https://github.com/tonimwas/timeapp/blob/main/trips/views.py) (Geo data API), [`trips/management/commands/load_region_data.py`](https://github.com/tonimwas/timeapp/blob/main/trips/management/commands/load_region_data.py) (Region data loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Trip planning UI"]
  node_react_entry["React entry<br/>[main.jsx]"]
  node_planner["Trip planner<br/>[App.jsx]"]
end

subgraph group_server["Trip API"]
  node_trip_routes["Trip URL routes<br/>[urls.py]"]
  node_frontend_view["Frontend view<br/>[views.py]"]
  node_geo_data["Geo data API<br/>[views.py]"]
  node_location_api["Location API<br/>[views.py]"]
end

subgraph group_domain["Trip data"]
  node_transport_utils["Transport utilities<br/>[utils.py]"]
  node_trip_models["Places and transport<br/>[models.py]"]
  node_trip_database[("Trip database")]
end

subgraph group_ingest["Data loading"]
  node_nairobi_loader["Nairobi data loader"]
  node_region_loader["Region data loader"]
  node_simple_loader["Place JSON loader"]
  node_sample_loader["Sample data loader"]
end

node_traveler(("Traveler"))
node_route_service["Directions service"]

node_traveler -->|"uses"| node_react_entry
node_react_entry -->|"renders"| node_planner
node_planner -.->|"requests directions"| node_route_service
node_trip_routes -->|"routes home"| node_frontend_view
node_trip_routes -->|"routes geo data"| node_geo_data
node_trip_routes -->|"routes location"| node_location_api
node_geo_data -->|"reads places"| node_trip_models
node_geo_data -->|"calculates transport"| node_transport_utils
node_location_api -->|"reverse geocodes"| node_transport_utils
node_location_api -->|"creates place"| node_trip_models
node_trip_models -->|"persists records"| node_trip_database
node_nairobi_loader -->|"creates records"| node_trip_models
node_region_loader -->|"creates records"| node_trip_models
node_region_loader -->|"delegates Nairobi load"| node_nairobi_loader
node_simple_loader -->|"creates places"| node_trip_models
node_sample_loader -->|"creates sample records"| node_trip_models

click node_react_entry "https://github.com/tonimwas/timeapp/blob/main/frontend/src/main.jsx"
click node_planner "https://github.com/tonimwas/timeapp/blob/main/frontend/src/App.jsx"
click node_trip_routes "https://github.com/tonimwas/timeapp/blob/main/trips/urls.py"
click node_frontend_view "https://github.com/tonimwas/timeapp/blob/main/trips/views.py"
click node_geo_data "https://github.com/tonimwas/timeapp/blob/main/trips/views.py"
click node_location_api "https://github.com/tonimwas/timeapp/blob/main/trips/views.py"
click node_transport_utils "https://github.com/tonimwas/timeapp/blob/main/trips/utils.py"
click node_trip_models "https://github.com/tonimwas/timeapp/blob/main/trips/models.py"
click node_nairobi_loader "https://github.com/tonimwas/timeapp/blob/main/trips/management/commands/load_nairobi_data.py"
click node_region_loader "https://github.com/tonimwas/timeapp/blob/main/trips/management/commands/load_region_data.py"
click node_simple_loader "https://github.com/tonimwas/timeapp/blob/main/trips/management/commands/load_simple_places.py"
click node_sample_loader "https://github.com/tonimwas/timeapp/blob/main/trips/management/commands/seed_sample_data.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_react_entry,node_planner toneBlue
class node_trip_routes,node_frontend_view,node_geo_data,node_location_api toneAmber
class node_transport_utils,node_trip_models,node_trip_database toneMint
class node_nairobi_loader,node_region_loader,node_simple_loader,node_sample_loader toneRose
class node_traveler,node_route_service toneIndigo
```

## Components

### Trip planning UI

- [React entry](https://github.com/tonimwas/timeapp/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`
- [Trip planner](https://github.com/tonimwas/timeapp/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`

### Trip API

- [Trip URL routes](https://github.com/tonimwas/timeapp/blob/main/trips/urls.py): `trips/urls.py`
- [Frontend view](https://github.com/tonimwas/timeapp/blob/main/trips/views.py): `trips/views.py`
- [Geo data API](https://github.com/tonimwas/timeapp/blob/main/trips/views.py): `trips/views.py`
- [Location API](https://github.com/tonimwas/timeapp/blob/main/trips/views.py): `trips/views.py`

### Trip data

- [Transport utilities](https://github.com/tonimwas/timeapp/blob/main/trips/utils.py): `trips/utils.py`
- [Places and transport](https://github.com/tonimwas/timeapp/blob/main/trips/models.py): `trips/models.py`
- **Trip database**

### Data loading

- [Nairobi data loader](https://github.com/tonimwas/timeapp/blob/main/trips/management/commands/load_nairobi_data.py): `trips/management/commands/load_nairobi_data.py`
- [Region data loader](https://github.com/tonimwas/timeapp/blob/main/trips/management/commands/load_region_data.py): `trips/management/commands/load_region_data.py`
- [Place JSON loader](https://github.com/tonimwas/timeapp/blob/main/trips/management/commands/load_simple_places.py): `trips/management/commands/load_simple_places.py`
- [Sample data loader](https://github.com/tonimwas/timeapp/blob/main/trips/management/commands/seed_sample_data.py): `trips/management/commands/seed_sample_data.py`

### Other components

- **Traveler**
- **Directions service**

## Connections

- Traveler → React entry: uses
- React entry → Trip planner: renders (evidence: `frontend/src/main.jsx`)
- Trip planner → Directions service: requests directions
- Trip URL routes → Frontend view: routes home (evidence: `trips/urls.py`)
- Trip URL routes → Geo data API: routes geo data (evidence: `trips/urls.py`)
- Trip URL routes → Location API: routes location (evidence: `trips/urls.py`)
- Geo data API → Places and transport: reads places (evidence: `trips/views.py`)
- Geo data API → Transport utilities: calculates transport (evidence: `trips/views.py`)
- Location API → Transport utilities: reverse geocodes (evidence: `trips/views.py`)
- Location API → Places and transport: creates place (evidence: `trips/views.py`)
- Places and transport → Trip database: persists records (evidence: `trips/models.py`)
- Nairobi data loader → Places and transport: creates records (evidence: `trips/management/commands/load_nairobi_data.py`)
- Region data loader → Places and transport: creates records (evidence: `trips/management/commands/load_region_data.py`)
- Region data loader → Nairobi data loader: delegates Nairobi load (evidence: `trips/management/commands/load_region_data.py`)
- Place JSON loader → Places and transport: creates places (evidence: `trips/management/commands/load_simple_places.py`)
- Sample data loader → Places and transport: creates sample records (evidence: `trips/management/commands/seed_sample_data.py`)
