DEV Community

Indu
Indu

Posted on

GreenBreak AI ๐ŸŒฑ โ€” Less Scrolling, More Living!

Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass Submission ๐ŸŒฟ

#hf26challenge #devchallenge

What if we used our screen breaks to reconnect with the outdoors instead of scrolling through another feed?

That's the idea behind GreenBreak AI โ€” a project that encourages people to step away from their screens and enjoy small, meaningful outdoor activities.

๐ŸŒฑ The problem

We spend a lot of time looking at screens, even when we only intended to check something for a few minutes. Taking a break can easily turn into more scrolling.

I wanted to build something that makes it easier to choose an outdoor activity instead.

๐ŸŒฟ What GreenBreak AI does

  • Personalized break plans: Generate outdoor activities based on the available time, activity type, and difficulty.
  • Local AI generation: Uses Ollama with the gemma2:2b model to generate break-plan suggestions locally.
  • Template fallback: If the local model is unavailable or returns an invalid response, the application can fall back to predefined activity templates.
  • Daily nature missions: Encourages users to complete small outdoor activities.
  • Progress tracking: Stores activity progress in browser local storage.

The goal is simple: make it easier to replace a few minutes of scrolling with a refreshing break outdoors.

๐Ÿง  How I built it

GreenBreak AI combines a Python backend with a web frontend.

When a user requests a break plan, the backend sends a structured generation request to a locally running Ollama service. The model's response is validated before being returned to the frontend. If AI generation fails, the application can use the template-based fallback.

This approach keeps the core experience available even when the local model cannot generate a response.

The local AI integration

I used Gemma 2 2B (gemma2:2b) through Ollama.

Instead of relying on a paid, hosted AI API, the application can generate suggestions using a model running on the user's own computer. This avoids per-request cloud inference charges, although running the model still requires suitable local hardware and resources.

The model is distributed under Google's Gemma Terms of Use. It is an open-weight model with specific license conditions, so I am not claiming that it is OSI-approved open-source software.

๐Ÿ› ๏ธ Tech stack

  • Backend: Python, FastAPI
  • AI: Ollama, Gemma 2 2B
  • Frontend: HTML, CSS, JavaScript
  • Validation: Pydantic
  • Progress storage: Browser local storage
  • Testing: Pytest

๐Ÿš€ Run it locally

1. Clone the repository

git clone https://github.com/Sri-Indu/GreenBreak-AI.git
cd GreenBreak-AI
Enter fullscreen mode Exit fullscreen mode

2. Install the dependencies

Create and activate a Python virtual environment if desired, then install the project's requirements:

python -m pip install -r requirements.txt
Enter fullscreen mode Exit fullscreen mode

3. Set up Ollama

Install Ollama and make sure the gemma2:2b model is available locally.

If you do not already have the model, run:

ollama pull gemma2:2b
Enter fullscreen mode Exit fullscreen mode

If it is already installed, you do not need to download it again. Ensure the Ollama service is running.

4. Start the backend

From the project directory, run:

python -m uvicorn backend.main:app --host 127.0.0.1 --port 8000
Enter fullscreen mode Exit fullscreen mode

5. Open the frontend

Follow the frontend instructions in the repository README to open the application locally.

If Ollama is unavailable, the template fallback can provide break plans instead.

๐Ÿงช Testing

I ran the Python test suite after integrating local AI generation:

  • 67 Python tests passed
  • JavaScript syntax check completed without errors

These results verify the tested application behavior. Actual AI generation also depends on the local Ollama service and model being available.

๐Ÿ”— Project links

๐ŸŒ Why open innovation matters

I wanted to explore how AI could support healthier digital habits without requiring a paid hosted AI API.

Local inference gives developers an opportunity to experiment with AI on their own machines, understand how model integration works, and build useful applications with fewer external service dependencies.

This project also helped me learn about structured model responses, backend validation, error handling, and fallback behavior.

๐Ÿ’š The goal

A short break outside can be more meaningful than another few minutes scrolling.

With GreenBreak AI, I hope to make those small breaks easier to plan โ€” one outdoor activity at a time.

Thanks for reading! ๐ŸŒฑ

devchallenge #hf26challenge

Top comments (0)