2026-01-03 04:16:58 +00:00
|
|
|
|
# Contributing Guide
|
|
|
|
|
|
|
|
|
|
|
|
Thanks for helping improve the MeshCore Live Map. This repo is intentionally lightweight (no build step), so keep changes simple and readable.
|
|
|
|
|
|
|
|
|
|
|
|
## Quick Start
|
|
|
|
|
|
1) Copy `.env.example` to `.env` and set MQTT details.
|
|
|
|
|
|
2) Rebuild: `docker compose up -d --build`
|
|
|
|
|
|
3) Verify: `curl -s http://localhost:8080/snapshot`
|
|
|
|
|
|
|
2026-01-11 21:22:32 +00:00
|
|
|
|
## Versioning
|
2026-04-17 10:57:10 -04:00
|
|
|
|
- Current version: `1.8.4` (see `VERSIONS.md`).
|
2026-01-12 14:01:07 +00:00
|
|
|
|
- Update `VERSION.txt` when adding features.
|
2026-01-11 21:22:32 +00:00
|
|
|
|
- Append a new section to `VERSIONS.md` describing the change set.
|
|
|
|
|
|
|
2026-01-03 04:16:58 +00:00
|
|
|
|
## Project Layout
|
|
|
|
|
|
- `backend/app.py` handles MQTT ingest, decoding, routing, and API endpoints.
|
|
|
|
|
|
- `backend/static/index.html` is the HTML shell + template placeholders.
|
|
|
|
|
|
- `backend/static/styles.css` holds all UI styling.
|
|
|
|
|
|
- `backend/static/app.js` contains all client-side map logic (Leaflet, routes, LOS, propagation).
|
|
|
|
|
|
- `backend/static/sw.js` is the PWA service worker.
|
|
|
|
|
|
|
|
|
|
|
|
## Coding Style
|
|
|
|
|
|
- Use 2-space indentation everywhere (Python, HTML, CSS, JS).
|
|
|
|
|
|
- Keep helpers small and focused; prefer new helpers over huge functions.
|
|
|
|
|
|
- Avoid new dependencies unless they’re critical.
|
|
|
|
|
|
|
|
|
|
|
|
## Testing Checklist
|
|
|
|
|
|
- `docker compose up -d --build` after any change.
|
2026-03-04 21:16:16 -05:00
|
|
|
|
- `pip install -r requirements-dev.txt && pytest -q` for backend unit tests.
|
2026-01-03 04:16:58 +00:00
|
|
|
|
- `curl -s http://localhost:8080/stats` to confirm MQTT ingest.
|
|
|
|
|
|
- Open the map: confirm markers, LOS, and propagation behave as expected.
|
2026-02-03 02:11:42 +00:00
|
|
|
|
- Propagation check: verify TX antenna gain (dBi) changes range, and default Rx AGL is 1m.
|
2026-01-27 16:42:36 +00:00
|
|
|
|
- Turnstile only activates when `PROD_MODE=true`; if you are testing Turnstile,
|
|
|
|
|
|
set `PROD_MODE=true` plus the `TURNSTILE_*` env vars.
|
2026-01-10 23:00:56 +00:00
|
|
|
|
- If `COVERAGE_API_URL` is blank, confirm the Coverage button is hidden.
|
2026-03-22 21:18:54 -04:00
|
|
|
|
- If `MAP_BOUNDARY_MODE=polygon`, verify `MAP_BOUNDARY_FILE` exists and that the polygon overlay/filter matches the file contents.
|
2026-03-07 16:22:14 -05:00
|
|
|
|
- Weather panel check:
|
|
|
|
|
|
- `WEATHER_RADAR_COUNTRY_BOUNDS_ENABLED=true` keeps radar clipped to country bounds.
|
|
|
|
|
|
- `WEATHER_WIND_ENABLED=false` disables wind and should mark wind as unavailable in the Weather panel.
|
|
|
|
|
|
- If wind is enabled, validate `WEATHER_WIND_GRID_SIZE` (`1`-`5`) and `WEATHER_WIND_REFRESH_SECONDS` (>= `30`) behavior.
|
2026-01-03 19:16:57 +00:00
|
|
|
|
- Note: coordinates at `0,0` (even as strings) are filtered and won’t render.
|
2026-01-21 16:02:43 +00:00
|
|
|
|
- Radius filter: `MAP_RADIUS_KM=0` disables filtering; `.env.example` uses 241.4 km (150mi).
|
2026-01-11 21:22:32 +00:00
|
|
|
|
- `CUSTOM_LINK_URL` shows an extra HUD link when set; leave blank to hide.
|
|
|
|
|
|
- Update banner uses `GIT_CHECK_ENABLED` + `GIT_CHECK_PATH` to compare local vs upstream.
|
2026-01-13 17:23:47 +00:00
|
|
|
|
- Preview check: `/preview.png?lat=...&lon=...&zoom=...` shows tiles + device dots.
|
2026-01-13 18:54:18 +00:00
|
|
|
|
- Routing controls: `ROUTE_MAX_HOP_DISTANCE` (km) and `ROUTE_INFRA_ONLY` (repeaters/rooms only).
|
2026-03-11 11:22:54 -04:00
|
|
|
|
- Verify Show Hops prefix display stays plain hex (`AB`, `ABCD`, or `ABCDEF`) and matches route direction.
|
2026-02-06 14:01:35 -05:00
|
|
|
|
- Staleness controls: `DEVICE_TTL_HOURS` (device/adverts) and `PATH_TTL_SECONDS` (path activity).
|
2026-02-06 14:30:49 -05:00
|
|
|
|
- Coordinate overrides: `DEVICE_COORDS_FILE` (default `/data/device_coords.json`).
|
2026-01-14 03:49:37 +00:00
|
|
|
|
- Neighbor overrides: `NEIGHBOR_OVERRIDES_FILE` can force adjacency pairs for hash collisions.
|
2026-01-03 04:16:58 +00:00
|
|
|
|
|
|
|
|
|
|
## UI Changes
|
|
|
|
|
|
When adding UI controls:
|
|
|
|
|
|
- Wire the toggle into `app.js`.
|
|
|
|
|
|
- Add styles to `styles.css` (don’t inline).
|
|
|
|
|
|
- Keep HUD layout stable on mobile (test at narrow widths).
|
2026-01-04 21:08:52 +00:00
|
|
|
|
- If `SITE_ICON` is optional, include a text fallback for the HUD toggle.
|
|
|
|
|
|
- If you add view state, decide whether it should persist in localStorage or only via URL params (History tool defaults off).
|
2026-01-05 15:53:37 +00:00
|
|
|
|
- Node marker size defaults to `NODE_MARKER_RADIUS` and can be overridden by the HUD slider (persisted in localStorage).
|
2026-01-05 19:13:25 +00:00
|
|
|
|
- History link size defaults to `HISTORY_LINK_SCALE` and can be overridden in the History panel (persisted in localStorage).
|
2026-01-21 16:02:43 +00:00
|
|
|
|
- History panel supports a dismiss (X) button; hiding the panel should not remove history lines.
|
2026-01-10 23:00:56 +00:00
|
|
|
|
- Peers tool uses `/peers/{device_id}`; keep the response stable when modifying route history logic.
|
2026-01-03 04:16:58 +00:00
|
|
|
|
|
|
|
|
|
|
## API Changes
|
|
|
|
|
|
- Document new endpoints in `docs.md`.
|
|
|
|
|
|
- Keep payloads backward-compatible when possible.
|
|
|
|
|
|
|
|
|
|
|
|
## Commits
|
|
|
|
|
|
Use short, imperative commit messages, e.g. `Add LOS panel toggle`.
|