Turn your real-world miles into virtual territory ownership. Claim H3 resolution-9 hexagonal tiles on a dynamic map, defend your turf from local rivals, and climb the global leaderboards. Your footsteps build an empire.
Run-to-Own transforms real-world running data into a competitive, map-based strategy game. By partitioning maps into a hyper-precise hexagonal grid system powered by Uber's H3, every activity tracked via your wearable or phone expands your digital footprint.
- Discover & Claim: Be the first athlete to run through an unclaimed tile to seize ownership.
- Turf Wars: If a rival runs more distance within your tile, ownership shifts. Defend your boundaries or go on the offensive.
- Exploration Multipliers: Rare and high-risk zones offer bonus points, breaking you out of standard running routes.
- Precision Hexagonal Mapping: Utilizes Uber's H3-js (Resolution-9) geospatial index to partition the world into elegant, standardized hexagons.
- Real-time Path Interpolation: Integrates Turf.js (
@turf/turf) and Mapbox polyline decoders to cleanly trace coordinates onto active grid cells. - Real-time Ownership Mutations: Automatically calculates tile captures and hands over control during cross-user activity syncs.
- Performance Scoring: Advanced scoring algorithms factoring in distance, elevation gain, and novel route tracking.
- Streak Tracking: Core background services measuring daily and weekly active streaks with unlockable milestone badges.
- Social Hub & Leaderboard: Search and follow friends, manage pending requests, and battle for the top spot on local leaderboards.
The platform has been re-engineered from the ground up as a fully decoupled, serverless-ready Next.js application built to handle fast geospatial calculations and high performance.
┌───────────────────────┐
│ Strava API │
└───────────┬───────────┘
│ Webhooks / OAuth2
▼
┌───────────────────────────────────────────────────────────┐
│ FRONTEND & BACKEND (Next.js App Router) │
│ │
│ ┌───────────────────────┐ ┌────────────────────────┐ │
│ │ Next.js API Routes │◄───►│ React 19 Client / SSR │ │
│ │ (Auth / Friends / Sync)│ │ (MapLibre / Redux) │ │
│ └───────────┬───────────┘ └───────────┬────────────┘ │
└──────────────┼─────────────────────────────┼──────────────┘
│ │ Three.js / Canvas
▼ ▼
┌───────────────┐ ┌───────────────┐
│ Prisma ORM │ │ ApexCharts │
└───────┬───────┘ └───────────────┘
▼
┌──────────────────────────┐
│ Supabase PostgreSQL │
└──────────────────────────┘
- Backend & API Framework: Next.js 16 (App Router) + Server Actions
- State Management: Redux Toolkit + React-Redux
- Database & ORM: Supabase PostgreSQL + Prisma ORM (v6)
- Map & Spatial Engine: MapLibre GL, Turf.js, H3-js (v4),
@mapbox/polyline - 3D Visualizations & Charts: Three.js, ApexCharts (
react-apexcharts) - Styling & UX: Tailwind CSS v4 + Vanilla HSL-variable glassmorphism custom system
- Authentication: Signed cookie-based JWTs using the
joseencryption package
- Node.js 18+ installed
- A Supabase Database (or any local PostgreSQL instance)
- A Strava Developer Account (Client ID, Client Secret)
git clone https://github.com/pyvmag/Run-to-Own-.git
cd Run-to-Own-
npm installCreate a .env file in the root of the project:
DATABASE_URL="postgresql://postgres.xxx:YOUR_PASSWORD@...:6543/postgres?pgbouncer=true"
DIRECT_URL="postgresql://postgres.xxx:[email protected]:5432/postgres"
JWT_SECRET="your-super-secure-jwt-cookie-key"
STRAVA_CLIENT_ID="your_strava_client_id"
STRAVA_CLIENT_SECRET="your_strava_client_secret"
STRAVA_REDIRECT_URI="http://localhost:3000/api/auth/strava/callback"
NEXT_PUBLIC_MAPTILER_KEY="your_maptiler_api_key"Synchronize your local database schema with your Supabase or PostgreSQL container:
npx prisma generate
npx prisma db pushStart the local server:
npm run devOpen http://localhost:3000 to log in and sync your profile.
Have ideas for team turf wars, multi-city lobbies, or localized event layers?
- Maintainer: Vaibhav Magdum
- Portfolio: vaibhavmagdum.vercel.app
- GitHub: @pyvmag
If you encounter any bugs, authentication errors, or sync performance issues with Run-to-Own, please open an official tracking issue directly in this repository's Issues Tab.
Run-to-Own respects your data privacy. We strictly utilize your Strava activity coordinate polylines to calculate your aggregate, anonymous distance metrics inside our localized H3 grid map zones.
- We do not sell, rent, or lease your personal workout data to third-party brokers or advertisers.
- No raw, private Strava maps or individual performance splits are shared with other users.
- In strict compliance with the Strava API Agreement, no activity data points remain cached in our database storage infrastructure longer than seven (7) days.
You are in full control of your information. If you wish to completely disconnect your profile and permanently wipe your data from our database servers, you can do so in two ways:
- Self-Service Revocation: Log into your Strava dashboard, navigate to your Settings -> My Apps, and click Revoke Access next to the Run-to-Own application token.
- Manual Deletion Request: Open a GitHub issue here requesting data removal. In strict accordance with platform policies, all personal and historical records matching your account profile will be permanently purged and cleared from our databases within 48 hours.



