Inspiration

Modern social apps are engineered to keep us glued to glass screens, optimizing for endless feeds, streaks, and passive scrolling rather than real human connection. We wanted to flip that incentive structure on its head by asking what would happen if your phone rewarded you for putting it away and going outside with real people.

Research by communication scholar Jeffrey Hall (2018) shows that it takes roughly 50 hours of shared time to move from an acquaintance to a casual friend, 90 hours to become a friend, and 200 hours to become a close friend. Yet between algorithm-driven isolation and the friction of organizing plans, getting together in person often feels harder than ever. Inspired by location-based territory games and the Touch Grass and People First tracks at CodeJam 16, we built Turfed—a real-world multiplayer game where hanging out offline claims physical turf on a shared city map.

What it does

Turfed is a mobile-first Progressive Web App that turns real-world hangouts into collaborative territory control with the motto: phones down, crew up, take your turf. When you start a Hang at a park, café, or campus spot, friends can join immediately by scanning your QR code with their standard phone camera, requiring no app store download. Once everyone is together, placing your phone face-down on a black screen earns up to a 1.5× phones-down multiplier, while picking up your device, switching apps, or locking the screen pauses that bonus.

The city map is divided into roughly 350-meter Uber H3 hexagons, and the points you earn during a Hang go toward your team's control of that zone. Because territory scores decay by 10% every day, teams must keep showing up in person to defend their turf. When a rival team captures one of your zones, you receive a Friend or Foe alert giving you the choice to either fight back to reclaim it or team up by scheduling a joint Rally. If players from both teams show up and earn points together, the zone becomes a shared truce for seven days, turning rivals into new friends.

Beyond private friend groups, Turfed helps people expand their social circles through Meet and Rallies. Open Hangs allow nearby players within five kilometers who share your interests to discover and join public activities, complete with automated icebreakers for first-time meetups and friendship-hour progress trackers. Players can also plan Rallies up to seven days in advance with automatic proximity check-ins upon arrival. Every day at 5 PM, two zones—one contested and one outdoors—are highlighted as Hot Zones for double points until midnight, and every Sunday evening players receive a personalized recap of their hours offline, new people met, and zones held.

How we built it

We engineered Turfed as an installable web application designed for zero-friction onboarding and real-time responsiveness. The frontend is built with React, Vite, and Tailwind CSS in a navy-and-lime hexagonal aesthetic, incorporating custom WebGL folded-glass shaders, rolling animated number counters, and full support for reduced-motion accessibility settings. On the backend, we built a FastAPI and SQLAlchemy service backed by PostgreSQL on Neon in production and SQLite for local development. Active Hangs maintain a live WebSocket connection with an automatic HTTP polling fallback so participant check-ins, timers, and points sync seamlessly across devices.

To power the territory system, we used Uber's H3 hexagonal spatial index to map GPS coordinates into 350-meter cells alongside the Google Places API for local venue suggestions. On the client side, we leveraged the browser's Geolocation API, DeviceOrientation sensors, Screen Wake Lock API, and Web Push notifications so phones can stay tucked away while sessions run. Our scoring engine combines duration, group size, phones-down ratio, daily streaks, weather, and discovery bonuses using the following formula:

$$\text{Points} = \left( t_{\text{min}} \times M_{\text{party}} \times M_{\text{phones}} \times M_{\text{streak}} \times M_{\text{context}} \right) + B_{\text{discovery}}$$

In this calculation, $M_{\text{party}}$ rewards larger groups up to $3\times$, $M_{\text{phones}}$ scales up to $1.5\times$ based on face-down heartbeat intervals, $M_{\text{context}}$ accounts for active venues, bad weather, and $2\times$ Hot Zones, and $B_{\text{discovery}}$ awards flat bonuses for visiting new places and meeting new people. Finally, we containerized the entire application with Docker so FastAPI serves both the API and the compiled React frontend from a single Render deployment.

Challenges we ran into

One of our biggest technical hurdles was working around mobile browser sandboxing, as phone browsers aggressively suspend JavaScript and background GPS tracking the moment a screen locks. To verify Hang duration without draining batteries or requiring a native app, we designed a dual-check verification system that uses check-in and check-out geofencing for locked-phone sessions paired with a 15-second heartbeat loop while the phone rests face-down on our dark screen.

We also had to design around potential GPS and couch-farming exploits after realizing players might try to capture zones with one-minute Hangs or earn solo points from home. To keep the game fair, we built an anti-cheat layer that enforces a 10-minute minimum Hang duration, requires at least two people for group credit, hashes and rounds home coordinates so residential addresses cannot be farmed, and validates proximity within 100 to 400 meters on check-in. Additionally, because Safari on iOS strictly requires HTTPS for motion sensors and requires users to add the site to their Home Screen before granting Web Push permissions, we built clear onboarding prompts and graceful fallbacks so players on any device can jump straight in.

Accomplishments that we're proud of

We are especially proud of achieving true zero-friction onboarding, allowing anyone to scan a QR code at a table and join a live multiplayer session in seconds without an app store bottleneck. Mechanizing empathy through the Friend or Foe diplomacy system is another highlight, as turning a captured zone into an opportunity to co-host a Rally and share territory directly embodies the People First philosophy. Overall, bringing together custom WebGL shaders, live WebSocket state synchronization, and a privacy-first architecture that displays aggregated team hexagons rather than individual user locations resulted in a cohesive, launch-ready product.

What we learned

Building Turfed taught us that designing for less screen time presents a unique user experience challenge, requiring us to evaluate every notification, animation, and interaction by asking whether it helps the user look up at the people across from them. We also gained deep experience in handling state synchronization over unreliable mobile networks, building graceful degradation from WebSockets to HTTP polling as players move across parks and transition between Wi-Fi and cellular connections. Finally, profiling our geospatial queries showed us how to evolve the architecture from dynamic score-log aggregation to running hex totals, nightly decay workers, and Postgres LISTEN/NOTIFY pub-sub channels as the user base scales.

What's next for Turfed

Looking ahead, we want to introduce optional AI vision check-ins that use a vision model to verify group photos as a fun, low-friction way to prove your crew is outside while creating a shared memory reel. We also plan to build native iOS and Android wrappers to access OS-level Screen Time APIs, hardware pickup detection, and distraction blocking so players can earn full phones-down credit even with their device in their pocket. In the longer term, we envision introducing seasonal campus resets, university club leaderboards, and local business sponsorships for daily Hot Zones that reward crews with real-world perks when they capture a neighborhood.

Built With

Share this project:

Updates

Submission history