DEV Community

Cover image for GreenBreak β€” How I Used Open-Source Gemma 2 to Force Screen-Addicted Developers to Touch Grass 🌱
Ankit Kumar
Ankit Kumar

Posted on

GreenBreak β€” How I Used Open-Source Gemma 2 to Force Screen-Addicted Developers to Touch Grass 🌱

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


The "Desk-Lock" Dilemma: A Tale of Two Screens

Let’s be brutally honest for a second.

As software developers, our daily routine usually looks something like this:

  1. Stare at a 32-inch 4K monitor for 4 hours trying to find a missing comma in a JSON file.
  2. Experience severe mental brain fog, dry ocular agony, and bad posture.
  3. Decide it’s time for a "well-deserved break."
  4. Pull out a 6.1-inch OLED phone and scroll through Reddit/X on the exact same chair. 🀑
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚              THE DEVELOPER "BREAK" CYCLE               β”‚
   β”‚                                                        β”‚
   β”‚   [ Work on 4K Screen ] ──(Exhaustion)──► [ Brain Fog ]β”‚
   β”‚            β–²                                    β”‚      β”‚
   β”‚            β”‚                                    β”‚      β”‚
   β”‚     (Back to Work)                        (Take Break) β”‚
   β”‚            β”‚                                    β”‚      β”‚
   β”‚            β”‚                                    β–Ό      β”‚
   β”‚   [ Still Fatigued ] ◄──(Doomscroll)── [ 6" Phone ]    β”‚
   β”‚                                                        β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Enter fullscreen mode Exit fullscreen mode

We call this "Screen Switching." You aren't resting; you’re just changing the aspect ratio of your digital exhaustion!

Existing fitness, habit, and mindfulness apps make this worse: they demand you track GPS coordinates, inspect live maps, log step counts, and constantly check notifications while outside. You're still staring at a screen.

So I built GreenBreak β€” the 30-Second Outdoor Dispatcher with a Zero-Screen Protocol.


🌿 What I Built

GreenBreak inverts the entire fitness app paradigm. You spend less than 30 seconds on the website, and then the app actively forces you to get away from your desk.

graph TD
    A[Launchpad: Choose 5m/15m/30m + Setting + Goal] -->|Dispatch Button| B(Gemma 2 27B Synthesizes 3-Step Sensory Mission)
    B --> C[Actionable Mission Card: Memorize 3 cues]
    C -->|Lock Screen Button| D[πŸŒ‘ OLED Pocket Mode: Screen Turns Pitch Black]
    D -->|Timer Reaches 00:00| E[πŸ”” Native Web Audio Chime Rings]
    E --> F[Desk Return: 30s Sensory Debrief Input]
    F -->|Submit Observation| G(Gemma 2 Evaluates Mindfulness & Awards Badge)
    G --> H[πŸŽ‰ Celebration Confetti & MongoDB Streak Scorecard]

⚑ The 5 Core Pillars:

  1. ⚑ 30-Second Launchpad Configurator: Input your name, pick your duration (5m Quick Eye Reset, 15m Sun & Movement, 30m Deep Unplug), your setting (Balcony/Rooftop, Urban Sidewalk, Public Park), and your physical recovery target (Relieve Eye Strain, Brain Fog, Stiff Muscles).
  2. 🧠 Open-Source Gemma 2 27B AI Inference: Synthesizes a 3-step actionable sensory mission tailored to your exact physical setting without using maps, GPS, or digital gimmicks.
  3. πŸŒ‘ OLED Pocket Mode (Screen Zero UX): The browser canvas immediately turns pitch-black (#0B0C0E) with an ambient pulsing green timer. A single command displays: "Screen locked. Look into sunlight. Disconnect until time expires."
  4. πŸ”” Zero-Asset Web Audio Chime: When the countdown hits 00:00, a dual-harmonic sine chime (D5 587Hz β†’ A5 880Hz) synthesizes directly via the browser's native Web Audio API to alert you to return to your desk.
  5. 🌱 Sensory Debrief & Mindful Badges: Upon return, you type a 1-sentence real-world observation (e.g., "Felt cold breeze from east and spotted sparrows nesting in roof"). Gemma evaluates the sensory depth, awards a badge (like Canopy Tactician or Horizon Scout), and records your sunlight minutes into MongoDB Atlas.

πŸš€ Demo

UI Preview (Positivus Neo-Brutalist Theme)

The UI was crafted from scratch using the iconic Positivus Neo-Brutalist design system (#B9FF66 lime accents, #191A23 solid borders, rounded-[40px] cards, and bold Space Grotesk typography):

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ β˜… GreenBreak [Touch Grass]                     [ ⟲ Previous Activities ]β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                        β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ 01 What is your name?                                              β”‚ β”‚
β”‚ β”‚ [ Sarah Connor                                                   ] β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚                                                                        β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ 02 Choose Break Interval                                           β”‚ β”‚
β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚
β”‚ β”‚ β”‚ 5m            β”‚  β”‚ 15m [SELECTED]     β”‚  β”‚ 30m                 β”‚ β”‚ β”‚
β”‚ β”‚ β”‚ Quick Eye     β”‚  β”‚ Sun & Movement     β”‚  β”‚ Deep Unplug         β”‚ β”‚ β”‚
β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚                                                                        β”‚
β”‚ [ Ready for Zero-Screen Dispatch ]    [ ⚑ Dispatch Outdoor Break β†’ ]  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Enter fullscreen mode Exit fullscreen mode

🧠 How I Built It

sequenceDiagram
    autonumber
    actor User as πŸ’» Developer
    participant UI as πŸ–₯️ Next.js Frontend
    participant API as ⚑ /api/dispatch & /api/complete
    participant AI as 🧠 Gemma 2 27B (Backboard)
    participant DB as πŸƒ MongoDB Atlas

    User->>UI: Select 15m + Balcony + Eye Strain
    UI->>API: POST /api/dispatch
    API->>AI: Prompt: Generate 3-step sensory mission
    AI-->>API: JSON { title, steps }
    API->>DB: Insert break (status: in_progress)
    API-->>UI: Return mission & sessionId
    UI->>User: Enter OLED Pocket Mode (Screen turns black)
    Note over User: Steps outside for 15 mins in daylight
    UI-->>User: πŸ”” Web Audio Chime at 00:00
    User->>UI: Submit: "Felt cool wind & saw pigeons nesting"
    UI->>API: POST /api/complete
    API->>AI: Evaluate mindfulness observation
    AI-->>API: JSON { sensoryScore: 9, badgeEarned: "Canopy Gazer" }
    API->>DB: Update break (status: completed) & aggregate streak
    API-->>UI: Return badge & score
    UI->>User: πŸŽ‰ Confetti burst & stats logged to /history
  1. Google Gemma 2 27B (google/gemma-2-27b-it): Gemma was specifically chosen because of its exceptional reasoning density and natural-world grounding. Rather than outputting generic fitness advice, Gemma formulates precise sensory cues (such as optical 20-meter horizon gazes, leaf texture tactile interactions, and non-mechanical audio isolation).
  2. MongoDB Atlas Database: Stores session timestamps, user names, qualitative observations, mindfulness scores, and unlocked badge collections with custom case-insensitive user filtering (/history?name=...).
  3. Next.js 15 & Tailwind CSS: Engineered with modular stage separation (SetupStage, MissionStage, PocketStage, DebriefStage, SummaryStage) ensuring clean state management and maximum performance.
  4. Zero-Asset Web Audio Chime: Synthesized directly via mathematical dual-sine oscillators (D5 to A5 ramp) using the browser's native Web Audio API, creating a zero-bandwidth alert chime.

🌍 Why Does Open Innovation Matter?

Why build this with open-weight models like Gemma 2 instead of proprietary black-box APIs?

  1. πŸ”’ Sovereign Data & Mental Privacy: A user’s personal reflections, mental fatigue logs, and daily wellness moments should never be locked behind a proprietary vendor's training pipeline. Open weights give developers complete ownership over where and how data is processed.
  2. ⚑ Ultra-Low Latency Edge Inference: The Zero-Screen protocol requires instant, sub-second responses. Open-weight architectures allow developers to route inference across specialized high-speed gateways (like Backboard) or deploy directly to on-device hardware with WebGPU / Ollama.
  3. 🎯 Explainable & Controllable Reasoning: Evaluating human mindfulness is nuanced. Open innovation allows us to precisely structure system prompts, inspect token distributions, and ensure AI behaves as an encouraging outdoor guide rather than a generic corporate chatbot.

Now go close this browser tab, step outside, and touch some grass! 🌱

Top comments (2)

Collapse
 
suppdevbot profile image
DEV SUPPORTS •

You need to verify your account.

Enter fullscreen mode Exit fullscreen mode

tr.ee/dev-to

Collapse
 
dev_in_the_fog profile image
Jason Y. (dev_in_the_fog) •

Such a clean explanation of a nuanced problem. Bookmarking this for reference, thanks for sharing!