# notbot999/fap-map architecture

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

- Interactive diagram: https://gitdiagram.com/notbot999/fap-map
- Repository: https://github.com/notbot999/fap-map

## Overview

Franc Map Desktop is an offline-capable Slovenia GIS explorer. The user opens the map, selects layers or searches for locations, and can then route, inspect POIs, draw or import features, record tracks, and view elevation profiles. The desktop app serves the web interface locally; the shared API/backend path handles requests and caches map and query data for offline use. The README documents several capabilities whose implementation was not sampled, so those are represented without inferred internal call chains.

Main entry points: [`web/js/api.js`](https://github.com/notbot999/fap-map/blob/main/web/js/api.js) (API adapter), [`web/js/map.js`](https://github.com/notbot999/fap-map/blob/main/web/js/map.js) (Map rendering), [`web/js/panels/route.js`](https://github.com/notbot999/fap-map/blob/main/web/js/panels/route.js) (Route planner), [`web/js/search.js`](https://github.com/notbot999/fap-map/blob/main/web/js/search.js) (Location search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["App runtime"]
  node_desktop["Desktop host<br/>[app.py]"]
  node_ui["Interface bootstrap<br/>[main.js]"]
  node_state["Settings and state<br/>[state.js]"]
end

subgraph group_mapping["Map and layers"]
  node_map["Map rendering<br/>[map.js]"]
  node_layerpanel["Layer controls<br/>[layers.js]"]
  node_compare["Layer comparison<br/>[compare.js]"]
end

subgraph group_explore["Explore and analyze"]
  node_search["Location search<br/>[search.js]"]
  node_poi["POI browser<br/>[poi.js]"]
  node_popup["Feature details<br/>[popup.js]"]
  node_special["Weather and map info<br/>[special.js]"]
  node_route["Route planner<br/>[route.js]"]
  node_profile["Elevation profiles<br/>[profile.js]"]
end

subgraph group_fieldwork["Create and record"]
  node_draw["Drawings and measures<br/>[draw.js]"]
  node_tracks["Track library and GPS<br/>[tracks.js]"]
  node_geoio["Geospatial file exchange<br/>[geoio.js]"]
  node_offline["Offline area manager<br/>[offline.js]"]
end

subgraph group_storage["Persistence and services"]
  node_api["API adapter<br/>[api.js]"]
  node_backend["Web backend<br/>[webbackend.js]"]
  node_cache[("Local cache and data<br/>[app.py]")]
end

node_user(("Map user"))
node_brouter{{"BRouter"}}
node_nominatim{{"Nominatim"}}
node_overpass{{"Overpass API"}}

node_user -->|"uses"| node_ui
node_ui -->|"initializes"| node_map
node_ui -->|"loads"| node_state
node_map -->|"requests tiles"| node_api
node_map -->|"gets tile URLs"| node_backend
node_layerpanel -->|"controls layers"| node_map
node_compare -->|"compares layers"| node_map
node_state -->|"loads and saves"| node_api
node_api -->|"delegates web calls"| node_backend
node_desktop -->|"stores requests"| node_cache
node_api -->|"uses local service"| node_cache
node_search -->|"geocodes via"| node_api
node_search -->|"searches loaded features"| node_poi
node_search -->|"shows result"| node_popup
node_search -->|"queries"| node_nominatim
node_poi -->|"fetches category data"| node_overpass
node_poi -->|"renders features"| node_map
node_special -->|"fetches map info"| node_api
node_route -->|"requests route"| node_api
node_route -->|"requests route geometry"| node_brouter
node_route -->|"draws route"| node_map
node_route -->|"opens profile"| node_profile
node_route -->|"saves as drawing"| node_draw
node_profile -->|"looks up elevation"| node_api
node_draw -->|"renders and edits"| node_map
node_draw -->|"imports and exports"| node_geoio
node_draw -->|"persists features"| node_api
node_tracks -->|"renders tracks"| node_map
node_tracks -->|"imports and exports"| node_geoio
node_tracks -->|"calculates track stats"| node_profile
node_tracks -->|"persists tracks"| node_api
node_offline -->|"downloads map data"| node_api
node_user -->|"launches"| node_desktop

click node_desktop "https://github.com/notbot999/fap-map/blob/main/app.py"
click node_ui "https://github.com/notbot999/fap-map/blob/main/web/js/main.js"
click node_map "https://github.com/notbot999/fap-map/blob/main/web/js/map.js"
click node_layerpanel "https://github.com/notbot999/fap-map/blob/main/web/js/panels/layers.js"
click node_compare "https://github.com/notbot999/fap-map/blob/main/web/js/panels/compare.js"
click node_state "https://github.com/notbot999/fap-map/blob/main/web/js/state.js"
click node_api "https://github.com/notbot999/fap-map/blob/main/web/js/api.js"
click node_backend "https://github.com/notbot999/fap-map/blob/main/web/js/webbackend.js"
click node_cache "https://github.com/notbot999/fap-map/blob/main/app.py"
click node_search "https://github.com/notbot999/fap-map/blob/main/web/js/search.js"
click node_poi "https://github.com/notbot999/fap-map/blob/main/web/js/panels/poi.js"
click node_popup "https://github.com/notbot999/fap-map/blob/main/web/js/popup.js"
click node_special "https://github.com/notbot999/fap-map/blob/main/web/js/special.js"
click node_route "https://github.com/notbot999/fap-map/blob/main/web/js/panels/route.js"
click node_profile "https://github.com/notbot999/fap-map/blob/main/web/js/profile.js"
click node_draw "https://github.com/notbot999/fap-map/blob/main/web/js/panels/draw.js"
click node_tracks "https://github.com/notbot999/fap-map/blob/main/web/js/panels/tracks.js"
click node_geoio "https://github.com/notbot999/fap-map/blob/main/web/js/geoio.js"
click node_offline "https://github.com/notbot999/fap-map/blob/main/web/js/panels/offline.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_desktop,node_ui,node_state,node_user toneBlue
class node_map,node_layerpanel,node_compare toneAmber
class node_search,node_poi,node_popup,node_special,node_route,node_profile,node_brouter,node_overpass toneMint
class node_draw,node_tracks,node_geoio,node_offline toneRose
class node_api,node_backend,node_cache,node_nominatim toneIndigo
```

## Components

### App runtime

- [Desktop host](https://github.com/notbot999/fap-map/blob/main/app.py): `app.py`
- [Interface bootstrap](https://github.com/notbot999/fap-map/blob/main/web/js/main.js): `web/js/main.js`
- [Settings and state](https://github.com/notbot999/fap-map/blob/main/web/js/state.js): `web/js/state.js`

### Map and layers

- [Map rendering](https://github.com/notbot999/fap-map/blob/main/web/js/map.js): `web/js/map.js`
- [Layer controls](https://github.com/notbot999/fap-map/blob/main/web/js/panels/layers.js): `web/js/panels/layers.js`
- [Layer comparison](https://github.com/notbot999/fap-map/blob/main/web/js/panels/compare.js): `web/js/panels/compare.js`

### Explore and analyze

- [Location search](https://github.com/notbot999/fap-map/blob/main/web/js/search.js): `web/js/search.js`
- [POI browser](https://github.com/notbot999/fap-map/blob/main/web/js/panels/poi.js): `web/js/panels/poi.js`
- [Feature details](https://github.com/notbot999/fap-map/blob/main/web/js/popup.js): `web/js/popup.js`
- [Weather and map info](https://github.com/notbot999/fap-map/blob/main/web/js/special.js): `web/js/special.js`
- [Route planner](https://github.com/notbot999/fap-map/blob/main/web/js/panels/route.js): `web/js/panels/route.js`
- [Elevation profiles](https://github.com/notbot999/fap-map/blob/main/web/js/profile.js): `web/js/profile.js`

### Create and record

- [Drawings and measures](https://github.com/notbot999/fap-map/blob/main/web/js/panels/draw.js): `web/js/panels/draw.js`
- [Track library and GPS](https://github.com/notbot999/fap-map/blob/main/web/js/panels/tracks.js): `web/js/panels/tracks.js`
- [Geospatial file exchange](https://github.com/notbot999/fap-map/blob/main/web/js/geoio.js): `web/js/geoio.js`
- [Offline area manager](https://github.com/notbot999/fap-map/blob/main/web/js/panels/offline.js): `web/js/panels/offline.js`

### Persistence and services

- [API adapter](https://github.com/notbot999/fap-map/blob/main/web/js/api.js): `web/js/api.js`
- [Web backend](https://github.com/notbot999/fap-map/blob/main/web/js/webbackend.js): `web/js/webbackend.js`
- [Local cache and data](https://github.com/notbot999/fap-map/blob/main/app.py): `app.py`

### Other components

- **Map user**
- **BRouter**
- **Nominatim**
- **Overpass API**

## Connections

- Map user → Interface bootstrap: uses (evidence: `README.md`)
- Interface bootstrap → Map rendering: initializes (evidence: `web/js/main.js`)
- Interface bootstrap → Settings and state: loads (evidence: `web/js/main.js`)
- Map rendering → API adapter: requests tiles (evidence: `web/js/map.js`)
- Map rendering → Web backend: gets tile URLs (evidence: `web/js/map.js`)
- Layer controls → Map rendering: controls layers (evidence: `web/js/panels/layers.js`)
- Layer comparison → Map rendering: compares layers (evidence: `web/js/panels/compare.js`)
- Settings and state → API adapter: loads and saves (evidence: `web/js/state.js`)
- API adapter → Web backend: delegates web calls (evidence: `web/js/api.js`)
- Desktop host → Local cache and data: stores requests (evidence: `README.md`)
- API adapter → Local cache and data: uses local service (evidence: `README.md`)
- Location search → API adapter: geocodes via (evidence: `web/js/search.js`)
- Location search → POI browser: searches loaded features (evidence: `web/js/search.js`)
- Location search → Feature details: shows result (evidence: `web/js/search.js`)
- Location search → Nominatim: queries (evidence: `web/js/search.js`)
- POI browser → Overpass API: fetches category data (evidence: `web/js/panels/poi.js`)
- POI browser → Map rendering: renders features (evidence: `web/js/panels/poi.js`)
- Weather and map info → API adapter: fetches map info (evidence: `web/js/special.js`)
- Route planner → API adapter: requests route (evidence: `web/js/panels/route.js`)
- Route planner → BRouter: requests route geometry (evidence: `web/js/panels/route.js`)
- Route planner → Map rendering: draws route (evidence: `web/js/panels/route.js`)
- Route planner → Elevation profiles: opens profile (evidence: `web/js/panels/route.js`)
- Route planner → Drawings and measures: saves as drawing (evidence: `web/js/panels/route.js`)
- Elevation profiles → API adapter: looks up elevation (evidence: `web/js/profile.js`)
- Drawings and measures → Map rendering: renders and edits (evidence: `web/js/panels/draw.js`)
- Drawings and measures → Geospatial file exchange: imports and exports (evidence: `web/js/panels/draw.js`)
- Drawings and measures → API adapter: persists features (evidence: `web/js/panels/draw.js`)
- Track library and GPS → Map rendering: renders tracks (evidence: `web/js/panels/tracks.js`)
- Track library and GPS → Geospatial file exchange: imports and exports (evidence: `web/js/panels/tracks.js`)
- Track library and GPS → Elevation profiles: calculates track stats (evidence: `web/js/panels/tracks.js`)
- Track library and GPS → API adapter: persists tracks (evidence: `web/js/panels/tracks.js`)
- Offline area manager → API adapter: downloads map data (evidence: `README.md`)
- Map user → Desktop host: launches (evidence: `README.md`)
