Skip to content

Commit a291c8a

Browse files
committed
Expand project documentation
1 parent f874d76 commit a291c8a

File tree

1 file changed

+37
-11
lines changed

1 file changed

+37
-11
lines changed

README.md

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,25 @@
11
# TTN Gateway Atlas
22

3-
Interactive map that visualizes live gateway telemetry from Packet Broker. Built with React, Vite, and MapLibre.
3+
Gateway Atlas shows live Packet Broker gateways on an interactive MapLibre view with a TTN-inspired UI.
44

5-
## Features
5+
## Architecture
66

7-
- Real-time gateway list fetched directly from Packet Broker.
8-
- MapLibre map with light/dark mode toggle and network filters.
9-
- Gateway details modal containing IDs, location, and status information.
10-
- Location search powered by Photon.
11-
- GitHub Pages deployment via GitHub Actions.
7+
| Layer | Summary |
8+
| --- | --- |
9+
| Vite + React | Single-page app built with Vite, TypeScript, and React. Entry point: `src/main.tsx`. |
10+
| Data fetching | `useGateways` hook polls `https://mapper.packetbroker.net/api/v2/gateways` once and caches the result in React state. |
11+
| Map rendering | `components/MapView.tsx` wraps MapLibre GL, clustering gateways, handling clicks, and syncing focus. |
12+
| Dashboard UI | `App.tsx` orchestrates light/dark theming, filtering, legend segment, gateway detail modal, and location search. |
13+
| Deployment | GitHub Pages via `.github/workflows/pages.yml` builds with `npm run build` and publishes `dist/`. |
14+
15+
## Key Files
16+
17+
- `src/App.tsx` – main layout, theme toggle, network filters, legend, and modal.
18+
- `src/components/MapView.tsx` – MapLibre setup and gateway cluster logic.
19+
- `src/components/LocationSearch.tsx` – Photon-powered location search input.
20+
- `src/hooks/useGateways.ts` – Fetches and stores Packet Broker gateways.
21+
- `src/index.css` – theme variables, global styles, glass panel styling.
22+
- `tailwind.config.js` – colors, font families (Inter + League Spartan), and Tailwind extensions.
1223

1324
## Development
1425

@@ -17,15 +28,30 @@ npm install
1728
npm run dev
1829
```
1930

20-
## Build & Deploy
31+
- Local dev runs on http://localhost:5173 (`vite.config.ts`).
32+
- Toggle light/dark mode via the pill in the top-left card.
33+
34+
## Building
2135

2236
```bash
2337
npm run build
2438
```
2539

26-
Pushing to `main` triggers the GitHub Pages workflow defined in `.github/workflows/pages.yml` to publish the `dist/` output.
40+
Outputs a production bundle under `dist/`. The `base` path is `/ttnmap/` to support GitHub Pages hosting.
41+
42+
## Deployment
43+
44+
Pushes to `main` trigger the `Deploy to GitHub Pages` workflow:
45+
46+
1. Checkout and install dependencies (Node 20).
47+
2. Run `npm run build`.
48+
3. Upload `dist/` as an artifact and deploy via `actions/deploy-pages@v4`.
49+
50+
Configure Pages under the repo’s **Settings → Pages** (source: GitHub Actions). The site publishes to `https://thethingsnetwork.github.io/ttnmap/`.
2751

2852
## Data Sources
2953

30-
- Gateways: https://mapper.packetbroker.net/api/v2/gateways
31-
- Geocoding: https://photon.komoot.io
54+
- Packet Broker gateways: `https://mapper.packetbroker.net/api/v2/gateways`
55+
- Photon geocoder: `https://photon.komoot.io`
56+
57+
Both endpoints are public; no secrets or credentials are stored in the repo.

0 commit comments

Comments
 (0)