DEV Community

Cover image for TouchGrass AI — Screen Detox with Google Gemma
Himesh Hotwani
Himesh Hotwani

Posted on

TouchGrass AI — Screen Detox with Google Gemma

Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass Submission 🌿

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass

🌱 TouchGrass AI — Screen Detox with Google Gemma

What I Built

Modern life frequently traps us in an endless loop of screen time, notifications, and context switching. As developers, students, and digital workers, our eyes get strained, our minds get cluttered, and stepping outside often feels like an afterthought.

TouchGrass AI is a mindful, responsive web application designed to break the scroll cycle and get people into the physical, natural world.

Instead of generic, repetitive checklists or static articles, TouchGrass AI uses Google Gemma 2 2B running locally on the user's computer via Ollama to dynamically generate personalized outdoor missions tailored to:

  1. Current Mood:
    • 🧘 Relaxed (Gentle & Grounding) — Slow sensory observation, breathing, and peaceful pacing.
    • 🔍 Curious (Scavenger & Discover) — Natural patterns, bark textures, micro-ecosystems, and scavenger hunts.
    • ⚡ Energetic (Movement & Stride) — Brisk walking, elevation changes, dynamic breathing, and active exploration.
  2. Available Time:
    • ⏱️ 10 Minutes — Quick fresh air screen break.
    • ⏱️ 20 Minutes — Mindful neighborhood stroll.
    • ⏱️ 30 Minutes — Deep nature immersion.
  3. Outdoor Setting:
    • Anywhere outside, Parks/Woods, Backyards, or Neighborhood walks.

Key Features

  • Zero Hardcoded Missions: Every quest is genuinely generated in real time by Google's Gemma model.
  • Structured Mission Cards: Each activity features an inspiring title, an interactive checklist of outdoor steps, a sensory focus prompt (e.g., listening for distinct bird calls or feeling tree bark), and sensible safety advice.
  • "I did it!" Celebration & Local Storage Tracking: Clicking "I did it!" bursts confetti, awards a streak badge, and saves completed sessions to browser local storage so users can track their total screen-free minutes in nature.
  • Nature-Inspired Aesthetic: Crafted with a palette of sage green, forest green, warm cream backgrounds, fluid typography (Outfit & Plus Jakarta Sans), and glassmorphism.

Demo

Local Interface Walkthrough

Live Interface: Runs locally on http://127.0.0.1:5173 connecting to http://127.0.0.1:8000.

Real Examples Generated by Gemma 2 2B on Device:

1. Curious Mood (10 min) — Nature's Hidden Canvas

  • Step 1: Find 5 different types of tree leaves, trying to guess their names. Note their shape and color!
  • Step 2: Walk 5 minutes, noticing any sounds: rustle of leaves, birdsong, wind in the trees.
  • Step 3: Touch the rough bark of a tree, then a smooth stone. What is the difference?
  • Sensory Focus: Sound of wind rustling leaves.
  • Safety Tip: Stay on visible pathways to avoid unexpected roots or slips.
  • Inference: Generated locally by gemma2:2b in ~1.4 seconds.

2. Energetic Mood (20 min) — Park Power Hike: Breathe the Fresh Air!

  • Step 1: Step onto the park path and start a brisk walk, focusing on the rise and fall of your breath with each stride.
  • Step 2: Take note of the textures of the path and the bark of the trees you encounter. Feel the earth beneath your feet.
  • Step 3: Look up! Aim to see the highest point in the park and take in a full view of the sky, noticing clouds and sunbeams.
  • Sensory Focus: Sounds of birds chirping and leaves rustling against distant ambient city hums.
  • Safety Tip: Stay on marked paths and bring water to stay hydrated.

Code

The complete source code is available on GitHub:

👉 https://github.com/AllStar95/TouchGrass-AI

🌱 TouchGrass AI

Break the digital scroll loop and reconnect with the outdoors through genuine, on-device AI.


📖 Overview

