DEV Community

Harshit Anand
Harshit Anand

Posted on

Trailtale: A Pocket-Sized Audio Story That Gets You Off Your Screen and Back on the Trail

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

What I Built

Trailtale is a local, offline walking app that turns a walk into an immersive audio story. While you move, the app plays a short story segment; when you stop, the audio pauses automatically. It also surfaces weekly nature quests and lets you confirm interesting finds with a photo, all without pulling you back to a screen.

It’s built for people who want to spend more time outside without getting stuck in their phone. The idea is simple: make the walk the main experience, not a distraction from it.

Code

Repository:

Trailtale

An audio story that plays only while you walk, plus weekly nature quests. Every model runs locally — no cloud, no account, works offline.

Quick Start

1. Install Python dependencies

cd server
pip install -r requirements.txt
Enter fullscreen mode Exit fullscreen mode

2. Start the server

# From the project root
uvicorn server.main:app --host 0.0.0.0 --port 8000 --reload
Enter fullscreen mode Exit fullscreen mode

3. Open the app

Visit http://localhost:8000 on your phone (or laptop browser).

4. (Optional) Set up llama.cpp for story generation

# Download a Gemma model and start the llama.cpp server
./llama-server -m gemma-2b.gguf --port 8080
Enter fullscreen mode Exit fullscreen mode

Without llama.cpp, the story engine returns fallback text so you can still test the full walk flow.

5. (Optional) Install Piper for TTS

# See https://github.com/rhasspy/piper for installation
piper --model en_US-lessac-medium --output_file test.wav <<< "Hello from the trail"
Enter fullscreen mode Exit fullscreen mode

Without Piper, the TTS engine generates silent placeholder audio.

Architecture

Phone (PWA)              Host (FastAPI)
┌──────────────┐        ┌──────────────────┐
│ Walk Gate    │──────▶ │ Orchestrator
…



Project source: this includes the PWA client, FastAPI backend, quest data, and local AI pipeline.

How I Built It

I built Trailtale as a combination of a mobile-first PWA and a local AI backend:

  • Frontend: a lightweight browser app in the client/ folder using HTML, CSS, and JavaScript
  • Sensors: phone motion and GPS data are used to detect whether the user is walking or stopped
  • Backend: FastAPI in the server/ folder orchestrates the walk flow, story queue, quests, and logs
  • Story generation: a local model runs through llama.cpp using Gemma
  • Voice: Piper generates spoken audio from the generated story text
  • Quest system: weekly nature quests are stored as local JSON packs and tracked in SQLite
  • Optional vision check: a local multimodal model can verify that a photo matches a quest item
  • Offline-first design: the app is intended to work with no cloud service, no account, and no internet dependency

This stack makes the app feel like a real walk companion rather than a web app that happens to use AI.

Why Does Open Innovation Matter?

Open innovation mattered here because the whole product depends on privacy, local control, and flexibility.

A closed API would have forced:

  • cloud-based story generation for every segment
  • network calls for TTS and photo verification
  • higher cost per walk
  • user data leaving the device

With open-source tools and open-weight models, Trailtale can run locally on a phone, laptop, or a backpack setup. That means:

  • no cloud dependency
  • no account required
  • no pay-per-token barrier
  • the prompt, model, and voice can all be tuned or swapped easily

For an app designed to get people to step away from screens, local open tech is not just a technical choice—it’s the product requirement.

Prize Categories

Gemma

Top comments (0)