Skip to content

Repository files navigation

OpenWardrive

Open wardriving map for WiFi and BLE. Public reads, contributor uploads, team rankings, REST API.

  • Frontend: Vite + Leaflet + globe.gl
  • API: Fastify + PostGIS + Supabase Auth
  • Worker: Cloudflare cache in front of the API
  • Data license: ODbL-1.0

Repository

https://github.com/jaylikesbunda/openwd

Layout

app/        Vite frontend
server/     Fastify API + PostGIS migrations
worker/     Cloudflare Worker cache
supabase/   Auth email template

Local development

cp .env.example .env
docker compose up -d          # PostGIS
npm install
npm run dev                    # app + API

Default URLs: app http://localhost:5173, API http://localhost:8787.

Scripts

npm run dev                    # dev server (app + API)
npm run build                  # build app
npm run start                  # run API
npm run check                  # node --check on server sources

# server-side jobs
npm run tiles:generate         # build MVT tiles
npm run tiles:upload           # upload tiles to R2
npm run oui:import             # load OUI prefixes
npm run intel:backfill         # backfill manufacturer/auth group
npm run geo:rebuild            # rebuild geo stats
npm run heatmaps:rebuild       # rebuild heatmap_cells
npm run clusters:rebuild       # rebuild cluster_cells

Environment

Frontend reads VITE_* vars. API reads DATABASE_URL, SUPABASE_URL, ALLOW_DEV_UPLOADS, R2_*, TILE_*, HEATMAP_*, etc. See .env.example for the full list.

ALLOW_DEV_UPLOADS=true is for local development only. The server refuses to start with it set in production.

Production deploy

  1. Create a Supabase project, run server/migrations/001_init.sql in the SQL editor, then the rest in server/migrations/ in order.
  2. Deploy the API to Render using render.yaml. Set the secrets from the sync: false entries.
  3. Deploy app/ to Cloudflare Pages. Build command: npm install && npm run build --workspace app. Output: app/dist.
  4. Deploy worker/ with wrangler deploy. Set API_ORIGIN to the Render URL. The worker name is openwardrive-api-cache; the host cache.api.openwardrive.com should be routed to it via a custom domain in the Cloudflare dashboard.
  5. The API serves /legal/{privacy,terms,code-of-conduct,license} from app/dist/legal/.

License

Code: GNU Affero General Public License v3.0 or later (AGPL-3.0).

Public data: ODbL-1.0.

See NOTICE for third-party data source attribution.

About

Wardriving map for WiFi and BLE.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages