DEV Community

Cover image for Jog Squad | A Gamified Eco-Jogging App: Fix the Earth. Fix Your Health. One Run at a Time. 🏃
Ntombizakhona Mabaso
Ntombizakhona Mabaso Subscriber

Posted on

Jog Squad | A Gamified Eco-Jogging App: Fix the Earth. Fix Your Health. One Run at a Time. 🏃

DEV Weekend Challenge: Earth Day

This is a submission for Weekend Challenge: Earth Day Edition

I'm a jogger. Not the "I ran a marathon once" kind but the "I need to run or my brain stops working" kind. Running is how I think, how I decompress, how I stay sane.

But here's the thing that drives me crazy: every single run, I pass litter.
Plastic bottles in the grass.
Wrappers caught in fences.
Cans rolling down the sidewalk.
It's literally everywhere, and most people myself included, honestly just jog right past it...hoping the Municipality takes care of it.

So, I love this planet. I love being outside in it. And it frustrates me that the places I run through are slowly being buried in trash that nobody takes responsibility for.

So when this Earth Day challenge dropped, I knew exactly what to build. Not another carbon calculator. Not another awareness app. Something that actually connects the act of running. Something I and many others already do every day. Something that makes picking up trash feel rewarding instead of inconvenient...
Enter: 🏃 #JogSquad

What I Built

Jog Squad is a gamified eco-jogging app that turns every outdoor run into an environmental cleanup mission.

The app connects your personal health to the planet's health through three pillars:

🗑️ Litter Detection & Cleanup: Snap a photo of your route and Gemini Vision AI identifies the litter, scores the area's cleanliness, and explains the environmental impact. Pick up what you find, log it, and earn points.

Electricity Saved: Every outdoor run you do instead of using a treadmill saves real electricity. Especially in South Africa, where LoadShedding (Controlled Power Cuts) can rear its head any second. The app tracks and quantifies this because treadmills consume roughly 0.7 kWh per hour, and running outside costs zero.

🏃 Health & Fitness: GPS-tracked runs with live mapping, pace calculation, and AI-powered coaching insights that get smarter as you log more runs.

The twist? You lose points for running on a treadmill and for skipping litter cleanup. Accountability through gamification.

Key features:

  • Live GPS run tracking with real-time map (or demo mode for presentations)
  • AI environment scanning: upload a photo, get litter detection and cleanliness score
  • Before/after photo comparison: Gemini narrates your cleanup impact
  • Points system with rewards AND penalties
  • AI-generated daily missions
  • Squad leaderboard
  • Full impact dashboard: CO₂ saved, electricity saved, litter removed
  • AI run reflections with pattern detection across your run history

Demo


🔗 Live on Google Cloud Run: Jog Squad

To try the full flow without going outside:
1. Go to Log Run → click "Demo Run (simulated GPS)"
2. Watch the live map track a simulated jog around Johannesburg
3. Finish the run → get AI analysis → log some litter cleanup
4. Check the Impact page to see your environmental stats
5. Try Scan → upload any outdoor photo → Gemini analyzes the litter

Code

GitHub logo Ntombizakhona / jog-squad

Fix the Earth. Fix Your Health. Gamified eco-jogging with Gemini AI.

🏃 Jog Squad

Fix the Earth. Fix Your Health. One Run at a Time.

Jog Squad is a gamified eco-jogging app that turns every outdoor run into an environmental cleanup opportunity. Using Google's Gemini AI, it detects litter from photos, tracks your environmental impact, and rewards you for making the planet cleaner — one jog at a time.

🌍 The Problem

Litter is everywhere. Treadmills waste electricity. People jog past trash every day without thinking about it.

💡 The Solution

Jog Squad connects your health to the earth's health:

  • Run outdoors instead of on a treadmill → save electricity
  • Scan your route with AI → see the litter problem
  • Pick up trash during your run → earn points
  • Before/after photos → prove your impact with AI comparison
  • Track everything → CO₂ saved, electricity saved, litter removed

✨ Features

  • 🏃 Run Logging — Distance, time, indoor/outdoor, mood tracking
  • 📸 AI Environment

How I Built It

Tech Stack

  • Frontend: React 18 + Vite, with Leaflet for live mapping
  • Backend: Node.js + Express
  • AI: Google Gemini 2.5 Flash (text generation + vision)
  • Database: Google Cloud Firestore (Native mode)
  • Deploy: Google Cloud Run (containerized with Docker)

The Gemini Integration (6 distinct uses)

This isn't "AI sprinkled on top." Gemini is doing real work across the entire app:

  1. Run Reflections: After each run, Gemini receives your distance, pace, mood, location type, and your past run history. It generates personalized performance insights, improvement tips, and eco-impact statements. With enough runs, it detects patterns like "you slow down after 3km" or "you perform better in cooler weather."

  2. Environment Scanning: Upload a photo of your running route. Gemini Vision analyzes it and returns structured JSON: litter types detected (plastic, metal, paper, glass), estimated counts, a cleanliness score from 1-10, and an environmental impact statement.

  3. Before/After Comparison: Upload two photos (before and after cleanup). Gemini compares them and narrates the improvement, estimates items removed, and generates an impact statement. This is the feature that makes the cleanup feel real.

  4. Cleanup Summaries: When you log collected litter, Gemini explains how long those items would take to decompose and what the real-world impact of removing them is.

  5. Daily Missions: Gemini generates personalized daily challenges scaled to your experience level. New users get "Run 0.5km and pick up 1 item." Experienced users get harder goals.

  6. Squad Leaderboard: Gemini generates a realistic mock leaderboard that places you among fictional squad members, making the app feel social even as a single-user POC.

Every Gemini call returns structured JSON that the app parses and renders. The prompts are carefully designed to get consistent, parseable responses.

GPS Tracking

The app uses the browser's Geolocation API with watchPosition for real-time tracking. Key decisions:

  • Haversine formula for distance calculation between GPS coordinates
  • Accuracy filtering: readings over 30m accuracy are discarded
  • Jitter filtering: movements under 3m are ignored (GPS noise)
  • Jump filtering: movements over 500m in one reading are rejected (GPS glitches)
  • Demo mode: a simulated 20-point route around Emmarentia Dam, Johannesburg, with points dropped every 1.5 seconds

The Points System

Action Points
Distance run +10 per km
Outdoor run +20 bonus
Litter collected +5 per item
Treadmill run -15 penalty
Skipped cleanup -10 penalty

The penalties are the key design decision. Most eco apps only reward. Jog Squad also punishes because running on a treadmill wastes electricity, and jogging past litter without picking it up is a missed opportunity.

Cloud Run Deployment

The Dockerfile uses a multi-stage build: first stage builds the React client with Vite, second stage runs the Express server and serves the static files. Deployed to africa-south1 for low latency from South Africa, with Firestore in the same region.

Prize Categories

Best Use of Google Gemini: Gemini is the backbone of the app, powering 6 distinct features: run reflections with pattern detection, environment photo scanning, before/after cleanup comparison, cleanup impact summaries, daily mission generation, and squad leaderboard generation. It uses both text generation and vision capabilities.


To fix your health, you have to fix the earth. To fix the earth, you have to get out there. Run. Clean. Repeat.

Happy Earth Day 🌍

🏃 #JogSquad

Top comments (0)