# dhruvhex/lorawan_gps_tracking architecture

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

- Interactive diagram: https://gitdiagram.com/dhruvhex/lorawan_gps_tracking
- Repository: https://github.com/dhruvhex/lorawan_gps_tracking

## Overview

Vajr Signals is a Django-based LoRaWAN GPS monitoring application. The documented workflow is that TeraTerm telemetry is parsed into device records, which users can explore on an interactive map, filter by device and time, and use to monitor SOS alerts. Device visibility and marker colors are configurable; email/password login gates the map. The sampled views and models support ingestion, query, configuration, and alert responsibilities. README-described UI/API wiring is not fully shown in the excerpts, so those links are marked unverified rather than asserted as direct calls.

Main entry points: [`templates/map.html`](https://github.com/dhruvhex/lorawan_gps_tracking/blob/main/templates/map.html) (Map Dashboard), [`GPS_App/urls.py`](https://github.com/dhruvhex/lorawan_gps_tracking/blob/main/GPS_App/urls.py) (App Routes), [`GPS_App/models.py`](https://github.com/dhruvhex/lorawan_gps_tracking/blob/main/GPS_App/models.py) (GPS Records), [`GPS_App/login.py`](https://github.com/dhruvhex/lorawan_gps_tracking/blob/main/GPS_App/login.py) (Email Login)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and Routing"]
  node_routes["App Routes<br/>[urls.py]"]
  node_authentication["Email Login<br/>[login.py]"]
  node_profile_context["User Context"]
end

subgraph group_telemetry["Telemetry and Storage"]
  node_ingestion["Log Ingestion<br/>[views.py]"]
  node_gps_records["GPS Records<br/>[models.py]"]
  node_device_settings["Device Settings<br/>[models.py]"]
  node_accounts["User Accounts<br/>[models.py]"]
end

subgraph group_monitoring["Monitoring Features"]
  node_location_api["Location Queries<br/>[views.py]"]
  node_device_api["Device Configuration API<br/>[views.py]"]
  node_sos_api["SOS Alerts API<br/>[views.py]"]
end

subgraph group_presentation["Map Presentation"]
  node_dashboard["Map Dashboard<br/>[map.html]"]
  node_leaflet["Leaflet Mapping<br/>[leaflet.js]"]
  node_polyline["Path Decoration"]
  node_alarm_audio["SOS Audio"]
end

node_operator(("Field Operator"))
node_teraterm["TeraTerm Logs"]
node_mysql[("MySQL Database")]

node_operator -.->|"uses"| node_routes
node_routes -->|"routes login"| node_authentication
node_routes -->|"routes queries"| node_location_api
node_routes -->|"routes settings"| node_device_api
node_routes -->|"routes alerts"| node_sos_api
node_authentication -->|"checks credentials"| node_accounts
node_authentication -->|"redirects after login"| node_dashboard
node_dashboard -.->|"receives context"| node_profile_context
node_teraterm -.->|"provides telemetry"| node_ingestion
node_ingestion -.->|"stores packets"| node_gps_records
node_location_api -->|"queries locations"| node_gps_records
node_device_api -->|"reads and updates"| node_device_settings
node_sos_api -->|"queries SOS records"| node_gps_records
node_gps_records -.->|"persists records"| node_mysql
node_device_settings -.->|"persists settings"| node_mysql
node_accounts -.->|"persists accounts"| node_mysql
node_dashboard -.->|"requests locations"| node_location_api
node_dashboard -.->|"configures devices"| node_device_api
node_dashboard -.->|"shows SOS alerts"| node_sos_api
node_dashboard -.->|"renders map"| node_leaflet
node_dashboard -.->|"decorates paths"| node_polyline
node_dashboard -.->|"plays alert"| node_alarm_audio

click node_routes "https://github.com/dhruvhex/lorawan_gps_tracking/blob/main/GPS_App/urls.py"
click node_authentication "https://github.com/dhruvhex/lorawan_gps_tracking/blob/main/GPS_App/login.py"
click node_profile_context "https://github.com/dhruvhex/lorawan_gps_tracking/blob/main/GPS_App/context_processors.py"
click node_ingestion "https://github.com/dhruvhex/lorawan_gps_tracking/blob/main/GPS_App/views.py"
click node_gps_records "https://github.com/dhruvhex/lorawan_gps_tracking/blob/main/GPS_App/models.py"
click node_device_settings "https://github.com/dhruvhex/lorawan_gps_tracking/blob/main/GPS_App/models.py"
click node_accounts "https://github.com/dhruvhex/lorawan_gps_tracking/blob/main/GPS_App/models.py"
click node_location_api "https://github.com/dhruvhex/lorawan_gps_tracking/blob/main/GPS_App/views.py"
click node_device_api "https://github.com/dhruvhex/lorawan_gps_tracking/blob/main/GPS_App/views.py"
click node_sos_api "https://github.com/dhruvhex/lorawan_gps_tracking/blob/main/GPS_App/views.py"
click node_dashboard "https://github.com/dhruvhex/lorawan_gps_tracking/blob/main/templates/map.html"
click node_leaflet "https://github.com/dhruvhex/lorawan_gps_tracking/blob/main/static/js/leaflet.js"
click node_polyline "https://github.com/dhruvhex/lorawan_gps_tracking/blob/main/static/js/leaflet.polylineDecorator.js"
click node_alarm_audio "https://github.com/dhruvhex/lorawan_gps_tracking/blob/main/static/audio/emergency-alarm-69780.mp3"

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_routes,node_authentication,node_profile_context toneBlue
class node_ingestion,node_gps_records,node_device_settings,node_accounts,node_mysql toneAmber
class node_location_api,node_device_api,node_sos_api toneMint
class node_dashboard,node_leaflet,node_polyline,node_alarm_audio toneRose
class node_operator,node_teraterm toneIndigo
```

## Components

### Access and Routing

- [App Routes](https://github.com/dhruvhex/lorawan_gps_tracking/blob/main/GPS_App/urls.py): `GPS_App/urls.py`
- [Email Login](https://github.com/dhruvhex/lorawan_gps_tracking/blob/main/GPS_App/login.py): `GPS_App/login.py`
- [User Context](https://github.com/dhruvhex/lorawan_gps_tracking/blob/main/GPS_App/context_processors.py): `GPS_App/context_processors.py`

### Telemetry and Storage

- [Log Ingestion](https://github.com/dhruvhex/lorawan_gps_tracking/blob/main/GPS_App/views.py): `GPS_App/views.py`
- [GPS Records](https://github.com/dhruvhex/lorawan_gps_tracking/blob/main/GPS_App/models.py): `GPS_App/models.py`
- [Device Settings](https://github.com/dhruvhex/lorawan_gps_tracking/blob/main/GPS_App/models.py): `GPS_App/models.py`
- [User Accounts](https://github.com/dhruvhex/lorawan_gps_tracking/blob/main/GPS_App/models.py): `GPS_App/models.py`

### Monitoring Features

- [Location Queries](https://github.com/dhruvhex/lorawan_gps_tracking/blob/main/GPS_App/views.py): `GPS_App/views.py`
- [Device Configuration API](https://github.com/dhruvhex/lorawan_gps_tracking/blob/main/GPS_App/views.py): `GPS_App/views.py`
- [SOS Alerts API](https://github.com/dhruvhex/lorawan_gps_tracking/blob/main/GPS_App/views.py): `GPS_App/views.py`

### Map Presentation

- [Map Dashboard](https://github.com/dhruvhex/lorawan_gps_tracking/blob/main/templates/map.html): `templates/map.html`
- [Leaflet Mapping](https://github.com/dhruvhex/lorawan_gps_tracking/blob/main/static/js/leaflet.js): `static/js/leaflet.js`
- [Path Decoration](https://github.com/dhruvhex/lorawan_gps_tracking/blob/main/static/js/leaflet.polylineDecorator.js): `static/js/leaflet.polylineDecorator.js`
- [SOS Audio](https://github.com/dhruvhex/lorawan_gps_tracking/blob/main/static/audio/emergency-alarm-69780.mp3): `static/audio/emergency-alarm-69780.mp3`

### Other components

- **Field Operator**
- **TeraTerm Logs**
- **MySQL Database**

## Connections

- Field Operator → App Routes: uses
- App Routes → Email Login: routes login (evidence: `GPS_App/urls.py`)
- App Routes → Location Queries: routes queries (evidence: `GPS_App/urls.py`)
- App Routes → Device Configuration API: routes settings (evidence: `GPS_App/urls.py`)
- App Routes → SOS Alerts API: routes alerts (evidence: `GPS_App/urls.py`)
- Email Login → User Accounts: checks credentials (evidence: `GPS_App/login.py`)
- Email Login → Map Dashboard: redirects after login (evidence: `GPS_App/login.py`)
- Map Dashboard → User Context: receives context
- TeraTerm Logs → Log Ingestion: provides telemetry (evidence: `README.md`)
- Log Ingestion → GPS Records: stores packets (evidence: `README.md`)
- Location Queries → GPS Records: queries locations (evidence: `GPS_App/views.py`)
- Device Configuration API → Device Settings: reads and updates (evidence: `GPS_App/views.py`)
- SOS Alerts API → GPS Records: queries SOS records (evidence: `GPS_App/views.py`)
- GPS Records → MySQL Database: persists records
- Device Settings → MySQL Database: persists settings
- User Accounts → MySQL Database: persists accounts
- Map Dashboard → Location Queries: requests locations (evidence: `README.md`)
- Map Dashboard → Device Configuration API: configures devices (evidence: `README.md`)
- Map Dashboard → SOS Alerts API: shows SOS alerts (evidence: `README.md`)
- Map Dashboard → Leaflet Mapping: renders map (evidence: `README.md`)
- Map Dashboard → Path Decoration: decorates paths
- Map Dashboard → SOS Audio: plays alert (evidence: `README.md`)
