Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Elevation Data Configuration
#
# Option 1: Use public OpenTopoData (default, 1000 requests/day)
# Just leave these commented out or blank
#
# Option 2: Use a custom OpenTopoData instance (self-hosted or paid)
# ELEVATION_API_URL=http://your-opentopodata-instance:5000
# ELEVATION_DATASET=srtm30m
#
# Available datasets on public API: srtm30m, srtm90m, aster30m, etopo1, ned10m
# See: https://www.opentopodata.org/datasets/
20 changes: 16 additions & 4 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: Docker

on:
push:
branches: ["main"]
branches: ["dev"]
tags: ["v*.*.*"]
pull_request:
branches: ["main"]
branches: ["dev"]

env:
REGISTRY: ghcr.io
Expand All @@ -18,6 +18,17 @@ jobs:
contents: read
packages: write

strategy:
fail-fast: false
matrix:
include:
- context: .
image-suffix: ""
dockerfile: Dockerfile
- context: ./rf-engine
image-suffix: "-rf-engine"
dockerfile: ./rf-engine/Dockerfile

steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -34,7 +45,7 @@ jobs:
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}${{ matrix.image-suffix }}
tags: |
type=ref,event=branch
type=ref,event=tag
Expand All @@ -43,7 +54,8 @@ jobs:
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
context: ${{ matrix.context }}
file: ${{ matrix.dockerfile }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
80 changes: 61 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ A professional-grade RF propagation and link analysis tool designed for LoRa Mes
- **WISP-Grade Quality**: Evaluates links using the strict **60% Fresnel Zone Clearance** rule (Excellent/Good/Marginal/Obstructed).
- **Multi-Variable Profile**: Visualizes Terrain, Earth Curvature, Line of Sight (LOS), and Fresnel Zones on a dynamic 2D chart.
- **Clutter Awareness**: Simulates signal loss through trees or urban "clutter" layers.
- **Smart Updates**: Analysis only triggers when both TX and RX points are placed, minimizing unnecessary API calls.

### πŸ“ Smart Location Optimization ⚠️ _In Development_

- **Area Search**: Draw a bounding box on the map to automatically scan for optimal node placement.
- **Heatmap Scoring**: Analyzes terrain and line-of-sight to suggest the best locations based on RF coverage. (Powered by the **RF Engine** background worker).
- _Note: This feature is currently in active development and may have incomplete functionality._

### ⚑ Batch Operations

Expand All @@ -24,6 +31,13 @@ A professional-grade RF propagation and link analysis tool designed for LoRa Mes
- **Radio Config**: Adjust Spreading Factor (SF), Bandwidth (BW), and Coding Rate (CR) to simulate real-world LoRa modulation (LongFast, ShortFast).
- **Antenna Modeling**: Select standard antennas (Stubby, Dipole, Yagi) or input custom gain figures.

### πŸ”­ Viewshed Analysis ⚠️ _In Development_

- **WebGL-Powered Visualization**: Real-time viewshed overlay showing visible terrain from observer point.
- **Dynamic Calculation**: Interactive observer placement with instant terrain visibility analysis.
- **Red/Green Overlay**: Visual indication of obstructed (red) vs. visible (green) terrain areas.
- _Note: This feature is currently in active development and may have incomplete functionality._

### 🎨 Modern Experience

- **Responsive UI**: "Glassmorphism" design with a collapsible sidebar and mobile-friendly drawer navigation.
Expand All @@ -40,29 +54,40 @@ A professional-grade RF propagation and link analysis tool designed for LoRa Mes

### 🐳 Running with Docker (Recommended)

1. **Pull and Run**:
The system is designed as a set of microservices (Frontend, API, Worker, Redis). The easiest way to run it is with Docker Compose.

1. **Clone and Run**:

```bash
docker run -d -p 5173:5173 ghcr.io/d3mocide/meshrf:latest
git clone https://github.com/d3mocide/meshrf.git
cd meshrf
docker compose up --build
```

2. **Custom Configuration (Docker Compose)**:
You can configure the default map location and elevation source via environment variables.
2. **Access the App**:

- Frontend: `http://localhost:5173`
- RF Engine API: `http://localhost:5001/docs` (Swagger UI)

3. **Elevation Data Configuration** (Optional):

The application uses [OpenTopoData](https://www.opentopodata.org/) for elevation tiles. By default, it uses the public API (1000 requests/day). For unlimited access, you can:

- Use a custom OpenTopoData instance
- Self-host OpenTopoData with local SRTM data

Configure via environment variables in `docker-compose.yml`:

```yaml
services:
app:
image: ghcr.io/d3mocide/meshrf:latest
ports:
- "5173:5173"
environment:
- VITE_MAP_LAT=45.5152 # Default Latitude (Portland, OR)
- VITE_MAP_LNG=-122.6784 # Default Longitude
- VITE_ELEVATION_API_URL=https://api.open-meteo.com/v1/elevation
- ALLOWED_HOSTS=my-meshrf.com # For reverse proxies
rf-engine:
environment:
- ELEVATION_API_URL=${ELEVATION_API_URL:-https://api.opentopodata.org}
- ELEVATION_DATASET=${ELEVATION_DATASET:-srtm30m}
```

3. Open `http://localhost:5173` in your browser.
Available datasets: `srtm30m`, `srtm90m`, `aster30m`, `ned10m` (US only)

See the [.env.example](file:///.env.example) file for more configuration options.

### πŸ’» Running Locally (Development)

Expand All @@ -80,10 +105,18 @@ A professional-grade RF propagation and link analysis tool designed for LoRa Mes
```

3. Start the dev server:

```bash
npm run dev
```

4. **Backend Setup (Required for Analysis)**:
The frontend requires the Python backend to perform calculations. You can run the backend via Docker while developing the frontend locally:

```bash
docker compose up rf-engine rf-worker redis
```

---

## πŸ“ Usage Guide
Expand All @@ -100,14 +133,23 @@ A professional-grade RF propagation and link analysis tool designed for LoRa Mes

---

## πŸ—οΈ Project Structure
## πŸ—οΈ Architecture

The project follows a modern microservices pattern:

- **Frontend (`src/`)**: React + Leaflet + Vite. Handles UI, map interactions, and visualizes results.
- **RF Engine (`rf-engine/server.py`)**: Python FastAPI service. Performs geodetic calculations and API endpoints.
- **RF Worker (`rf-engine/rf_worker.py`)**: Celery worker consuming tasks from Redis. Handles heavy batch processing and optimization jobs.
- **Redis**: Message broker and caching layer.

### Directory Structure

- `src/components`: UI components (Map, Sidebar, Charts).
- `src/context`: Global RF state and batch processing logic.
- `src/utils`:
- `rfMath.js`: Core physics engine (Geodetic calc, Fresnel, Path Loss).
- `elevation.js`: DEM data fetching and processing.
- `src/data`: Hardware definition libraries.
- `rfMath.js`: Frontend utils for quick estimates.
- `rfService.js`: API client for the **RF Engine**.
- `rf-engine`: Backend Python service (FastAPI + Celery).

## πŸ“„ License

Expand Down
101 changes: 101 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,106 @@
# Release Notes

## v1.2 - OpenTopoData Migration & ViewShed Layer

This release replaces the Mapbox elevation API with OpenTopoData, adds a beta ViewShed visualization tool, and includes comprehensive code cleanup and security improvements.

### 🌐 Elevation Data Overhaul

- **OpenTopoData Integration**: Switched from Mapbox to OpenTopoData API for elevation tile fetching.
- **98.8% API Reduction**: Batch requests reduce API calls from 256 to 3 per tile.
- **No Authentication Required**: Works out-of-the-box with public API (1000 requests/day).
- **Configurable Sources**: Support for custom/self-hosted OpenTopoData instances via environment variables.
- **Rate Limit Handling**: Built-in 300ms delays between batches to respect free tier limits.
- **Environment Variables**:
```bash
ELEVATION_API_URL=https://api.opentopodata.org # Custom instance URL
ELEVATION_DATASET=srtm30m # srtm30m, srtm90m, aster30m, ned10m
```

### πŸ”­ ViewShed Layer (Beta) ⚠️ _In Development_

- **WebGL-Powered Visualization**: Real-time terrain visibility overlay using custom shaders.
- **Terrain-RGB Decoding**: Decodes elevation tiles directly on GPU for performance.
- **Interactive Placement**: Click to place observer and instantly see viewshed calculation.
- **Visual Feedback**: Red/green overlay indicates obstructed vs. visible terrain areas.
- **Seamless Integration**: Fetches elevation tiles from the same OpenTopoData backend.

_Note: This feature is in active development. Advanced features like Fresnel zone analysis are planned for future releases._

### πŸ“‘ Link Analysis Optimizations

- **Smarter API Updates**: Link analysis now only triggers when both TX and RX points are placed, preventing unnecessary API calls.
- **Improved UX**: Moving a single marker no longer clears the previous analysis result until the second point is placed.
- **Reduced Backend Load**: Eliminated redundant API requests during marker placement workflow.
- **Cleaner State Management**: Better handling of partial link configurations.

### 🧹 Code Quality & Security

- **Code Cleanup**: Removed 80+ lines of unnecessary comments and verbose documentation.

- Cleaned up `tile_manager.py` (meshgrid interpolation comments)
- Updated all Mapbox-specific references to generic "Terrain-RGB" terminology
- Removed redundant comments in `server.py` and `ViewshedLayer.js`

- **Security Audit**: Comprehensive security scan with zero critical findings.
- βœ… No exposed API keys or credentials
- βœ… Proper environment variable usage throughout codebase
- βœ… `.gitignore` correctly prevents sensitive file commits
- ⚠️ Identified CORS and Redis auth as production hardening items

### πŸ“‹ Feature Status Clarification

Features marked as **"In Development"** in documentation and UI:

- **Find Ideal Spot** - Optimal node placement search
- **Heatmap** - Coverage analysis visualization
- **ViewShed** - Terrain visibility analysis (Beta)

These features are functional but may have incomplete behavior or missing advanced features.

### πŸ”§ Breaking Changes

- **Removed**: Mapbox API dependency and `MAPBOX_TOKEN` environment variable
- **Migration**: Users upgrading should remove `MAPBOX_TOKEN` from their `.env` files

### πŸ“š Documentation Updates

- Updated README.md with OpenTopoData configuration guide
- Added ViewShed section to feature list
- Marked in-development features with warning indicators
- Removed duplicate docker-compose configuration sections

---

## v1.1 - UI Polish & Local Data

This release focuses on usability improvements and a transition to a more robust, local-first data model.

### πŸ“ Usability Experience (UX)

- **Optimization Tool Refinement**:

- **Glassmorphism Overlays**: New success/failure notifications with modern styling.
- **Persistent State**: Clearing optimization results now keeps the tool active for rapid re-testing.
- **Visual Feedback**: Added loading spinners during terrain scans.

- **Link Analysis (LOS) Workflow**:
- **Smart Toggles**: Disabling the Link Analysis tool now automatically clears the map to ensure a clean workspace.
- **New "Clear Link" Button**: Added a dedicated floating action button to reset the current analysis without exiting the tool.

### πŸ› οΈ Backend & Data

- **Local SRTM Migration**:

- Removed dependency on external Elevation APIs (OpenTopography).
- **Offline Capable**: The `rf-engine` now requires local `.hgt` (SRTM) files in the `./cache` directory.
- **Efficiency**: Removed `requests` library dependency for a lighter container footprint.

- **Dev Experience**:
- Updated `docker-compose` to support local container builds for the web app, mirroring the backend workflow.

---

## v1.0 - Professional Edition

This major release transforms **meshRF** into a professional-grade RF planning tool, introducing geodetic physics, batch processing, and a completely modernized UI.
Expand Down
Loading