# znerox/wifimap architecture

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

- Interactive diagram: https://gitdiagram.com/znerox/wifimap
- Repository: https://github.com/znerox/wifimap

## Overview

WiFiMap is a self-hosted wireless-survey database and map: users filter and inspect captured networks, examine client relationships, and drill into location observations. The README also documents importing WiGLE captures and airodump-ng client data, plus a Bluetooth map. The graph reflects those documented branches, while source excerpts confirm the map/XML and client-enrichment flows; wiring for unsampled import and Bluetooth subsystems is therefore kept at the documented page/script level. Google Maps is an external rendering dependency.

Main entry points: [`wifimap/js/index.js`](https://github.com/znerox/wifimap/blob/master/wifimap/js/index.js) (Network map UI), [`wifimap/bluetooth/js/index.js`](https://github.com/znerox/wifimap/blob/master/wifimap/bluetooth/js/index.js) (Bluetooth map UI), [`wifimap/clients/js/index.js`](https://github.com/znerox/wifimap/blob/master/wifimap/clients/js/index.js) (Client map UI), [`wifimap/tools/index.html`](https://github.com/znerox/wifimap/blob/master/wifimap/tools/index.html) (Import and tools page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mapping["Maps and exploration"]
  node_network_page["Network map page<br/>[index.html]"]
  node_network_ui["Network map UI<br/>[index.js]"]
  node_network_query["Network XML query<br/>[genxml.php]"]
  node_bluetooth_page["Bluetooth page<br/>[index.html]"]
  node_bluetooth_ui["Bluetooth map UI<br/>[index.js]"]
  node_bluetooth_query["Bluetooth XML query<br/>[genxml.php]"]
  node_location_page["Precise location page<br/>[index.html]"]
  node_location_ui["Location map UI<br/>[index.js]"]
  node_location_query["Location XML query<br/>[genxml.php]"]
end

subgraph group_imports["Capture ingestion"]
  node_tools_page["Import and tools page<br/>[index.html]"]
  node_network_import["Network import<br/>[network_import.php]"]
  node_location_import["Location import"]
  node_client_import["Client import<br/>[client_import.php]"]
end

subgraph group_clients["Client analysis"]
  node_clients_page["Client map page<br/>[index.html]"]
  node_clients_ui["Client map UI<br/>[index.js]"]
  node_client_query["Client XML query"]
  node_network_client_query["Network XML query"]
  node_link_connected["Connected-client linking"]
  node_link_probing["Probed-client linking"]
end

subgraph group_operations["Data operations"]
  node_db[("Survey database")]
  node_vendor_tools["Vendor enrichment"]
end

node_user(("User"))
node_maps["Google Maps"]
node_wigle["WiGLE capture"]
node_aircrack["airodump-ng capture"]

node_user -->|"opens map"| node_network_page
node_network_page -->|"loads UI"| node_network_ui
node_network_ui -->|"requests filters"| node_network_query
node_network_query -->|"queries networks"| node_db
node_network_query -->|"returns XML"| node_network_ui
node_network_ui -->|"renders markers"| node_maps
node_network_ui -->|"opens location"| node_location_page
node_user -->|"opens Bluetooth"| node_bluetooth_page
node_bluetooth_page -->|"loads UI"| node_bluetooth_ui
node_bluetooth_ui -->|"requests filters"| node_bluetooth_query
node_bluetooth_query -->|"queries devices"| node_db
node_bluetooth_query -->|"returns XML"| node_bluetooth_ui
node_bluetooth_ui -->|"renders markers"| node_maps
node_bluetooth_ui -->|"opens location"| node_location_page
node_location_page -->|"loads UI"| node_location_ui
node_location_ui -->|"requests observations"| node_location_query
node_location_query -->|"queries locations"| node_db
node_location_query -->|"returns XML"| node_location_ui
node_location_ui -->|"renders positions"| node_maps
node_user -->|"opens tools"| node_tools_page
node_wigle -->|"supplies capture"| node_network_import
node_wigle -->|"supplies capture"| node_location_import
node_aircrack -->|"supplies capture"| node_client_import
node_tools_page -->|"submits import"| node_network_import
node_tools_page -->|"submits import"| node_location_import
node_tools_page -->|"submits import"| node_client_import
node_network_import -->|"writes networks"| node_db
node_location_import -->|"writes locations"| node_db
node_client_import -->|"writes clients"| node_db
node_user -->|"opens clients"| node_clients_page
node_clients_page -->|"loads UI"| node_clients_ui
node_clients_ui -->|"requests client"| node_client_query
node_client_query -->|"queries clients"| node_db
node_client_query -->|"returns XML"| node_clients_ui
node_clients_ui -->|"requests networks"| node_network_client_query
node_network_client_query -->|"queries networks"| node_db
node_network_client_query -->|"returns XML"| node_clients_ui
node_link_connected -->|"reads and updates"| node_db
node_link_probing -->|"reads and updates"| node_db
node_vendor_tools -->|"updates vendors"| node_db

click node_network_page "https://github.com/znerox/wifimap/blob/master/wifimap/index.html"
click node_network_ui "https://github.com/znerox/wifimap/blob/master/wifimap/js/index.js"
click node_network_query "https://github.com/znerox/wifimap/blob/master/wifimap/php/genxml.php"
click node_bluetooth_page "https://github.com/znerox/wifimap/blob/master/wifimap/bluetooth/index.html"
click node_bluetooth_ui "https://github.com/znerox/wifimap/blob/master/wifimap/bluetooth/js/index.js"
click node_bluetooth_query "https://github.com/znerox/wifimap/blob/master/wifimap/bluetooth/php/genxml.php"
click node_location_page "https://github.com/znerox/wifimap/blob/master/wifimap/location/index.html"
click node_location_ui "https://github.com/znerox/wifimap/blob/master/wifimap/location/js/index.js"
click node_location_query "https://github.com/znerox/wifimap/blob/master/wifimap/location/php/genxml.php"
click node_tools_page "https://github.com/znerox/wifimap/blob/master/wifimap/tools/index.html"
click node_network_import "https://github.com/znerox/wifimap/blob/master/wifimap/tools/php/network_import.php"
click node_location_import "https://github.com/znerox/wifimap/blob/master/wifimap/tools/php/location_import.php"
click node_client_import "https://github.com/znerox/wifimap/blob/master/wifimap/tools/php/client_import.php"
click node_clients_page "https://github.com/znerox/wifimap/blob/master/wifimap/clients/index.html"
click node_clients_ui "https://github.com/znerox/wifimap/blob/master/wifimap/clients/js/index.js"
click node_client_query "https://github.com/znerox/wifimap/blob/master/wifimap/clients/php/genxml_clientdata.php"
click node_network_client_query "https://github.com/znerox/wifimap/blob/master/wifimap/clients/php/genxml_networkdata.php"
click node_link_connected "https://github.com/znerox/wifimap/blob/master/wifimap/tools/php/set_connected_clients_in_network.php"
click node_link_probing "https://github.com/znerox/wifimap/blob/master/wifimap/tools/php/set_probing_clients_in_network.php"
click node_vendor_tools "https://github.com/znerox/wifimap/blob/master/wifimap/tools/php/client_mac_lookup_from_file.php"

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_network_page,node_network_ui,node_network_query,node_bluetooth_page,node_bluetooth_ui,node_bluetooth_query,node_location_page,node_location_ui,node_location_query,node_user toneBlue
class node_tools_page,node_network_import,node_location_import,node_client_import toneAmber
class node_clients_page,node_clients_ui,node_client_query,node_network_client_query,node_link_connected,node_link_probing toneMint
class node_db,node_vendor_tools toneRose
class node_maps,node_wigle,node_aircrack toneIndigo
```

## Components

### Maps and exploration

- [Network map page](https://github.com/znerox/wifimap/blob/master/wifimap/index.html): `wifimap/index.html`
- [Network map UI](https://github.com/znerox/wifimap/blob/master/wifimap/js/index.js): `wifimap/js/index.js`
- [Network XML query](https://github.com/znerox/wifimap/blob/master/wifimap/php/genxml.php): `wifimap/php/genxml.php`
- [Bluetooth page](https://github.com/znerox/wifimap/blob/master/wifimap/bluetooth/index.html): `wifimap/bluetooth/index.html`
- [Bluetooth map UI](https://github.com/znerox/wifimap/blob/master/wifimap/bluetooth/js/index.js): `wifimap/bluetooth/js/index.js`
- [Bluetooth XML query](https://github.com/znerox/wifimap/blob/master/wifimap/bluetooth/php/genxml.php): `wifimap/bluetooth/php/genxml.php`
- [Precise location page](https://github.com/znerox/wifimap/blob/master/wifimap/location/index.html): `wifimap/location/index.html`
- [Location map UI](https://github.com/znerox/wifimap/blob/master/wifimap/location/js/index.js): `wifimap/location/js/index.js`
- [Location XML query](https://github.com/znerox/wifimap/blob/master/wifimap/location/php/genxml.php): `wifimap/location/php/genxml.php`

### Capture ingestion

- [Import and tools page](https://github.com/znerox/wifimap/blob/master/wifimap/tools/index.html): `wifimap/tools/index.html`
- [Network import](https://github.com/znerox/wifimap/blob/master/wifimap/tools/php/network_import.php): `wifimap/tools/php/network_import.php`
- [Location import](https://github.com/znerox/wifimap/blob/master/wifimap/tools/php/location_import.php): `wifimap/tools/php/location_import.php`
- [Client import](https://github.com/znerox/wifimap/blob/master/wifimap/tools/php/client_import.php): `wifimap/tools/php/client_import.php`

### Client analysis

- [Client map page](https://github.com/znerox/wifimap/blob/master/wifimap/clients/index.html): `wifimap/clients/index.html`
- [Client map UI](https://github.com/znerox/wifimap/blob/master/wifimap/clients/js/index.js): `wifimap/clients/js/index.js`
- [Client XML query](https://github.com/znerox/wifimap/blob/master/wifimap/clients/php/genxml_clientdata.php): `wifimap/clients/php/genxml_clientdata.php`
- [Network XML query](https://github.com/znerox/wifimap/blob/master/wifimap/clients/php/genxml_networkdata.php): `wifimap/clients/php/genxml_networkdata.php`
- [Connected-client linking](https://github.com/znerox/wifimap/blob/master/wifimap/tools/php/set_connected_clients_in_network.php): `wifimap/tools/php/set_connected_clients_in_network.php`
- [Probed-client linking](https://github.com/znerox/wifimap/blob/master/wifimap/tools/php/set_probing_clients_in_network.php): `wifimap/tools/php/set_probing_clients_in_network.php`

### Data operations

- **Survey database**
- [Vendor enrichment](https://github.com/znerox/wifimap/blob/master/wifimap/tools/php/client_mac_lookup_from_file.php): `wifimap/tools/php/client_mac_lookup_from_file.php`

### Other components

- **User**
- **Google Maps**
- **WiGLE capture**
- **airodump-ng capture**

## Connections

- User → Network map page: opens map
- Network map page → Network map UI: loads UI
- Network map UI → Network XML query: requests filters
- Network XML query → Survey database: queries networks
- Network XML query → Network map UI: returns XML
- Network map UI → Google Maps: renders markers
- Network map UI → Precise location page: opens location
- User → Bluetooth page: opens Bluetooth
- Bluetooth page → Bluetooth map UI: loads UI
- Bluetooth map UI → Bluetooth XML query: requests filters
- Bluetooth XML query → Survey database: queries devices
- Bluetooth XML query → Bluetooth map UI: returns XML
- Bluetooth map UI → Google Maps: renders markers
- Bluetooth map UI → Precise location page: opens location
- Precise location page → Location map UI: loads UI
- Location map UI → Location XML query: requests observations
- Location XML query → Survey database: queries locations
- Location XML query → Location map UI: returns XML
- Location map UI → Google Maps: renders positions
- User → Import and tools page: opens tools
- WiGLE capture → Network import: supplies capture
- WiGLE capture → Location import: supplies capture
- airodump-ng capture → Client import: supplies capture
- Import and tools page → Network import: submits import
- Import and tools page → Location import: submits import
- Import and tools page → Client import: submits import
- Network import → Survey database: writes networks
- Location import → Survey database: writes locations
- Client import → Survey database: writes clients
- User → Client map page: opens clients
- Client map page → Client map UI: loads UI
- Client map UI → Client XML query: requests client
- Client XML query → Survey database: queries clients
- Client XML query → Client map UI: returns XML
- Client map UI → Network XML query: requests networks
- Network XML query → Survey database: queries networks
- Network XML query → Client map UI: returns XML
- Connected-client linking → Survey database: reads and updates
- Probed-client linking → Survey database: reads and updates
- Vendor enrichment → Survey database: updates vendors
