mirror of
https://github.com/luxfi/quest.git
synced 2026-10-30 15:20:25 +00:00
The repo was a "coming soon" page. This is the game. A quest is a VALUE, not a database row — name, prize and every stop encode into the share link, so making one and sending it needs no account, no server and no storage. The code rides in the URL FRAGMENT, never the query string: a fragment is not sent to the server and does not appear in a Referer header, so the places someone chose stay out of access logs and off any site they click through to. `?q=` would quietly publish every quest anyone shares. Arriving is the one rule worth getting right. A stop is found when the device reports a position inside its radius, and the browser's own accuracy estimate is ADDED to that radius — a phone between tall buildings reports ±50 m, and holding it to the bare radius tells someone standing at the right door they are not there. Wildly inaccurate readings are capped, so a device claiming ±50 km cannot unlock a city from the sofa. Google is confined to one module. With no NEXT_PUBLIC_GOOGLE_MAPS_KEY every stop falls back to a list with a Maps link and the hunt is still playable, and "no key configured" is kept distinct from "Google refused" — collapsing those is how a missing env var gets mistaken for an outage. Prizes are the maker's own words, settled between the two people. Nothing here holds money or hands anything out; an escrow would be a custody problem and saying otherwise in the UI would be a lie about what happens when someone wins. Proven, not asserted: 28 unit tests over the pure core (unicode place names, truncated and hand-edited links returning null instead of throwing, coordinate precision against a 45 m radius, corrupt localStorage) and 7 Playwright tests driving the real static export at phone size with FAKED GPS — walk to Clarion Alley and the point lands, stand three blocks away and it does not, refuse location and the screen says so rather than doing nothing silently. Also fixes a pre-existing break: Tailwind was configured with no stylesheet importing it, so every utility class in the app was inert. Co-authored-by: Hanzo Dev <[email protected]>
25 lines
778 B
TypeScript
25 lines
778 B
TypeScript
import { defineConfig, devices } from '@playwright/test'
|
|
|
|
const PORT = 4312
|
|
|
|
export default defineConfig({
|
|
testDir: './e2e',
|
|
fullyParallel: true,
|
|
forbidOnly: !!process.env.CI,
|
|
reporter: process.env.CI ? 'list' : [['list']],
|
|
use: {
|
|
baseURL: `http://127.0.0.1:${PORT}`,
|
|
// A hunt is played outdoors on a phone, so that is what is tested.
|
|
...devices['Pixel 5'],
|
|
trace: 'retain-on-failure',
|
|
},
|
|
webServer: {
|
|
// Serve the real static export — the artifact that actually ships — rather
|
|
// than a dev server, so what the tests drive is what a player gets.
|
|
command: `npx next build && npx http-server out -p ${PORT} -s`,
|
|
url: `http://127.0.0.1:${PORT}/index.html`,
|
|
reuseExistingServer: !process.env.CI,
|
|
timeout: 180_000,
|
|
},
|
|
})
|