A local-first physical exploration system and illustrated digital field journal.
Capture small real-world discoveries, build a living personal map, and uncover patterns through local AI.
Discover TRACE • The Core Loop • Explore the Experience • Quick Start • System Architecture • Reference & Docs • Contributing
Most modern digital tools compete fiercely for your screen time. Social algorithms optimize for passive scrolling, fitness apps reduce the outdoors to calorie counts and heart rate zones, and navigation systems rush you along the fastest highway between two points.
TRACE is built on an inverse philosophy:
The world is the interface. The screen should start and end the experience, not become the experience.
When you step out into your neighborhood or wander an unfamiliar street, the physical world is filled with quiet, unnoticed details:
- Wild chamomile blossoming through a curb seam.
- The distinct acoustic rhythm of water echoing down an underground culvert.
- A faded mason's crest chiseled into a 19th-century lintel.
- An unexpected dirt trail cutting between two brick cul-de-sacs.
TRACE gives you an enduring, private place to record these moments as traces. Over time, your discoveries construct an illustrated, living map of where you paid attention. When local AI is enabled via LM Studio, open-weight models (such as Google Gemma 3 4B) synthesize your field notes, uncover hidden sensory patterns, and prompt where you might look next—all without sending a single coordinate, photo, or thought to cloud servers.
┌────────────────────────────────────────────────────────────────────────┐
│ CONVENTIONAL APPS │
│ [Screen] ──► [Infinite Feed] ──► [Notification Ping] ──► [More Screen]│
│ │
│ TRACE FIELD JOURNAL │
│ [Screen: Brief Spark] ──► [Step Outside & Observe] ──► [Living Map] │
└────────────────────────────────────────────────────────────────────────┘
| Dimension | Standard Maps & GPS | Fitness & Hiking Apps | Note & Journal Apps | TRACE Field Journal |
|---|---|---|---|---|
| Primary Focus | Turn-by-turn routing & commercial ads | Workout metrics, heart rate, & pacing | Document drafting & productivity | Attentive physical exploration & curiosity |
| Core Artifact | Directions & business listings | GPS polyline tracks & split times | Freeform text documents | Categorized, sensory field traces on a living canvas |
| AI Integration | Cloud recommendation engines | Cloud performance algorithms | Proprietary cloud LLM rewriting | 100% local inference via LM Studio (zero cloud leakage) |
| Data Privacy | Cloud user accounts & tracking | Public social activity feeds | Cloud sync services | Strictly local SQLite & filesystem storage |
| Incentive | Commercial consumption | Gamified competitive leaderboards | Productivity streaks | Whimsical field stickers, sensory curiosity, & self-paced streaks |
The TRACE exploration cycle bridges the digital interface with the living physical world:
flowchart LR
A["🌿 1. Step Outside<br><i>Wander without a destination</i>"] --> B["🔎 2. Notice a Detail<br><i>Masonry, birdsong, flora</i>"]
B --> C["📝 3. Capture Trace<br><i>Field note + photo/audio</i>"]
C --> D["🧠 4. Local AI Lens<br><i>Gemma 3 4B synthesizes tags</i>"]
D --> E["🗺️ 5. Living Map<br><i>Anchor discovery to canvas</i>"]
E --> F["🐌 6. Sticker Garden<br><i>Earn daily field stamps</i>"]
F -.->|Inspires next curiosity| A
- Step Outside: Close the browser, put your phone in your pocket, and explore the physical world at human walking speed.
- Notice a Detail: Shift attention to sensory observations: an unusual sound, an engineered remnant, or an overgrown corner.
- Capture a Trace: Return to TRACE to write what you saw. Optionally pick an explicit category lens and attach a field photo or audio recording.
- Local AI Synthesis: Your local Gemma model generates a concise field title, qualitative summary, and sensory tags. If you chose a category lens, your choice is strictly authoritative.
- Living Map Placement: Anchor the trace using browser GPS, click directly on the map, or keep it unplaced in your memory log.
- Sticker Garden & Rewards: If this is your first trace today, claim an illustrated field sticker, build your exploration streak, and unlock milestone packs.
Your physical discoveries, rendered as an illustrated cartographic canvas.
- Leaflet Spatial Canvas: Interactive, fluid map rendering customized with TRACE's vintage parchment aesthetic.
- Five Distinct Discovery Lenses:
- 🌿 Nature: Plants, moss, fungi, wildlife, weather phenomena, and natural cycles.
- 🔊 Sound: Bird calls, stream currents, industrial hums, acoustic echoes, and rhythms.
- 🏛️ Structure: Bridges, old masonry, culverts, street furniture, and infrastructure.
- 🔎 Mystery: Unexplained markings, out-of-place objects, and historical puzzles.
- 💙 Personal: Meaningful spots, quiet benches, memories, and personal sanctuaries.
- Category Filter Bar: Filter by lens with single-click filter chips showing live counters of total discoveries.
- Flexible Placement: Drop markers via high-accuracy GPS, click anywhere for Manual Placement, or save notes as Unplaced Traces.
A focused field-journal entry tool engineered for rapid, tactile recording.
- Distraction-Free Field Notes: Simple text area designed for natural, evocative field descriptions.
- Category Precedence Rule: Choose an explicit category lens, or leave it unselected to let local AI auto-classify. User choices are authoritative and are never silently overwritten.
- Photo & Audio Attachments:
- Photographs: JPEG, PNG, WebP, GIF with instant client-side thumbnail previews.
- Audio Recordings: MP3, WAV, OGG, WebM, AAC, FLAC with an embedded in-browser audio player.
- Magic-Byte Sniffing: Backend inspection verifies true file signatures rather than trusting client extensions.
- Safety Boundaries: Strict filesystem sandboxing prevents path traversal, capped at 15 MB per file.
- Safe Cascading Deletions: Deleting a trace from your field notes permanently removes its record and cleanly purges associated media files from disk.
Open-weight intelligence running privately on your own hardware via LM Studio.
- Zero Cloud Dependency: Runs through LM Studio using standard OpenAI-compatible endpoints (
http://127.0.0.1:1234/v1). - Optimized for Google Gemma 3 4B: Tuned system prompts extract structured JSON (
title,summary,tags,sensory_type,confidence). - Deterministic Fallbacks: If LM Studio is paused or uninstalled, TRACE works without interruption, applying smart fallback titles and preserving full note fidelity.
- Absolute Privacy: Coordinates, journal entries, and media files are never transmitted to external cloud AI providers.
Cute is the aesthetic. Exploration is the purpose. Stickers are the reward.
- Daily Exploration Streaks: Logging a trace qualifies your calendar day. Streaks encourage slow, regular walks.
- Resilient Streak Rules: Missing a day resets the current streak counter, but your longest streak record is preserved forever, and earned stickers are never lost.
- Milestone Collections:
- 🌿 The Little Things Club (7-day streak)
- 📖 The Field Journal Collection (30-day streak)
- 🐌 The Outside-ish Personality Pack (50-day streak)
- 🗺️ The World Noticed Collection (100-day streak)
- Specimen Modal & High-Res Downloads: Inspect any collected card in an archival specimen frame and click Download PNG to save transparent sticker artwork to your device.
- Cross-Tab Synchronization: Real-time synchronization via
BroadcastChannelandlocalStoragekeeps streak counters and sticker rewards synced across all open browser tabs instantly.
Below is a preview of verified sticker illustrations bundled directly in TRACE:
(Stickers whose artwork is currently in illustration display a decorative field-stamp placeholder until transparent PNGs are added).
Get TRACE running locally in five minutes. Windows PowerShell is shown first, followed by macOS/Linux commands.
- Python: 3.11, 3.12, or 3.13 installed
- Node.js: v20.x or higher + npm
- Git: Installed and available in terminal
- LM Studio (Optional): Recommended for local Gemma 3 4B AI interpretation
# Windows PowerShell & macOS/Linux
git clone https://github.com/shiriei/TRACE.git
cd TRACEIn your first terminal window:
# Windows PowerShell
cd backend
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt
Copy-Item ..\.env.example .env
# Start FastAPI server on port 8000
uvicorn app.main:app --host 127.0.0.1 --port 8000 --reload# macOS / Linux
cd backend
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp ../.env.example .env
# Start FastAPI server on port 8000
uvicorn app.main:app --host 127.0.0.1 --port 8000 --reloadThe SQLite database (runtime/traces.db) initializes automatically on first boot.
In a second terminal window:
# Windows PowerShell & macOS/Linux
cd TRACE/frontend
npm install
# Start Vite development server
npm run devOpen your browser to: http://localhost:5173
- Download and launch LM Studio.
- Search for and download Gemma 3 4B (e.g.
google/gemma-3-4b-itGGUF). - Click the Developer / Local Server tab (
<->on the left sidebar). - Select and load the Gemma 3 4B model into memory.
- Set port to
1234, enable CORS, and click Start Server. - TRACE will automatically detect the server and display an active local-AI status indicator.
- Backend Health: http://127.0.0.1:8000/api/v1/health returns
{"status":"healthy"}. - Swagger UI: http://127.0.0.1:8000/docs loads interactive OpenAPI documentation.
- Frontend Canvas: http://localhost:5173 displays the living map and field capture form.
- First Trace: Write an observation, select 🌿 Nature, save unplaced, and watch your first sticker unlock!
graph TB
subgraph Browser Client [Frontend — React + TypeScript + Vite — :5173]
Map[Leaflet Living Map Canvas]
Capture[Trace Creation Form & Lens Chips]
Garden[Sticker Garden & Specimen Modal]
Sync[Cross-Tab Sync Engine]
end
subgraph FastAPIServer [Backend — Python 3.11+ — :8000]
Router[API Routers: /traces, /ai, /stickers]
TraceSvc[Trace Service & Dedup]
StickerSvc[Sticker & Streak Engine]
MediaSvc[Media Storage & Sniffer]
AISvc[AI Parser & Schema Validator]
end
subgraph Storage [Local Storage Layer]
DB[(SQLite 3: runtime/traces.db)]
Files[(Media: runtime/media/)]
end
subgraph Inference [Local AI — LM Studio — :1234]
Model[Gemma 3 4B Open-Weight Model]
end
Capture -->|POST /api/v1/traces| Router
Capture -->|Stream Multipart Files| Router
Router --> TraceSvc
Router --> MediaSvc
Router --> StickerSvc
TraceSvc --> AISvc
AISvc -->|POST /v1/chat/completions| Model
Model -->|JSON Response| AISvc
TraceSvc --> DB
MediaSvc --> Files
MediaSvc --> DB
StickerSvc --> DB
Router -->|Trace + Streak Reward| Capture
Capture --> Map
Capture --> Garden
Sync <--> BrowserClient
sequenceDiagram
autonumber
actor Explorer as Explorer
participant UI as Frontend (React)
participant API as FastAPI Backend
participant AI as LM Studio (Gemma 3)
participant DB as SQLite Database
participant Disk as Local Media Storage
Explorer->>UI: Enter observation & select category lens
Explorer->>UI: (Optional) Attach photo or voice note
UI->>API: POST /api/v1/traces (observation, category, location)
API->>DB: INSERT initial trace record
alt LM Studio is Active
API->>AI: POST /v1/chat/completions (Structured JSON Prompt)
AI-->>API: {title, summary, tags, sensory_type, category}
Note over API: Apply Precedence: Explicit user category overrides AI
else LM Studio Offline
Note over API: Apply deterministic fallback title & summary
end
API->>DB: UPDATE trace with metadata & final category
API->>DB: Evaluate streak & check daily sticker qualification
opt Attachments Uploaded
UI->>API: POST /api/v1/traces/{id}/attachments (Multipart)
API->>Disk: Sniff magic bytes & stream file (UUID)
API->>DB: INSERT attachment metadata record
end
API-->>UI: 201 Created (Trace, Reward, Streaks)
UI->>UI: Render pin on map & broadcast cross-tab sync
UI->>Explorer: Trigger reward celebration modal
⚙️ Complete Configuration Reference (.env)
TRACE loads configuration from environment variables or a .env file in the working directory. Below is the verified reference of all configuration options:
| Variable Name | Default Value | Description & Usage |
|---|---|---|
TRACE_HOST |
127.0.0.1 |
Network interface for FastAPI server. Use 0.0.0.0 for local network access. |
TRACE_PORT |
8000 |
Port for the backend API server. |
TRACE_ENVIRONMENT |
development |
Operating environment (development, production, test). |
TRACE_CORS_ORIGINS |
http://localhost:5173,http://127.0.0.1:5173 |
Comma-separated list of browser origins permitted by CORS headers. |
LM_STUDIO_BASE_URL |
http://127.0.0.1:1234/v1 |
OpenAI-compatible endpoint URL where LM Studio serves completions. |
LM_STUDIO_MODEL |
google/gemma-3-4b |
Model identifier string loaded into LM Studio. |
LM_STUDIO_API_KEY |
lm-studio |
Placeholder key required by standard OpenAI client libraries. |
LM_STUDIO_TIMEOUT_SECONDS |
30.0 |
Maximum seconds to wait for AI model completion before using fallbacks. |
TRACE_DATABASE_PATH |
runtime/traces.db |
Relative or absolute path to SQLite file. Automatically initialized on startup. |
TRACE_MEDIA_DIR |
runtime/media |
Directory where uploaded photos and audio files are stored. |
TRACE_MAX_UPLOAD_SIZE_BYTES |
15728640 (15 MB) |
Strict upload ceiling for individual media attachments. |
📡 Complete API Endpoint Reference
All endpoints are served under /api/v1 (except the root / and /health probe). Full interactive Swagger documentation is available at http://127.0.0.1:8000/docs.
GET /health— Root-level server health probe. Returns{"status": "healthy", "project": "TRACE", ...}.GET /— Service entrypoint with API metadata and documentation links.GET /api/v1/health— Versioned health endpoint matching frontend connection checks.
POST /api/v1/traces— Create a new trace observation. Triggers AI metadata synthesis and reward evaluation.GET /api/v1/traces— List traces with optionalcategory,limit(max 500), andoffsetpagination.GET /api/v1/traces/{trace_id}— Retrieve a specific trace by ID.DELETE /api/v1/traces/{trace_id}— Permanently delete a trace and purge all associated attachment files.
POST /api/v1/traces/{trace_id}/attachments— Upload a photo or audio file. Verifies magic bytes and enforces 15 MB limit.GET /api/v1/traces/{trace_id}/attachments— List all media attachments associated with a trace.GET /api/v1/traces/{trace_id}/attachments/{attachment_id}— Retrieve attachment metadata.GET /api/v1/traces/{trace_id}/attachments/{attachment_id}/content— Stream binary file content with correct MIME headers.DELETE /api/v1/traces/{trace_id}/attachments/{attachment_id}— Delete an individual attachment file.
GET /api/v1/ai/status— Probe reachability of local LM Studio instance without failing backend health.POST /api/v1/ai/interpret-trace— Directly classify and extract structured metadata from raw observation text.
GET /api/v1/stickers— Retrieve the full sticker catalogue with dynamic asset-availability flags and optional theme filter.GET /api/v1/stickers/packs— List milestone reward pack definitions (7d, 30d, 50d, 100d).GET /api/v1/stickers/collection— Retrieve earned stickers owned by the explorer.POST /api/v1/stickers/collection/grant— Grant an unlocked catalogue sticker to collection.GET /api/v1/stickers/streak— Read-only streak summary: current streak, longest streak, today's qualification, and milestone progress.POST /api/v1/stickers/streak/evaluate— Explicitly evaluate streak qualification and unlock eligible rewards.GET /api/v1/stickers/{sticker_id}— Retrieve metadata for an individual sticker.
📁 Project Structure & File Guide
TRACE/
├── .env.example # Configuration template for local overrides
├── LICENSE # MIT Open-Source License
├── README.md # Comprehensive documentation & field guide
├── docs/
│ └── ARCHITECTURE.md # Detailed system architecture specification
├── backend/
│ ├── requirements.txt # Python dependencies (FastAPI, Uvicorn, Pydantic, etc.)
│ ├── app/
│ │ ├── main.py # FastAPI application entrypoint & lifespan manager
│ │ ├── api/
│ │ │ ├── __init__.py # Root API router mounting versioned routes
│ │ │ └── routes/ # Endpoints: /traces, /ai, /attachments, /stickers, /health
│ │ ├── core/
│ │ │ └── config.py # Pydantic Settings & environment variable parsing
│ │ ├── db/
│ │ │ └── database.py # SQLite connection manager, WAL mode, foreign keys
│ │ ├── models/ # Dataclasses & internal domain models
│ │ ├── schemas/ # Pydantic request/response validation schemas
│ │ ├── services/ # Business logic: trace_service, sticker_service, media_storage
│ │ ├── ai/ # LM Studio HTTP client, JSON schema parser, prompts
│ │ └── stickers/ # Sticker catalogue definitions & milestone packs
│ └── tests/ # 103 Pytest tests: test_traces, test_stickers, test_attachments, test_ai
└── frontend/
├── package.json # Frontend dependencies & npm scripts
├── vite.config.ts # Vite bundler configuration
├── index.html # HTML entrypoint loading Fraunces & Inter fonts
├── public/
│ ├── trace-mark.svg # TRACE vector compass mark
│ └── assets/stickers/ # Verified transparent PNG sticker illustrations
└── src/
├── App.tsx # Root application shell & cross-tab sync coordinator
├── index.css # Field-journal design tokens & responsive styles
├── types/ # TypeScript interfaces (Trace, Sticker, Media)
├── services/ # Frontend API clients (api.ts, traceService.ts, stickerService.ts)
├── hooks/ # Custom React hooks (useStreak, useHealthStatus)
└── features/
├── map/ # Living Trace Map, markers, detail card, thumbnails
├── ai/ # TraceAIInterpreter creation form & category lens chips
└── stickers/ # StickerGardenJourney, StickerDetailModal, DailyRewardModal
🧪 Test Suite & Quality Verification
The backend test suite covers trace persistence, AI failure resiliency, audio/photo uploads, read-only streak summaries, and category precedence rules:
# From the backend/ directory with .venv active
.\.venv\Scripts\pytest.exe -vCurrent test suite: 103 passed tests across test_traces.py, test_stickers.py, test_attachments.py, test_ai.py, and test_health.py.
Verify strict TypeScript compilation across the entire frontend application:
# From the frontend/ directory
npm run typecheckVerify asset bundling, tree-shaking, and minification:
# From the frontend/ directory
npm run build🔧 Practical Troubleshooting Guide
| Symptom | Probable Cause | Diagnostic & Resolution Steps |
|---|---|---|
Local AI unavailable badge in capture card |
LM Studio is closed or server is stopped on port 1234. | 1. Open LM Studio. 2. Navigate to the Local Server tab ( <->).3. Select Gemma 3 4B and click Start Server. 4. TRACE continues functioning normally without AI—simply click "Place trace without AI". |
TRACE AI took too long to respond (504) |
Local model inference exceeded timeout. | 1. Increase LM_STUDIO_TIMEOUT_SECONDS=60.0 in .env.2. Select a smaller model quantization (e.g. Q4_K_M) in LM Studio. |
[Errno 10048] address already in use |
Port 8000 is occupied by another process. | 1. Terminate the conflicting process. 2. Or start on another port: uvicorn app.main:app --port 8001 --reload (update CORS origins accordingly). |
Port 5173 is in use |
Another Vite dev server is running. | Vite will automatically suggest port 5174. Accept or terminate the extra server. |
File is empty or too small (415) |
Uploaded file failed magic-byte header inspection. | Ensure the file is a genuine JPEG, PNG, WebP, GIF, MP3, WAV, OGG, WebM, AAC, or FLAC recording. |
File exceeds maximum upload size (413) |
Media file exceeds 15 MB. | Compress the recording or raise TRACE_MAX_UPLOAD_SIZE_BYTES in backend .env. |
| Browser geolocation prompt denied | Location access was denied in browser permissions. | Choose Drop Pin on Map (manual placement) or Keep Unplaced, or reset permissions in browser site settings. |
| Sticker displays a stamp placeholder | Artwork for that catalogue sticker is currently in illustration. | This is the intended fallback behavior. Stickers without dedicated PNG artwork render an archival field stamp until illustrations are added. |
TRACE is designed from first principles as a sovereign, local-first system:
- Local Relational Storage: All traces, notes, coordinates, sensory types, and timestamps are persisted in
runtime/traces.db(SQLite). Foreign keys (ON DELETE CASCADE) and Write-Ahead Logging (WAL) guarantee reliability and clean data integrity. - Local Media Sandboxing: Uploaded field photographs and audio captures are stored in
runtime/media/using random UUID filenames. - Zero Telemetry: TRACE does not include tracking scripts, Google Analytics, telemetry beacons, or advertising SDKs.
- Offline Cartography Note: While observations and AI processing run 100% locally on your machine, the Leaflet map fetches public OpenStreetMap tiles over the internet when connected.
- No Cloud Sync or Accounts: There are no remote user accounts or multi-user cloud synchronization services. Your field notes remain strictly on your computer.
- Sticker Artwork Coverage: High-resolution botanical and creature illustrations are currently bundled for
Tiny Sprout,Rock Lichen, andUnscheduled Snail. Other catalogue items display the field-journal stamp fallback until additional artwork is illustrated. - Local Model Hardware: Quality and speed of AI titles, summaries, and tags depend on the computing capacity of your machine. Google Gemma 3 4B is recommended for optimal speed and poetic observation synthesis.
- Cartographic Tile Fetching: The Leaflet map engine requires an internet connection to stream OpenStreetMap tiles unless an offline tile server is configured.
- Single-Explorer Architecture: TRACE is designed as a personal field notebook. Multi-user accounts, social feeds, and cloud sync are intentionally omitted by design.
We warmly welcome contributions from developers, writers, field naturalists, and designers who share our love for noticing the living world!
- Fork the Repository: Create a personal fork of
shiriei/TRACEon GitHub. - Create a Topic Branch:
git checkout -b feature/sensory-audio-visualizer
- Make Focused Changes: Preserve the vintage field-journal aesthetic, local-first sovereignty, and clean TypeScript/Python types.
- Run Verification Commands:
# Backend cd backend && pytest -v # Frontend cd ../frontend && npm run typecheck && npm run build
- Submit a Pull Request: Detail your changes, testing methodology, and motivations.
The following exploratory horizons reflect potential future evolutions for TRACE:
- Spatial Territory Frontiers: Visualizing unexplored pockets and alleys in your immediate neighborhood where you have not yet left a trace.
- Adaptive Curiosity Cues: Subtle, enigmatic prompts inspired by your personal trace history (e.g., "You notice old masonry often. What sounds live near the brickwork?").
- Offline Map Tile Caching: Local tile caching to enable completely disconnected field exploration in remote valleys and forests.
- Expanded Catalogue Artwork: Additional hand-illustrated sticker rewards celebrating slow observation.
TRACE is open-source software licensed under the MIT License.
Copyright (c) 2026 TRACE Contributors
You are free to use, modify, distribute, and study this software in accordance with the terms of the MIT license.
TRACE was created for anyone who has ever walked past an old mossy wall, an overgrown alleyway, or an echo beneath a railway bridge and thought:
I want to remember that this was here.


