This is a submission for the Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass
What I Built
Touch Grass Buddy is a one-page web app that gives you a small outdoor mission. You tell it where you are, how much time you have, how you feel, and what you like. It replies with one mission, three short steps, one thing to notice, and a phone rule (keep the phone in your pocket). After you come back, you tap "I went outside" and it counts your trips.
It is made for anyone who scrolls too much and just needs a small push to step outside. The screen part takes about a minute. The rest happens in the real world.
Demo
Try it here: https://codepen.io/Nirwan-Sharma/pen/01a1203c-9f89-7202-ba27-ae70ed1553dd
To try it, you need your own free API key from Google AI Studio. The key stays only in your browser.
Code
The whole app is a single HTML file, so all the code is inside the CodePen above. This is the part that talks to the model:
const url = 'https://generativelanguage.googleapis.com/v1beta/models/'
+ modelId + ':generateContent';
const res = await fetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'x-goog-api-key': key },
body: JSON.stringify({ contents: [{ role: 'user', parts: [{ text: prompt }] }] })
});
How I Built It
I am a complete beginner. Before this week I had never written any code. I was confused in the AI models but after some research i learned it because I only had my phone and a few days. I built everything on my phone, and I used an AI assistant (Claude) to help write the code and explain each step.
The app uses Gemma 4, an open-weight model from Google. A dropdown lets you switch between Gemma 4 31B and the lighter Gemma 4 26B. I ran into a real problem: the model sometimes returned an empty answer or a server error (500). So I added a retry that automatically tries the other model before giving up.
Why Does Open Innovation Matter?
Because Gemma is open-weight, my idea is not locked to one company's model. I could swap between two sizes by changing one value, and the same model can later run on my own computer instead of a server. For this first version I used Google's hosted API with a free key, because I only had my phone and two days. A closed model would not give me that freedom to move or change it later.
I Actually Went Outside
The app gave me this mission: Find a quiet spot near some plants to sit and rest.
STEPS:
- Walk slowly toward the nearest greenery.
- Find a place to sit and be still.
- Stay safe while you relax. NOTICE: Listen for the sound of a bird. PHONE RULE: Keep your phone in your pocket until you go back inside. I did it at home in evening. I felt the relaxation and also felt connected to nature and it gives mental peace.
The screen was the shortest part of the day, and the walk was the best part.
Prize Categories
Best Use of Gemma



Top comments (0)