Files
regress/README.md
T
ssmithx d6ef514c84 Scaffold Regress: Fastify+SQLite server and Vue frontend for the Ingress-style BTC Map capture game
- Server: NIP-98 nostr auth (session cookies), BTC Map sync, claim/link/field
  routes, physical-presence checks via geolocation distance. 31 tests passing.
- Frontend: Leaflet map, team pick, claim/link UI, Archipelago identity
  bridge vendored (nostr-provider.js) for dashboard launch support.
- Verified end-to-end against the live BTC Map API (167 real Madeira places)
  and via genuine NIP-98-signed HTTP requests against the built app.
2026-08-05 13:14:03 +00:00

57 lines
2.0 KiB
Markdown

# Regress
A location-based capture game in the spirit of *Ingress*, built as a nostr-native
web app. Real Bitcoin-accepting businesses from [BTC Map](https://btcmap.org)
stand in for Ingress's portals — players physically visit them to claim them
for their team (orange or green), then link claimed places into triangular
control fields. First scope: **Madeira, Portugal**.
See [`DESIGN.md`](./DESIGN.md) for the full research/design writeup.
## Stack
- `server/` — Fastify + better-sqlite3 + nostr-tools (TypeScript), same pattern
as [podsteadr](http://146.59.87.168:3000/ssmithx/podsteadr).
- `frontend/` — Vue 3 + Vite + Pinia + Tailwind + Leaflet.
- Auth is NIP-98 (signed-event login → session cookie), same as podsteadr.
`frontend/public/nostr-provider.js` is vendored so the app can also be
launched identity-aware from inside an Archipelago dashboard, the same way
as podsteadr — see that repo's README for how the registration side works.
## Running locally
```bash
# server
cd server
npm install
npm run dev # http://localhost:8096
# frontend (separate terminal)
cd frontend
npm install
npm run dev # http://localhost:5173, proxies /api to :8096
```
On first run, the `places` table is empty — call `POST /api/sync` (or click
"Sync from BTC Map" in the UI) to pull the current Madeira dataset from BTC
Map's public API.
## Game rules (v0)
- Claiming or linking from a place requires being within `CLAIM_RADIUS_METERS`
(default 40m) of it, via browser geolocation — no claiming from the couch.
- Claiming an enemy-held place captures it for your team and tears down any
links running through it.
- A link can be created between any two places your team currently holds,
as long as you're standing at the origin place — no maximum link distance.
- Three mutually-linked, same-team places form a field (computed live, not
stored) — see `server/src/services/fields.ts`.
- Team choice is one-way once made.
## Tests
```bash
cd server
npm test
```