# ferrerversion/atlas architecture

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

- Interactive diagram: https://gitdiagram.com/ferrerversion/atlas
- Repository: https://github.com/ferrerversion/atlas

## Overview

Atlas is a browser-based OpenStreetMap navigation app. The main workflow is place search, route calculation over downloaded or cached road data, then map display and turn-by-turn guidance with optional GPS tracking. Additional branches cover POI discovery, map themes, and user-authored custom maps. The graph uses README statements and the provided source index/excerpts; some UI wiring and unsampled subsystem internals are therefore omitted or linked only where documented.

Main entry points: [`src/features/routing/routeService.ts`](https://github.com/ferrerversion/atlas/blob/main/src/features/routing/routeService.ts) (Route service), [`src/hooks/useNavigationRunner.ts`](https://github.com/ferrerversion/atlas/blob/main/src/hooks/useNavigationRunner.ts) (Navigation runner), [`src/hooks/useSearch.ts`](https://github.com/ferrerversion/atlas/blob/main/src/hooks/useSearch.ts) (Search orchestration), [`src/features/search/searchService.ts`](https://github.com/ferrerversion/atlas/blob/main/src/features/search/searchService.ts) (Search service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_app["App shell<br/>[App.tsx]"]
  node_search_ui["Place search<br/>[SearchBar.tsx]"]
  node_results["Search results<br/>[SearchResults.tsx]"]
  node_map["Interactive map<br/>[MapView.tsx]"]
  node_route_ui["Route panel<br/>[RoutePanel.tsx]"]
  node_theme_gallery["Theme gallery<br/>[ThemeGallery.tsx]"]
end

subgraph group_places["Places and map data"]
  node_search_hook["Search orchestration<br/>[useSearch.ts]"]
  node_search_service["Search service<br/>[searchService.ts]"]
  node_geocoding["Geocoding"]
  node_poi["POI categories<br/>[poiTypes.ts]"]
  node_tiles["Map tiles<br/>[tileProviders.ts]"]
  node_osm["OSM road data<br/>[overpassService.ts]"]
  node_network[("Road network cache<br/>[networkStore.ts]")]
  node_storage[("Geodata cache<br/>[storage.ts]")]
end

subgraph group_routing["Routing and guidance"]
  node_route_hook["Route orchestration"]
  node_route_service["Route service<br/>[routeService.ts]"]
  node_graph["Road graph builder<br/>[graph.ts]"]
  node_astar["A* route engine<br/>[astar.ts]"]
  node_instructions["Route instructions"]
  node_nav_runner["Navigation runner"]
  node_live_tracking["GPS trip tracking<br/>[liveTracking.ts]"]
  node_progress["Route progress"]
end

subgraph group_personalization["Personalization"]
  node_app_store[("App preferences<br/>[useAppStore.ts]")]
  node_nav_store[("Navigation state<br/>[useNavStore.ts]")]
  node_themes["Map themes<br/>[themeRegistry.ts]"]
  node_custom_page["Custom map editor<br/>[CustomMapPage.tsx]"]
  node_custom_service["Custom map service"]
  node_custom_editor["Custom map editor state"]
end

node_user(("Traveler"))
node_gps(("Device GPS"))

node_user -->|"searches"| node_search_ui
node_search_ui -.->|"submits query"| node_search_hook
node_search_hook -->|"queries"| node_search_service
node_search_service -->|"looks up places"| node_geocoding
node_search_service -->|"matches categories"| node_poi
node_search_hook -.->|"supplies results"| node_results
node_user -->|"sets route stops"| node_route_ui
node_route_ui -.->|"requests route"| node_route_hook
node_route_hook -->|"computes route"| node_route_service
node_route_service -->|"downloads roads"| node_osm
node_route_service -->|"adds road data"| node_network
node_osm -->|"caches responses"| node_storage
node_route_service -->|"builds route graph"| node_graph
node_route_service -->|"finds paths"| node_astar
node_route_service -->|"generates maneuvers"| node_instructions
node_route_service -.->|"displays route"| node_map
node_map -->|"loads basemap"| node_tiles
node_user -->|"grants location"| node_gps
node_gps -->|"provides fixes"| node_nav_runner
node_nav_runner -->|"updates trip metrics"| node_live_tracking
node_nav_runner -->|"advances guidance"| node_progress
node_nav_runner -->|"updates state"| node_nav_store
node_nav_runner -.->|"recalculates off-route"| node_route_hook
node_user -->|"chooses style"| node_theme_gallery
node_theme_gallery -.->|"selects theme"| node_themes
node_themes -->|"resolves preference"| node_app_store
node_user -->|"edits custom map"| node_custom_page
node_custom_page -.->|"uses editor state"| node_custom_editor
node_custom_editor -->|"delegates map data"| node_custom_service
node_custom_service -->|"persists maps"| node_storage

click node_app "https://github.com/ferrerversion/atlas/blob/main/src/app/App.tsx"
click node_search_ui "https://github.com/ferrerversion/atlas/blob/main/src/components/search/SearchBar.tsx"
click node_results "https://github.com/ferrerversion/atlas/blob/main/src/components/search/SearchResults.tsx"
click node_search_hook "https://github.com/ferrerversion/atlas/blob/main/src/hooks/useSearch.ts"
click node_search_service "https://github.com/ferrerversion/atlas/blob/main/src/features/search/searchService.ts"
click node_geocoding "https://github.com/ferrerversion/atlas/blob/main/src/features/geocoding/geocodingService.ts"
click node_poi "https://github.com/ferrerversion/atlas/blob/main/src/features/poi/poiTypes.ts"
click node_map "https://github.com/ferrerversion/atlas/blob/main/src/components/map/MapView.tsx"
click node_tiles "https://github.com/ferrerversion/atlas/blob/main/src/features/map/tileProviders.ts"
click node_route_ui "https://github.com/ferrerversion/atlas/blob/main/src/components/navigation/RoutePanel.tsx"
click node_route_hook "https://github.com/ferrerversion/atlas/blob/main/src/hooks/useRouteComputation.ts"
click node_route_service "https://github.com/ferrerversion/atlas/blob/main/src/features/routing/routeService.ts"
click node_osm "https://github.com/ferrerversion/atlas/blob/main/src/features/osm/overpassService.ts"
click node_network "https://github.com/ferrerversion/atlas/blob/main/src/features/osm/networkStore.ts"
click node_graph "https://github.com/ferrerversion/atlas/blob/main/src/features/routing/graph.ts"
click node_astar "https://github.com/ferrerversion/atlas/blob/main/src/features/routing/astar.ts"
click node_instructions "https://github.com/ferrerversion/atlas/blob/main/src/features/routing/routeInstructions.ts"
click node_nav_runner "https://github.com/ferrerversion/atlas/blob/main/src/hooks/useNavigationRunner.ts"
click node_live_tracking "https://github.com/ferrerversion/atlas/blob/main/src/features/navigation/liveTracking.ts"
click node_progress "https://github.com/ferrerversion/atlas/blob/main/src/features/navigation/navigationProgress.ts"
click node_app_store "https://github.com/ferrerversion/atlas/blob/main/src/store/useAppStore.ts"
click node_nav_store "https://github.com/ferrerversion/atlas/blob/main/src/store/useNavStore.ts"
click node_storage "https://github.com/ferrerversion/atlas/blob/main/src/utils/storage.ts"
click node_themes "https://github.com/ferrerversion/atlas/blob/main/src/features/themes/themeRegistry.ts"
click node_theme_gallery "https://github.com/ferrerversion/atlas/blob/main/src/components/themes/ThemeGallery.tsx"
click node_custom_page "https://github.com/ferrerversion/atlas/blob/main/src/components/customMap/CustomMapPage.tsx"
click node_custom_service "https://github.com/ferrerversion/atlas/blob/main/src/features/customMap/customMapService.ts"
click node_custom_editor "https://github.com/ferrerversion/atlas/blob/main/src/components/customMap/useCustomMapEditor.ts"

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_search_ui,node_results,node_map,node_route_ui,node_theme_gallery toneBlue
class node_search_hook,node_search_service,node_geocoding,node_poi,node_tiles,node_osm,node_network,node_storage toneAmber
class node_route_hook,node_route_service,node_graph,node_astar,node_instructions,node_nav_runner,node_live_tracking,node_progress toneMint
class node_app_store,node_nav_store,node_themes,node_custom_page,node_custom_service,node_custom_editor toneRose
class node_user,node_gps toneIndigo
```

## Components

### App experience

- [App shell](https://github.com/ferrerversion/atlas/blob/main/src/app/App.tsx): `src/app/App.tsx`
- [Place search](https://github.com/ferrerversion/atlas/blob/main/src/components/search/SearchBar.tsx): `src/components/search/SearchBar.tsx`
- [Search results](https://github.com/ferrerversion/atlas/blob/main/src/components/search/SearchResults.tsx): `src/components/search/SearchResults.tsx`
- [Interactive map](https://github.com/ferrerversion/atlas/blob/main/src/components/map/MapView.tsx): `src/components/map/MapView.tsx`
- [Route panel](https://github.com/ferrerversion/atlas/blob/main/src/components/navigation/RoutePanel.tsx): `src/components/navigation/RoutePanel.tsx`
- [Theme gallery](https://github.com/ferrerversion/atlas/blob/main/src/components/themes/ThemeGallery.tsx): `src/components/themes/ThemeGallery.tsx`

### Places and map data

- [Search orchestration](https://github.com/ferrerversion/atlas/blob/main/src/hooks/useSearch.ts): `src/hooks/useSearch.ts`
- [Search service](https://github.com/ferrerversion/atlas/blob/main/src/features/search/searchService.ts): `src/features/search/searchService.ts`
- [Geocoding](https://github.com/ferrerversion/atlas/blob/main/src/features/geocoding/geocodingService.ts): `src/features/geocoding/geocodingService.ts`
- [POI categories](https://github.com/ferrerversion/atlas/blob/main/src/features/poi/poiTypes.ts): `src/features/poi/poiTypes.ts`
- [Map tiles](https://github.com/ferrerversion/atlas/blob/main/src/features/map/tileProviders.ts): `src/features/map/tileProviders.ts`
- [OSM road data](https://github.com/ferrerversion/atlas/blob/main/src/features/osm/overpassService.ts): `src/features/osm/overpassService.ts`
- [Road network cache](https://github.com/ferrerversion/atlas/blob/main/src/features/osm/networkStore.ts): `src/features/osm/networkStore.ts`
- [Geodata cache](https://github.com/ferrerversion/atlas/blob/main/src/utils/storage.ts): `src/utils/storage.ts`

### Routing and guidance

- [Route orchestration](https://github.com/ferrerversion/atlas/blob/main/src/hooks/useRouteComputation.ts): `src/hooks/useRouteComputation.ts`
- [Route service](https://github.com/ferrerversion/atlas/blob/main/src/features/routing/routeService.ts): `src/features/routing/routeService.ts`
- [Road graph builder](https://github.com/ferrerversion/atlas/blob/main/src/features/routing/graph.ts): `src/features/routing/graph.ts`
- [A* route engine](https://github.com/ferrerversion/atlas/blob/main/src/features/routing/astar.ts): `src/features/routing/astar.ts`
- [Route instructions](https://github.com/ferrerversion/atlas/blob/main/src/features/routing/routeInstructions.ts): `src/features/routing/routeInstructions.ts`
- [Navigation runner](https://github.com/ferrerversion/atlas/blob/main/src/hooks/useNavigationRunner.ts): `src/hooks/useNavigationRunner.ts`
- [GPS trip tracking](https://github.com/ferrerversion/atlas/blob/main/src/features/navigation/liveTracking.ts): `src/features/navigation/liveTracking.ts`
- [Route progress](https://github.com/ferrerversion/atlas/blob/main/src/features/navigation/navigationProgress.ts): `src/features/navigation/navigationProgress.ts`

### Personalization

- [App preferences](https://github.com/ferrerversion/atlas/blob/main/src/store/useAppStore.ts): `src/store/useAppStore.ts`
- [Navigation state](https://github.com/ferrerversion/atlas/blob/main/src/store/useNavStore.ts): `src/store/useNavStore.ts`
- [Map themes](https://github.com/ferrerversion/atlas/blob/main/src/features/themes/themeRegistry.ts): `src/features/themes/themeRegistry.ts`
- [Custom map editor](https://github.com/ferrerversion/atlas/blob/main/src/components/customMap/CustomMapPage.tsx): `src/components/customMap/CustomMapPage.tsx`
- [Custom map service](https://github.com/ferrerversion/atlas/blob/main/src/features/customMap/customMapService.ts): `src/features/customMap/customMapService.ts`
- [Custom map editor state](https://github.com/ferrerversion/atlas/blob/main/src/components/customMap/useCustomMapEditor.ts): `src/components/customMap/useCustomMapEditor.ts`

### Other components

- **Traveler**
- **Device GPS**

## Connections

- Traveler → Place search: searches
- Place search → Search orchestration: submits query
- Search orchestration → Search service: queries (evidence: `src/hooks/useSearch.ts`)
- Search service → Geocoding: looks up places (evidence: `src/features/search/searchService.ts`)
- Search service → POI categories: matches categories (evidence: `src/features/search/searchService.ts`)
- Search orchestration → Search results: supplies results
- Traveler → Route panel: sets route stops
- Route panel → Route orchestration: requests route
- Route orchestration → Route service: computes route (evidence: `src/hooks/useRouteComputation.ts`)
- Route service → OSM road data: downloads roads (evidence: `src/features/routing/routeService.ts`)
- Route service → Road network cache: adds road data (evidence: `src/features/routing/routeService.ts`)
- OSM road data → Geodata cache: caches responses (evidence: `src/features/osm/overpassService.ts`)
- Route service → Road graph builder: builds route graph (evidence: `src/features/routing/routeService.ts`)
- Route service → A* route engine: finds paths (evidence: `src/features/routing/routeService.ts`)
- Route service → Route instructions: generates maneuvers (evidence: `src/features/routing/routeService.ts`)
- Route service → Interactive map: displays route
- Interactive map → Map tiles: loads basemap
- Traveler → Device GPS: grants location
- Device GPS → Navigation runner: provides fixes
- Navigation runner → GPS trip tracking: updates trip metrics (evidence: `src/hooks/useNavigationRunner.ts`)
- Navigation runner → Route progress: advances guidance (evidence: `src/hooks/useNavigationRunner.ts`)
- Navigation runner → Navigation state: updates state (evidence: `src/hooks/useNavigationRunner.ts`)
- Navigation runner → Route orchestration: recalculates off-route
- Traveler → Theme gallery: chooses style
- Theme gallery → Map themes: selects theme
- Map themes → App preferences: resolves preference (evidence: `src/store/useAppStore.ts`)
- Traveler → Custom map editor: edits custom map
- Custom map editor → Custom map editor state: uses editor state
- Custom map editor state → Custom map service: delegates map data (evidence: `src/components/customMap/useCustomMapEditor.ts`)
- Custom map service → Geodata cache: persists maps (evidence: `src/features/customMap/customMapService.ts`)
