TouchGrass 🌱
This is a submission for the Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass
«AI that helps you put your phone down and go outside.»
What I Built
Most modern AI apps are conversational chatbots designed to maximize screen time, capture attention, and keep users typing into text boxes.
TouchGrass 🌱 is the opposite: an application engineered to make the screen the shortest part of the experience.
TouchGrass is an open-source, local-first Progressive Web App (PWA) powered by open-weight AI that generates personalized real-world outdoor micro-challenges. It encourages users to physically put their phones into their pockets, step into nature, and engage their five physical senses.
Core Anti-Screen Philosophy
«The best session is one where the user spends less time using the app.»
Who It Is For
- Remote & Desk Workers: People suffering from screen fatigue and sedentary Zoom-call days.
- Students & Developers: Programmers who need somatic breaks away from IDEs and terminals.
- Mindfulness Seekers: Anyone wanting guided, sensory-rich walks without mindless scrolling.
Example Challenges
- 5-Minute Mission: “Find a tree you pass every day but never noticed. Examine its bark patterns for 30 seconds. Feel the texture of a fallen leaf. Put your phone away.”
- 15-Minute Mission: “Find a quiet outdoor spot. Identify 3 distinct natural sounds, 3 contrasting colors, and 1 sign of seasonal change. Take three diaphragmatic breaths before walking back.”
- 30-Minute Mission: “Take an unhurried neighborhood walk. Locate something living, something moving, and something that changed since yesterday. Return only when complete.”
Demo
- Repository: https://github.com/anushragav-vs/TouchGrass
-
Local Dev URL:
http://localhost:5173 - PWA Ready: Installable directly to mobile home screens and desktops with full offline caching.
Feature Walkthrough
- First-Run Onboarding: Short, 3-step personal preference setup without account creation or sign-in walls.
-
Calming Home Dashboard: Time-of-day greeting (“Good evening 🌱”), quick duration pills (
[ 5 MIN ],[ 15 MIN ],[ 30 MIN ]), streak counter, outdoor time, and the Touch Grass Score. - AI Challenge Generator: Personalizes missions by duration (5, 15, 30, 60m), mood (Relax, Explore, Move, Observe, Challenge), difficulty, and surroundings.
- Physical Safety Validator: Pre-checks all generated steps to forbid dangerous climbing, trespassing, wild animal contact, or traffic hazards.
- Screen-Free Mode with Pocket Dim: Minimalist UI with a natural breathing leaf, live timer, acoustic Zen chime, and an OLED true-black battery saver screen that prevents pocket touches.
-
Return Experience: Quick completion status (
[ YES ✓ ],[ PARTIALLY ◐ ],[ NOT YET ✗ ]), mood emoji rating, a single short reflection question, and optional local photo. - Personal Journal & History: Filterable by category and status, searchable, with 1-click JSON Export & Import for 100% data sovereignty.
- Real-World Achievements: 8 habit milestones (First Step, Tree Hugger, Observer, Explorer, Deep Unplug, Touch Grass Veteran, Zen Wanderer, Outdoor Habit).
- AI Engine Settings: Live model detection, latency tester, and model switching between Local Ollama, Demo Simulation, and Offline Library.
Code
The complete source code is available on GitHub:
👉 github.com/anushragav-vs/TouchGrass
How I Built It
1. Open-Weight AI Layer & Local Inference
TouchGrass is built around a decoupled AI Provider Abstraction:
-
Ollama Integration: Connects directly to local Ollama endpoints (e.g.,
http://localhost:11434or the built-in Vite reverse proxy/ollama-proxy). It auto-detects installed models viaGET /api/tagsand calls/api/generatewith strict JSON mode. -
Recommended Open Models:
-
qwen2.5:0.5b(Ultra-fast, low resource consumption ~400MB) -
llama3.2:1b(High creative output ~1.3GB) -
gemma2:2b(Google open-weight model ~1.6GB)
-
-
JSON Repair & Zod Schema: Models occasionally emit trailing commas or code fences. Our custom
jsonRepair.tsbalances clipped brackets, strips fences, and validates againstRawChallengeSchemawith Zod. -
Guaranteed Fallback Guarantee: If Ollama is offline or experiences a timeout, TouchGrass never crashes. It automatically selects a matched challenge from
fallbackChallenges.json(36+ challenges across 7 categories) and alerts the user with zero interruption.
2. Physical Safety Engine
User safety takes precedence over AI creativity. safety.ts scans every generated challenge with hazard heuristics:
- Flags dangerous climbing (cliffs, roofs, high trees, crags)
- Flags private property or trespassing
- Flags toxic flora (poison ivy, eating wild mushrooms) or wild fauna (snakes, stinging insects)
- Flags hazardous road crossings and solo deep-water swimming
- Enforces a mandatory safety disclaimer: “Stay aware of your surroundings and follow local rules. Never put yourself at risk to complete a challenge.”
3. Local-First Storage (Dexie.js / IndexedDB)
All user data—journal logs, photos, reflections, streak records, and achievements—is stored in the browser's IndexedDB. Zero user data is uploaded to any cloud server.
4. Acoustic Zen Sound Synthesizer
Rather than bundling bulky MP3 audio files that fail offline, TouchGrass uses the browser's Web Audio API to synthesize peaceful sine and triangle wave acoustics (349Hz F4 and 523Hz C5) when stepping outside and completing a challenge.
5. Technology Stack
- Frontend: React 19, TypeScript, Vite 8, Rolldown
- Styling: Tailwind CSS v4, Nature Palette, Custom Pocket Dim AMOLED Styles
- Testing: Vitest (25 unit & integration tests passing)
- Icons: Lucide React
- Weather: Open-Meteo (Open-source, free, 0 API keys required)
Why Does Open Innovation Matter?
In building TouchGrass, open innovation was not just a design choice—it was the only way this project could exist as envisioned:
1. Privacy for Somatic Reflection
Outdoor reflection is deeply personal. When a user logs how they felt under an old oak tree or reflects on tension leaving their shoulders, that thought should not be processed by closed third-party servers to train advertising models. Open weights make true privacy a mathematical reality.
2. Disconnecting Requires Offline Independence
Nature exists away from Wi-Fi and 5G cell towers. If an application requires a live connection to a closed API server in Northern Virginia, it cannot help you on a mountain trail, a wooded park, or a remote coastline. Open models running locally or through offline libraries ensure that the tool works anywhere on Earth.
3. Freedom from Rent-Seeking & API Paywalls
Closed AI APIs charge recurring token fees that force developers into subscription paywalls or ad-driven monetization. With open-weight models like Qwen and Llama, users and open-source contributors run inference for free on their existing hardware.
4. Community Auditing & Safety
Physical safety requires total transparency into prompt instructions, schemas, and model outputs. With open innovation, anyone can inspect how challenges are generated, contribute new offline activities, and audit safety filters.
You can view and test the application right now in your browser using either of the following links:
🌐 1. On This Computer (Browser)
👉 Open in your browser: http://localhost:5173/
(or http://127.0.0.1:5173/)
The Vite development server is actively running in the background.
📱 2. On Your Phone / Mobile Device (Same Wi-Fi)
Since TouchGrass is designed as a mobile-first anti-screen PWA, you can open it on your phone:
👉 Connect your phone to the same Wi-Fi network and open:
http://192.168.31.10:5173/
💡 PWA Install Tip: In Chrome or Safari on your phone, tap "Add to Home Screen" to install TouchGrass as a full standalone app with offline caching and full screen-free mode!
📂 3. On GitHub
The complete repository, code, and Hacktoberfest challenge submission documentation are live at:
👉 https://github.com/anushragav-vs/TouchGrass
Top comments (0)