TouchGrass AI is a responsive web application designed to help people trade screen fatigue for outdoor vitality. By leveraging Google's Gemma open-weight model running locally on your computer via Ollama, the app generates personalized, mindful, screen-free outdoor quests tailored to your current mood and available time.

  • 100% Genuine AI Inference: No hardcoded mock missions disguised as AI. Every quest is generated on-the-fly by Google's Gemma.
  • Complete Privacy & Offline Capability: Prompts never leave your computer. Once the model is pulled, it runs completely offline with zero telemetry.
  • Zero API Keys or Secrets: No credit cards, token limits, or third-party accounts required.
  • Mindful Design System: Nature-inspired aesthetic featuring sage green, forest green, warm cream backgrounds, fluid typography, and micro-interactions.

🧠 Selected Model: Google Gemma 2 2B (

…

Architecture Overview

TouchGrass-AI/
├── frontend/             # React (Vite + Tailwind CSS + Lucide Icons + Confetti)
│   ├── src/components/   # Header, StatsBar, MissionForm, MissionCard, Modals
│   ├── src/services/     # Resilient API client with live diagnostics
│   └── src/App.jsx       # State management & LocalStorage persistence
├── backend/              # Python FastAPI server
│   ├── main.py           # Gemma prompt orchestration & Ollama HTTP client
│   ├── test_backend.py   # Pytest test suite (JSON extraction, schemas, offline 503)
│   └── requirements.txt  # fastapi, uvicorn, httpx, pydantic
└── start.ps1             # One-click Windows PowerShell local launcher
Enter fullscreen mode Exit fullscreen mode

How I Built It

1. The Open-Source AI: Google Gemma 2 2B

I selected Google Gemma 2 2B (gemma2:2b), Google's open-weights model derived from Gemini technology:

  • Lightweight Hardware Footprint (~1.6 GB download): Runs smoothly on everyday consumer laptops using CPU or integrated GPU, consuming less than 3 GB of RAM.
  • Instruction Following: Strictly adheres to structured JSON schemas (title, instructions, safety_tip, sensory_focus) without conversational preamble.
  • Safety Alignment: Built with safety guidelines, generating healthy, positive outdoor activities.

2. Local Inference via Ollama

The frontend connects to a lightweight FastAPI backend that talks directly to Ollama running locally at http://127.0.0.1:11434.

  • Prompts are kept entirely on the user's machine.
  • Once the model is pulled (ollama run gemma2:2b), TouchGrass AI operates 100% offline without any internet connection.
  • Zero API keys, zero cloud tokens, zero subscription fees.

3. Frontend & State Management

  • Vite + React: Fast UI with responsive feedback.
  • Tailwind CSS: Custom nature-inspired tokens (Sage #8FA58F, Forest #2F6B4A, Cream #FAF8F5).
  • Browser Local Storage: Persists completed missions and total minutes in nature without requiring login walls or remote databases.
  • Diagnostics Assistant: If Ollama is offline or the model is missing, the UI displays actionable PowerShell setup steps and real-time health checks.

Why Does Open Innovation Matter?

When an application asks people to reflect on their mental health, well-being, and screen fatigue, privacy is essential.

  1. True Offline Independence: Stepping away from digital screens shouldn't mean tethering yourself to a cloud server. By using open weights, TouchGrass AI can run on a laptop in a cabin in the woods, at a remote campsite, or with Wi-Fi disabled.
  2. Zero Surveillance & Telemetry: When you tell TouchGrass AI whether you feel stressed, curious, or exhausted, that vulnerable human state never gets logged in a corporate data warehouse or used for ad targeting.
  3. No Financial Gatekeeping: Closed proprietary APIs charge per token. A wellness tool meant to help everyone shouldn't stop working when an API quota is exhausted. Open-weight models like Gemma make AI free, accessible, and permanent.
  4. Community Longevity: Closed APIs get deprecated, re-priced, or altered overnight. Open-weight models belong to the developer and the community forever.

My Agent Session

This project was built pair-programming with the AI coding agent:

  • Architected the entire React + FastAPI + Ollama pipeline.
  • Automatically installed Ollama and pulled gemma2:2b via Windows PowerShell.
  • Implemented the responsive nature UI, confetti micro-interactions, and local storage tracking.
  • Wrote and verified the 7-part automated test suite (test_backend.py) ensuring robust JSON schema validation and offline error resilience.

Prize Categories

  • Primary Category: Hacktoberfest 2026 Open-Source AI Challenge Week 1: "Touch Grass"
  • Focus: Local & Open-Weight Inference (Google Gemma), Digital Well-Being & Privacy-First AI.

Top comments (0)