Files
2025-10-10 08:48:27 +02:00

44 lines
1.4 KiB
Markdown

# SignalMap client
A collaborative danger zone explorer built with React, Vite, and Leaflet. Crowd members can drop signals on an OpenStreetMap base layer; the UI highlights the hottest areas as a heatmap and keeps track of active contributors without any authentication.
## Getting started
1. Install dependencies (Node.js 20+ recommended):
```bash
npm install
```
2. Start the Vite dev server:
```bash
npm run dev
```
The app assumes the API is available at `http://localhost:8000/api.php`. You can override this by setting `VITE_API_BASE` in an `.env` file.
3. Start the lightweight PHP backend (from the repository root):
```bash
php -S 0.0.0.0:8000 -t server/public
```
The backend stores data in `server/var/points.sqlite` (ignored by git). It identifies users by IP address and provides aggregated heatmap cells plus contributor statistics.
## Features
- Leaflet + OpenStreetMap map canvas with a live heat layer (via `leaflet.heat`).
- Click-to-report interaction that drops a signal at the clicked coordinates.
- Heatmap aggregation and "danger zone" overlays that spotlight the busiest cells.
- Live contributor feed showing the most recent pings and top spotters.
- Accessible, shadcn-inspired UI components without any authentication requirement.
## Production build
```bash
npm run build
```
The output will be placed in `dist/`. Serve it with your favourite static host while keeping the PHP API reachable at `/api.php`.