Out of Bounds:我們打造校園地盤戰,鼓勵波士頓學生走出校園圈
Out of Bounds: we built a turf war to get Boston students out of their campus bubble.
Out of Bounds 是為波士頓大學生打造的社區集章遊戲,以校園地盤競賽鼓勵學生探索校園圈以外的城市。遊戲涵蓋 8 個社區,玩家須在地點 200 m 範圍內打卡,或提交經 Google Gemini 確認的照片。打卡位於對手校園地盤可得 2× 分數,每週由集章最多的校園奪下地盤。
Built in a weekend at BostonHacks for the Boundless Boston track.
The one-mile bubble
Boston calls itself America's college city. But if you're a student here, be honest: how much of Boston do you actually know?
For most of us it's about a mile. Campus, the dining hall, the same few places everyone goes. Meanwhile, ten minutes away on the T, there are family bakeries, corner restaurants that buy from New England farms, murals, monuments, and some of the best parks in the country. Those places rarely see students walk in.
The Boundless Boston prompt asked us to look at the city and change something. One of its guiding questions stuck with us: what do newcomers to Boston struggle with the most? Thousands of students arrive every September, and most never leave their campus bubble. So we built a game to pop it.
What we built: Out of Bounds
Out of Bounds is a neighborhood passport for Boston's college students.
- Collect stamps at real places. Eight neighborhoods (North End, Chinatown, Allston, Dorchester, East Boston, Jamaica Plain, Nubian Square and Mattapan), each with stamps at local eats, family bakeries, landmarks and parks.
- You have to actually go. A check-in only counts if your phone is within 200 m of the spot, or if you take a photo that Google Gemini confirms really shows that place.
- Pop your bubble. Two stamps complete a neighborhood and earn its seal in your passport. Your "bubble" on the map grows as you explore.
That's the passport part. What makes students actually open the app is the next bit.
The twist: campus turf wars
Every Boston student already has a rival school. We made that rivalry the engine of the game.
- Every campus (Northeastern, BU, MIT, Emerson, Suffolk and Berklee) has a home zone on the map.
- A stamp inside a rival's zone is worth 2× points.
- Whichever campus has the most stamps in a zone this week captures it. The zone flips to their logo, and every player gets a live alert: "Huskies captured BU."
- Zones reset every week, and the Bubble Cup leaderboard ranks which campus gets out the most.
Scoring is deliberately simple:
points = 100 × (2 if you're in a rival's zone, else 1)
+ 100 mix bonus for finishing a neighborhood with a food stop AND a landmark or park
The mix bonus is there for a reason: we wanted people to come for the cannoli and stay for the history and the parks.
How we built it
Frontend: React + TypeScript + Vite + Tailwind, as an installable PWA. Maps use Leaflet with OpenStreetMap tiles. State lives in Zustand.
Backend: a small Hono API on Node. One decision paid off all weekend: the game rules (zones, scoring, captures) live in a single shared TypeScript module that both the client and the server import, so the two never disagree about who owns BU.
Live updates: when a check-in flips a zone, the server pushes it to every open phone with server-sent events. No WebSocket infrastructure, just a long-lived HTTP response.
Hosting: one free Render web service runs the API and serves the built app.
Tiger Data: a weekly turf war is a time-series problem
Every check-in has a timestamp, and the core question of the game is "who has the most stamps in this zone this week?" That's a time-bucketed query, so we stored check-ins in Tiger Data (Postgres + TimescaleDB) and turned the table into a hypertable partitioned by check-in time:
await db.exec('create extension if not exists timescaledb');
await db.query(
"select create_hypertable('checkins', by_range('at'), if_not_exists => true, migrate_data => true)"
);
Then the whole turf map is one query:
select zone_id, campus_id, count(*) as n
from checkins
where zone_id is not null and at >= date_trunc('week', now())
group by zone_id, campus_id;
Because every phone writes to the same database, a capture is global: when someone at Northeastern takes BU, every BU student sees it.
Gemini: no stamping from your dorm
GPS keeps people honest outdoors, but we also wanted photo check-ins. When you tap + Photo, the server sends the image to the Gemini API with the place's name and type, and asks for a strict JSON verdict:
'Look at the photo and decide if it plausibly shows this place, its food, or its surroundings.',
'Reject photos that clearly show something unrelated, like a dorm room, a screenshot, or a different kind of place.',
'Reply with JSON only: {"match": boolean, "confidence": number between 0 and 1, "reason": "under 20 words, friendly"}.',
With responseMimeType: 'application/json', the reply parses every time. When we tested it with app screenshots and campus logos, it rejected every one, with replies like "That's just the BU logo, not Marsh Plaza!"
Gemini also writes a short local tip for your next neighborhood on the Passport screen, based on what you've already stamped.
Challenges we ran into
-
Picking a Gemini model. Our first choice wasn't available to new API accounts, and the next one took about 30 seconds per reply because it "thinks" first.
gemini-flash-lite-latestanswers in under a second and still handles images. -
TLS to Tiger Data. Node's Postgres driver rejected the connection with a self-signed certificate error. We matched libpq's
sslmode=requirebehavior (encrypted, certificate not pinned) and kept an opt-in flag for full verification. - An embedded database inside OneDrive. For zero-setup local dev, the server falls back to an embedded Postgres (PGlite). Running it inside a synced OneDrive folder corrupted it after a hard stop. We moved its data out of the synced folder, added a clean shutdown, and made it recover on its own.
- Demoing GPS indoors. You can't walk to Kenmore Square during a pitch, so we added a demo mode and a "simulate rival" control that triggers a real capture on the shared server.
-
Hosting without a credit card. We wrote a Render Blueprint (
render.yaml) that builds the frontend and runs the API as a single free service.
What we learned
- Game mechanics shape behavior more than any list of "places to visit." Double points in a rival's zone does more to move people across the city than a recommendation ever could.
- Modeling game events as time series makes weekly competition almost free.
- Structured JSON output turns an LLM into a dependable building block, not a chat box.
- Server-sent events are underrated for live updates.
What's next
- Local business partners: shops claim their stamp and attach a reward, like a free cannoli on your first visit.
- MBTA directions: live "next train" times to your next neighborhood.
- Fog-of-war map: Boston starts covered in fog and clears as you explore.
- More campuses: Harvard, Tufts, BC, UMass Boston. Every school gets a zone to defend.
來源:DEV Community · dev.to