# ethannsie/ble-based-ips architecture

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

- Interactive diagram: https://gitdiagram.com/ethannsie/ble-based-ips
- Repository: https://github.com/ethannsie/ble-based-ips

## Overview

This repository is a BLE-based indoor positioning prototype: anchor devices collect RSSI observations, estimate distances, report measurements to a Flask service, and the service computes a position estimate for a web-facing client. Separate scripts support RSSI collection and calibration. The README documents no capabilities beyond the project identity, and several files are unsampled; the graph therefore shows only relationships supported by the available source, with the browser-to-API connection left out.

Main entry points: [`client/BLE-based-IPS/threadtests.py`](https://github.com/ethannsie/ble-based-ips/blob/main/client/BLE-based-IPS/threadtests.py) (RSSI distance reporter), [`flaskserver.py`](https://github.com/ethannsie/ble-based-ips/blob/main/flaskserver.py) (Position API), [`templates/index.html`](https://github.com/ethannsie/ble-based-ips/blob/main/templates/index.html) (Web page), [`client/BLE-based-IPS/calibration.py`](https://github.com/ethannsie/ble-based-ips/blob/main/client/BLE-based-IPS/calibration.py) (RSSI calibration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["BLE capture"]
  node_threaded["RSSI distance reporter<br/>[threadtests.py]"]
  node_inquiry["BLE inquiry"]
  node_collector["RSSI data collector<br/>[dataCollect.py]"]
  node_calibration["RSSI calibration<br/>[calibration.py]"]
end

subgraph group_positioning["Position service"]
  node_report["Report endpoint<br/>[flaskserver.py]"]
  node_rssi_state[("Received RSSI state<br/>[flaskserver.py]")]
  node_regression["Position regression<br/>[flaskserver.py]"]
  node_getdata["Position API<br/>[flaskserver.py]"]
end

subgraph group_visualization["Web interface"]
  node_page["Web page<br/>[index.html]"]
  node_renderer["WebGL renderer<br/>[webgl-demo.js]"]
end

node_anchors(("BLE anchors"))
node_monitor(("BLE monitor stream"))
node_browser(("Browser user"))
node_calibration_data["RSSI distance samples"]

node_monitor -->|"streams RSSI"| node_threaded
node_anchors -->|"supply readings"| node_threaded
node_threaded -->|"POSTs distances"| node_report
node_report -->|"stores readings"| node_rssi_state
node_getdata -->|"reads readings"| node_rssi_state
node_getdata -->|"requests estimate"| node_regression
node_browser -->|"opens page"| node_page
node_page -->|"loads script"| node_renderer
node_inquiry -->|"queries devices"| node_anchors
node_monitor -.->|"streams RSSI"| node_collector
node_monitor -.->|"streams RSSI"| node_calibration
node_calibration_data -.->|"informs calibration"| node_calibration

click node_threaded "https://github.com/ethannsie/ble-based-ips/blob/main/client/BLE-based-IPS/threadtests.py"
click node_inquiry "https://github.com/ethannsie/ble-based-ips/blob/main/inquiry-with-RSSI.py"
click node_collector "https://github.com/ethannsie/ble-based-ips/blob/main/dataCollect.py"
click node_calibration "https://github.com/ethannsie/ble-based-ips/blob/main/client/BLE-based-IPS/calibration.py"
click node_report "https://github.com/ethannsie/ble-based-ips/blob/main/flaskserver.py"
click node_rssi_state "https://github.com/ethannsie/ble-based-ips/blob/main/flaskserver.py"
click node_regression "https://github.com/ethannsie/ble-based-ips/blob/main/flaskserver.py"
click node_getdata "https://github.com/ethannsie/ble-based-ips/blob/main/flaskserver.py"
click node_page "https://github.com/ethannsie/ble-based-ips/blob/main/templates/index.html"
click node_renderer "https://github.com/ethannsie/ble-based-ips/blob/main/webgl-demo.js"
click node_calibration_data "https://github.com/ethannsie/ble-based-ips/tree/main/rssi_data_collection"

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_threaded,node_inquiry,node_collector,node_calibration,node_browser toneBlue
class node_report,node_rssi_state,node_regression,node_getdata toneAmber
class node_page,node_renderer toneMint
class node_anchors,node_monitor toneIndigo
class node_calibration_data toneTeal
```

## Components

### BLE capture

- [RSSI distance reporter](https://github.com/ethannsie/ble-based-ips/blob/main/client/BLE-based-IPS/threadtests.py): `client/BLE-based-IPS/threadtests.py`
- [BLE inquiry](https://github.com/ethannsie/ble-based-ips/blob/main/inquiry-with-RSSI.py): `inquiry-with-RSSI.py`
- [RSSI data collector](https://github.com/ethannsie/ble-based-ips/blob/main/dataCollect.py): `dataCollect.py`
- [RSSI calibration](https://github.com/ethannsie/ble-based-ips/blob/main/client/BLE-based-IPS/calibration.py): `client/BLE-based-IPS/calibration.py`

### Position service

- [Report endpoint](https://github.com/ethannsie/ble-based-ips/blob/main/flaskserver.py): `flaskserver.py`
- [Received RSSI state](https://github.com/ethannsie/ble-based-ips/blob/main/flaskserver.py): `flaskserver.py`
- [Position regression](https://github.com/ethannsie/ble-based-ips/blob/main/flaskserver.py): `flaskserver.py`
- [Position API](https://github.com/ethannsie/ble-based-ips/blob/main/flaskserver.py): `flaskserver.py`

### Web interface

- [Web page](https://github.com/ethannsie/ble-based-ips/blob/main/templates/index.html): `templates/index.html`
- [WebGL renderer](https://github.com/ethannsie/ble-based-ips/blob/main/webgl-demo.js): `webgl-demo.js`

### Other components

- **BLE anchors**
- **BLE monitor stream**
- **Browser user**
- [RSSI distance samples](https://github.com/ethannsie/ble-based-ips/tree/main/rssi_data_collection): `rssi_data_collection`

## Connections

- BLE monitor stream → RSSI distance reporter: streams RSSI
- BLE anchors → RSSI distance reporter: supply readings
- RSSI distance reporter → Report endpoint: POSTs distances
- Report endpoint → Received RSSI state: stores readings
- Position API → Received RSSI state: reads readings
- Position API → Position regression: requests estimate
- Browser user → Web page: opens page
- Web page → WebGL renderer: loads script
- BLE inquiry → BLE anchors: queries devices
- BLE monitor stream → RSSI data collector: streams RSSI
- BLE monitor stream → RSSI calibration: streams RSSI
- RSSI distance samples → RSSI calibration: informs calibration
