Inspiration

As fitness enthusiasts, we found ourselves constantly switching between apps Strava for tracking, Instagram for sharing progress, Carousell for buying gear, and Eventbrite for finding local runs. We thought: why not one platform that connects all of these? Tribefit was born from the idea that fitness is inherently social and commercial you train with a community, you share milestones, and you buy and sell gear along the way.

What it does

Tribefit is a mobile-first fitness social platform that combines:

  • GPS activity tracking — Record runs, cycles, swims, and walks with live distance, pace, and speed using the Haversine formula: $$d = 2R \arcsin\left(\sqrt{\sin^2\left(\frac{\Delta\phi}{2}\right) + \cos(\phi_1)\cos(\phi_2)\sin^2\left(\frac{\Delta\lambda}{2}\right)}\right)$$ -Social feed — Share activities, like, comment, and follow other athletes
  • Marketplace — Buy and sell fitness gear with real-time chat between buyers and sellers
  • Groups & challenges — Join fitness communities, participate in merchant-hosted events and group challenges
  • Merchant ecosystem — Merchants list products, host events, and engage directly with the fitness community
  • AI food scanner — Snap a photo of any meal to receive an estimated nutritional breakdown, helping users make healthier food choices and monitor their daily intake.

How we built it

  • Frontend: React 18 + Vite, styled with custom CSS variables for dark/light theming
  • Backend: Supabase (PostgreSQL, Auth, Realtime, Row Level Security)
  • Maps: Leaflet + OpenStreetMap for live route tracking and activity maps
  • GPS: Custom useGPS hook with iOS-specific workarounds (polling fallback, relaxed accuracy thresholds, extended timeouts)
  • Real-time chat: Supabase Postgres Changes pub/sub on the chat_messages table with exponential backoff reconnection
  • Deployment: HTTPS dev server via @vitejs/plugin-basic-ssl for mobile GPS testing over local network

Challenges we ran into

  • iOS Safari GPS throttling — Safari stops delivering watchPosition callbacks after a few readings. We had to implement a 3-second getCurrentPosition polling fallback specifically for iOS devices.
  • HTTPS requirement — iOS blocks geolocation on non-HTTPS origins. Vite 5 removed the --https flag, so we needed to configure a plugin — and re-apply it every time a merge overwrote our config.
  • Supabase .single() crashes — Queries that return 0 rows throw "Cannot coerce the result to a single JSON object" instead of returning null. This caused silent failures on profile updates until we switched to .maybeSingle().
  • Mock vs. real data — The marketplace initially only displayed mock listings. Connecting to real Supabase data while keeping mocks as filler required careful tagging to prevent chat operations on non-existent records.
  • Team merge conflicts — Multiple teammates editing the same pages meant frequent conflict resolution while preserving each other's features.
  • Cross-feature integration — Because our app combines tracking, marketplace, nutrition and social networking, changes in one feature often affected another. Ensuring a smooth user experience across multiple interconnected systems required careful testing.

Accomplishments that we're proud of

Working GPS tracking on iPhone — Reliable distance tracking in a web app on iOS, with live map visualization and automatic fallback to manual input

  • End-to-end marketplace chat — Buyers can message sellers directly from a listing, with real-time message delivery via WebSockets
  • Role-based platform — Clean separation between Individual and Merchant experiences, enforced at both the UI and database level with Row Level Security
  • Zero external infrastructure costs — GPS via the browser Geolocation API, maps through OpenStreetMap, backend on Supabase's free tier and a lightweight frontend kept operating costs minimal.
  • Mobile-first responsive design — Works seamlessly on phones with bottom tab navigation, and adapts to desktop with a top nav

What we learned

  • The browser Geolocation API behaves very differently across platforms — you can't write it once and expect it to work everywhere
  • Supabase RLS is powerful but requires careful testing — a silent policy denial looks identical to "no data" from the client's perspective
  • Real-time features (chat, live tracking) require resilience patterns: reconnection backoff, missed message recovery, optimistic UI
  • Team collaboration with Git requires discipline — feature branches, atomic commits, and communication about which files you're touching

What's next for Tribefit

  • Route snapping via Mapbox Map Matching API to improve GPS distance accuracy by fitting raw points to real roads and trails
  • Push notifications for chat messages and event reminders
  • Activity photos — attach images to activities and feed posts
  • Leaderboards — weekly/monthly distance rankings within groups
  • Payment integration — in-app transactions for marketplace purchases
  • Native app wrapper (Capacitor/React Native) for better background GPS and notifications
  • Wearable integrations with Garmin, Apple Health and Google Fit for automatic activity synchronisation.
  • Smarter AI nutrition by expanding the existing food scanner into personalised meal recommendations based on activity history and fitness goals.

Built With

  • css
  • github-testing:-vitest
  • html-frameworks/libraries:-react-18
  • leaflet.js
  • mobile-first)
  • node.js-cloud-services/backend:-supabase-(auth
  • openstreetmap-tiles-platforms:-web-(pwa
  • react-leaflet-build-tools:-vite
  • react-router
  • realtime
  • sql
  • storage)-database:-postgresql-(via-supabase)-apis:-browser-geolocation-api
Share this project:

Updates

Submission history