DEV Community

Aabhay Ranjan Pandey
Aabhay Ranjan Pandey

Posted on

Nature Left

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


🌿 NatureLeft β€” The Offline Natural Horizon Clock & Biophilic Scavenger

"Your terminal will still be back tomorrow. This specific warm amber horizon light will not."


πŸƒ What I Built

As software engineers, designers, and digital builders, we routinely spend 10 to 14 hours every single day bathing our retinas in artificial, high-energy visible (HEV) blue light from liquid crystal displays. Our circadian biology degrades, screen fatigue accumulates, and we miss the single most restorative daily phenomenon: natural sunlight, golden hour, and twilight.

NatureLeft is a high-end, Silicon Valley-grade anti-screen intervention disguised as a luxury solar horology timepiece and tactical outdoor scavenger directive engine.

🌟 How It Works & Gets People Off Screens:

  1. Mathematical Solar Horizon Engine: Using pure spherical trigonometry (via the open-source astral library), NatureLeft computes exact sunrise, solar noon, golden hour, sunset, and blue hour (civil twilight) coordinates right on your device.
  2. Anti-Screen AI Directive Core: It triggers tiny open-weight models (like phi3:mini or gemma:2b via local Ollama) to generate urgent, witty, poetic, or aggressive outdoor scavenger missions tailored to the remaining daylight minutes.
  3. Biophilic Photometer & Circadian HUD: Displays an estimated natural lux rating (e.g., ~75,000 Lux at midday down to ~1,800 Lux at golden hour) contrasted against artificial monitor glare (~250-350 Lux), showing when natural melatonin pathways begin waking up.
  4. "I Touched Grass β€” Log Escape": A pulsing primary action button that triggers a celebratory multi-cannon confetti explosion, synthesized pentatonic bell chimes (built directly into the browser via Web Audio APIβ€”zero external audio files needed), increments your outdoor streak, and logs your verified escapes into a local JSON ledger.
  5. Interactive Time-Travel Sandbox Slider: An interactive 24-hour scrubber at the bottom allowing judges and users to drag between Dawn, Solar Noon, Golden Hour, and Night Curfew to watch all lighting and directives adapt in real time.

πŸŽ₯ Demo

πŸ“Έ Visual Highlights:

  • Luxury Astronomical Dial: Dual-track SVG solar ring with an orbiting sun marker that physically traces the celestial perimeter throughout the day.
  • Dynamic Ambient Atelier Mesh: The deep obsidian background (#060911) dynamically shifts between Golden Amber & Coral at dusk, Electric Cobalt during Blue Hour, and Obsidian Starlight during Screen Curfew.
  • Tactical Scavenger Cards: Concrete sensory targets outside (e.g., "Warm amber light bouncing off east-facing brickwork") and immediate physical actions (e.g., "Step away from keyboard, walk 400m westward before solar elevation hits 0Β°").

πŸ’» Code

Project Architecture:

NatureLeft/
β”œβ”€β”€ main.py              # FastAPI server with REST endpoints & static serving
β”œβ”€β”€ app.py               # Streamlit application for 1-click cloud deployment
β”œβ”€β”€ requirements.txt     # Pinned open-source dependencies
β”œβ”€β”€ utils/
β”‚   β”œβ”€β”€ astronomy.py     # Pure Python solar & civil twilight computations
β”‚   └── ai_generator.py  # Local Ollama client + resilient zero-latency neural fallback
β”œβ”€β”€ templates/
β”‚   └── index.html       # Silicon Valley "Biophilic Atelier" dark SPA dashboard
└── data/
    └── streaks.json     # 100% on-device persistent escape ledger
Enter fullscreen mode Exit fullscreen mode

πŸ› οΈ How I Built It

NatureLeft was engineered from the ground up around open-source AI and offline-first principles:

  1. Local Open-Weight Inference (Ollama):
    • Integrates with local open-weight models (phi3:mini, gemma:2b, llama3:8b) via Ollama (http://localhost:11434).
    • Crafts a strict persona: The Anti-Screen Biophilic Drill Sergeant / Witty Curator.
    • Includes an instant Zero-Latency Neural Fallback Engine that generates witty, randomized, hyper-targeted directives in under 15ms if Ollama is not installed or offlineβ€”guaranteeing 100% uptime for hackathon judges!
  2. Open-Source Astronomical Modeling:
    • Powered by the astral Python library, calculating exact solar elevation angles, azimuth, civil dusk, and golden hour windows from local coordinates.
  3. Frontend Design System:
    • Handcrafted "Biophilic Atelier" dark aesthetic (#060911 palette).
    • Tailwind CSS, Lucide icons, Canvas Confetti.
    • Web Audio API synthesizer generating clean, harmonic pentatonic chimes with zero third-party audio assets.
  4. Dual Running Modes:
    • FastAPI + Vanilla JS: Ultimate micro-interaction performance and horology dial animations.
    • Streamlit (app.py): Optimized for instant, free deployment on Streamlit Community Cloud.

🌍 Why Does Open Innovation Matter?

1. True Wellness Cannot Require Data Extraction

An application meant to rescue you from digital fatigue should not harvest your GPS location, spy on your daily schedule, or phone home to closed cloud servers. Because NatureLeft is built with open-source AI and local computing:

  • Zero API keys required.
  • Zero telemetry or trackers.
  • 100% private and on-device.

2. Zero-Cost Longevity

Closed LLM APIs break when tokens run out, credit cards expire, or pricing tiers change. By anchoring NatureLeft to tiny open-weight models (like Microsoft's phi3:mini or Google's gemma:2b), the software will run just as smoothly 10 years from now on an offline laptop in a remote cabin as it does today.

3. Accessible at the Edge

Open innovation enables AI to run on edge hardwareβ€”laptops with no WiFi connection in a national park, low-power single-board computers, or home servers. Nature is offline; our nature tools should be too.


πŸ† Prize Categories

  • Grand Prize / Challenge Theme: Week 1: Touch Grass
  • Best Open-Weight Model Implementation: (Local Ollama phi3:mini / gemma:2b + Zero-Latency Offline Fallback)
  • Best Product UI/UX & Design: (Biophilic Atelier Dark Mode & Horology Solar Dial)

Step away from your terminal, close your IDE, and go Touch Grass today! 🌿

Top comments (0)