NaturalDex: A Privacy-First Nature Collection Game Powered by Local AI

NaturalDex is a privacy-first outdoor species collection game powered entirely by local AI — no cloud required.
NaturalDex is an open-source project by Kevin Forsgren built during Hacktoberfest 2026, wrapping outdoor species identification into a Pokémon-style collection game. Users complete daily flora, fauna, and fungi missions, submit three photos to a local Ollama vision model, and unlock collectible cards with scientific names and biological facts backed by an XP system. The project's defining technical stance is fully offline and privacy-first: image recognition runs on the user's own laptop, with the mobile client pairing via QR code and ngrok tunnel — photos never leave the local device. Built on React 18 + Vite 6 and FastAPI + SQLite, the system handles idempotency, structured vision model output, and cross-network pairing with solid engineering discipline.
When "Touch Grass" Meets Local AI
Screen addiction and endless information overload are draining people's attention — and keeping more of them indoors. Developer Kevin Forsgren offered an intriguing response during Hacktoberfest 2026: NaturalDex, a "nature Pokédex" game that encourages users to step outside, identify real species, and collect achievements.
The core inspiration comes from the "Touch Grass" philosophy — the idea of stepping away from screens and reconnecting with the physical world. Users photograph plants, animals, or fungi outdoors, submit the images to a locally running vision AI for species identification, and unlock collectible cards in their personal "field journal." What makes this project especially interesting isn't the gameplay itself, but the technical stance it takes: fully offline, privacy-first, with zero dependency on cloud services.

