DEV Community

Cover image for Simple Street Sign Treasure Hunt: Solve the riddle, go out,touch grass,take a photo and upload.
Athul
Athul

Posted on

Simple Street Sign Treasure Hunt: Solve the riddle, go out,touch grass,take a photo and upload.

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

What I Built

Street Hunt: Offline AI Edition is a GPS-based web game that turns your neighborhood into a treasure hunt. Open it on your computer and it picks a real street a few hundred meters from where you're standing. It then gives you a Harry Potter-style riddle whose answer is that street's name.Go find the street sign board, and upload it on the site, it gives you a point and puts you on the leaderboard

You put the phone in your pocket, walk to the street, find the street sign, and take a photo of it. The app reads the photo and checks that it matches the street in the riddle. The game only works if you go outside, because the only way to win is to be standing in front of a real sign.

It's for anyone who wants a reason to explore their own area: families with kids, fantasy fans, and people who've lived somewhere for years without ever walking down half its streets.

Demo

Code

GitHub logo 42lv88 / SimpleTreasureHuntMap

Simple Treasure Hunt of Map Locations

πŸ—ΊοΈ Street Hunt: Offline AI Edition

A GPS-based mobile web game where you explore the real world to find dynamically generated street quests. This version is completely free and offline-first, powered by a local FastAPI backend using Ollama (Gemma) to generate Harry Potter-style riddles, and Tesseract OCR to verify the photos you take of street signs!


πŸ—οΈ Architecture

  • Frontend: Svelte + Vite + Leaflet (Map)
  • Backend: Python + FastAPI
  • AI Riddles: Local Ollama running a Gemma model
  • Sign Verification: Local Tesseract OCR

πŸ“‹ Prerequisites

Before running the app, ensure you have the following installed on your Linux machine:

  1. Node.js & npm (for the frontend)
  2. Python 3.10+ (for the backend)
  3. Tesseract OCR (System library for reading images)
    • Fedora: sudo dnf install tesseract
    • Ubuntu/Debian: sudo apt-get install tesseract-ocr
  4. Ollama (for local AI)
    • Install from ollama.com
    • Pull the model: ollama run gemma:2b (or gemma:3b)

πŸš€ How to

…

How I Built It

The game is built around two open-source models running on your own machine, behind a small FastAPI backend.

  • Riddles: Gemma via Ollama. The backend takes a street name and asks a local Gemma model (gemma:2b by default) to write a riddle in a Harry Potter style. The model is configurable through the OLLAMA_MODEL and OLLAMA_URL environment variables.
  • Sign verification: Tesseract OCR. When you submit a photo, Tesseract reads the text and the backend checks whether it matches the target street.
  • Quest generation: OpenStreetMap. The backend takes your GPS position, calculates a point a set distance away in a random direction, and asks OpenStreetMap for the road name there.
  • Frontend: Svelte + Vite + Leaflet. It runs in the phone browser with a live map. A "Wand Setup" screen lets you point the app at your computer's backend over the local Wi-Fi.

Why Does Open Innovation Matter?

Because the models are open, the whole game runs on a laptop with no API keys, no usage bills, and no accounts. That matters for a game aimed at kids and families.

  • No cost per riddle. A closed API charges for every riddle, so a hobby game would eventually have to become a paid product. A local Gemma model can generate unlimited riddles for free.
  • Photos stay on your machine. Verification happens in local Tesseract, so pictures of streets and surroundings never go to a third party.
  • Anyone can swap the model. Changing one environment variable switches to a different Ollama model, so people can pick whatever their hardware can run.
  • It works because the pieces are open. Ollama, Gemma, Tesseract, Leaflet, and OpenStreetMap fit together without negotiating access to anything.

My Agent Session

Building an Offline Local AI Street Hunt App
You

Make the questions more on the name of the sign and make the leaderboard local storage

Agent

I've made the requested changes! Removed backend leaderboard, updated Ollama prompt to focus heavily on the street name, and made the leaderboard purely localStorage based.

You

how does it know there is street sign there??

Agent

Great question! The app relies on OpenStreetMap to pick a real street nearby. It doesn't know there's a physical sign, it just relies on the assumption that real streets have signs.

Prize Categories

  • Best Use of Gemma: Street Hunt generates every riddle with a local Gemma model (gemma:2b by default) running through Ollama. The model is swappable through an environment variable, so players can use whichever Gemma size their hardware can handle.

Top comments (0)