Gameplay Design: Turning a Walk Into an Adventure
NaturalDex transforms outdoor observation into a sustainable game loop, with a few key mechanics worth noting.
Daily Field Missions: The system generates three personalized daily tasks covering flora, fauna, and fungi, nudging users to go out and observe local biodiversity.
Three-Photo Identification Flow: Users capture three photos from different angles, giving the local vision model more context for accurate species identification. This "multi-angle" design is a pragmatic response to the frequent misidentification issues that plague single-image recognition.
Pokédex-Style Collection and XP: Each newly identified species unlocks a collectible card displaying the common name, scientific name, location recorded, species description, and a fun biological fact. Completing tasks and logging new species accumulates XP, creating a leveling progression that turns every walk into a visible growth loop.
The entire app is designed mobile-first, optimized for handheld photography scenarios, while remaining fully usable on desktop.
Technical Architecture: Local Inference Is the Star
NaturalDex is essentially a mobile-first web app powered by local AI and supported by a self-hosted architecture. Its tech stack is notably modern:
| Technology | Purpose |
|---|---|
| React 18 + Vite 6 | Frontend framework and fast build toolchain |
| TailwindCSS v4 | Utility-first styling and responsive layout |
| FastAPI + Pydantic v2 | High-performance Python 3.14+ backend |
| SQLAlchemy 2.0 + SQLite | Local database ORM and persistent storage |
| Ollama (local vision model) | Privacy-first local inference, e.g., llava-phi3 |
| JWT + Argon2 | Secure authentication stored in HttpOnly Cookies |
The data pipeline for the identification flow works like this: take three photos on your phone → backend queues processing → calls Ollama for visual inference → backend persists results while triggering database updates for species, collections, observation records, XP events, journals, and daily tasks.
Critically, image classification never reaches any cloud — it runs directly on the user's own home laptop. This machine, called the "home base," handles all AI identification for the mobile browser client. This architecture fundamentally eliminates the privacy risk of user photos and geolocation being uploaded to third-party servers.
Ollama is an open-source local large language model runtime that lets developers run various open-source models directly on their own hardware, without calling any cloud API. It offers a Docker-like CLI experience for pulling and running models like LLaMA, Mistral, and LLaVA with a single command. NaturalDex uses llava-phi3, a multimodal Vision-Language Model (VLM) capable of understanding both image and text inputs — exactly what species identification requires. Compared to cloud-based vision models like GPT-4o or Claude, local VLMs typically have lower accuracy, but their advantages include zero network round-trip latency, full offline availability, and the guarantee that user image data never leaves the local device. This trade-off carries clear privacy value in applications that involve geolocation and personal photography.
Real Challenges Encountered During Development
The author candidly shares several genuine technical challenges — a section that's especially valuable for developers looking to build similar local AI applications.
Multi-Photo Visual Identification
When integrating the Ollama vision model, the system needs to coax the model into outputting structured JSON so it can extract common names, scientific names, confidence scores, and quality check results. Even trickier: when a user accidentally configures a text-only model (one that doesn't support vision input), the system needs strict validation strategies to handle these non-visual fallback errors — logic that lives in services/vision.py.
Cross-Network QR Code Pairing
To enable the mobile browser to communicate with an Ollama instance running on a laptop, the author designed a lightweight challenge-response QR code pairing protocol (/api/home-base/pairing-challenge). Combined with an ngrok tunnel, a phone on a cellular network can pair with a laptop on a local Wi-Fi network. This is an unavoidable network connectivity challenge for any offline-first architecture.
ngrok is a reverse tunneling tool that establishes an encrypted tunnel between a local service and the public internet, generating a temporary public HTTPS address for locally running services (such as a backend on port 8080 of a laptop). This solves the fundamental problem of mobile devices on cellular networks being unable to directly access laptops on a LAN — carrier networks use NAT (Network Address Translation) to isolate devices, making direct LAN IP access infeasible. Challenge-Response Pairing is a lightweight authentication protocol: the server issues a random challenge string, the client signs it with a shared secret and returns it, and the server verifies the signature to confirm the client's identity — all without transmitting the plaintext key. NaturalDex wraps this entire flow inside a QR code scan, allowing non-technical users to complete what is otherwise a complex network pairing operation.
Idempotency and XP Integrity
To prevent duplicate collection entries from repeated photo uploads, the backend uses unique observation record associations (collection_card_observations) to ensure that card counts, XP events, and daily task updates are strictly idempotent. This is a detail that game systems often overlook, yet it directly affects the trustworthiness of the data.
Idempotency is a core concept in distributed systems and API design: no matter how many times the same operation is executed, the result is identical to executing it once. On mobile networks, unstable signals can cause users to unknowingly re-submit the same photo (for example, when a first request times out and automatically retries). Without idempotency protection on the backend, this produces duplicate collection cards, false XP accumulation, and even daily tasks being completed multiple times — directly undermining the fairness of the game economy. NaturalDex handles this by placing a unique constraint on the observation-record–collection-card association table at the database layer, intercepting duplicate submissions at the write stage rather than relying on higher-level business logic — a more robust engineering practice.
Scope Control
Rather than immediately building a native mobile app, the author chose to first refine the core identification and collection loop using an offline-capable responsive Web App (PWA architecture). This pragmatic trade-off of "validate the core loop first" is a classic example of how indie developers keep scope in check.
Testing and Reliability
Backend stability is covered by Pytest across multiple service layers: automated route validation for /api/auth, /api/discoveries, /api/collection, /api/daily-tasks, and /api/home-base; vision strategy checks (verifying rejection filtering for low-quality or mismatched submissions); ORM relationship tests across user, card, species, and XP event tables; and manual cross-device verification on real hardware for camera streaming, mobile viewports, and QR scanning mechanics.
On the roadmap, the author outlines several improvement directions: converting the frontend to a native React Native / Expo app for better camera control; adding an offline submission queue for deep outdoor scenarios with poor signal; expanding unit test coverage for frontend hooks and state contexts; and adding community card sharing features while protecting user location privacy.
An Underrated Insight
In his retrospective, the author offers one line worth sitting with: building an AI application is far more than "wrapping an API call" — it requires coordinating local hardware constraints, robust data validation, user privacy, and effective state management.
Another interesting observation concerns AI-assisted coding: he found that detailed prompting is critical when working with AI coding assistants. Giving the model clear context and constraints — the way an engineering manager would brief a team — consistently produced better architecture and cleaner code. This echoes a consensus forming among many developers in the Vibe Coding movement.
NaturalDex is open-sourced under the GPL-3.0 license, with code hosted on GitHub (KevinForsgren/NaturalDex). For developers interested in local AI, privacy-first architecture, or gamified product design, it's a compact, well-rounded reference worth exploring.
Related articles

How Big Can Stars Really Get? The Physical Limits of the Largest Stars
Red supergiants are the largest stars by volume, with radii up to 2,000 times the Sun, engulfing the inner solar system. But there is no precise upper limit on stellar size—models predict up to 15,000 solar radii. The most massive blue stars are far smaller than red supergiants—biggest and heaviest are two different things.

Apple HomeView Smart Display Full Feature Breakdown: Wall-Mount or Desktop, $299
Apple launches HomeView, a $299 smart display with wall-mount and desktop options, 12MP camera for facial recognition, smart home control, music playback, and recipe step-by-step cooking. Full breakdown of watch faces, apps, privacy, and cooking integration.

Where Did the Promised New Studio Go? Craft Computing Answers After Five Years
Craft Computing's host responds to viewer questions: the new studio promised five years ago was shelved as construction costs soared from $30,000 to $75,000, and was replaced by a 168-square-foot garage conversion.