How aiwithrajan/touchgrass works
TouchGrass is a real-world mission and habit-building app: it turns a user’s preferences, history, difficulty, and available time into a safe outdoor or social challenge, then supports an offline interval, reflection, and progression rewards. The documented frontend states are Attract, Release, and Reward; the product also exposes Social Mode, Journey Cards, voice, vitality forecasts, and agent observability. The graph follows the README’s architecture and sampled backend routes; unsampled UI and service wiring is shown only where documented, so some links are omitted.
Main entry points: main.py FastAPI Routes · App.tsx TouchGrass UI · memory_service.py Memory Service · gemma_orchestrator.py Mission Orchestrator
Components 24
User Experience
- TouchGrass UI
frontend/src/App.tsx - Attract State
frontend/src/components/AttractState.tsx - Release State
frontend/src/components/ReleaseState.tsx - Reward State
frontend/src/components/RewardState.tsx - Social Mode
frontend/src/components/SocialMode.tsx - Journey View
frontend/src/components/JourneyView.tsx - Observability Drawer
frontend/src/components/ObservabilityDrawer.tsx - API Client
frontend/src/api.ts
Mission Agent
- Mission Orchestrator
backend/app/agent/gemma_orchestrator.py - Safety & Diversity
backend/app/agent/policy_engine.py - Reflection Evaluator
backend/app/agent/reflection_eval.py
Progress & Memory
- Memory Service
backend/app/services/memory_service.py - Local JSON Store
backend/data/user_memory.json - Progression Rewards
backend/app/services/reward_service.py
API & Integrations
- FastAPI Routes
backend/app/main.py - Domain Schemas
backend/app/models/schemas.py - Voice Service
backend/app/services/voice_service.py - Vitality Forecast
backend/app/services/tabpfn_service.py - Agent Tracing
backend/app/services/sentry_service.py
Other components
- User
- Local Gemma Runtime
- ElevenLabs
- Browser Speech
- MongoDB Atlas
Connections 25
- User → TouchGrass UI: uses
README.md - TouchGrass UI → Attract State: shows mission
README.md - TouchGrass UI → Release State: starts release
README.md - TouchGrass UI → Reward State: shows reward
README.md - TouchGrass UI → API Client: requests data
README.md - API Client → FastAPI Routes: calls routes
README.md - FastAPI Routes → Memory Service: loads user
backend/app/main.py - FastAPI Routes → Mission Orchestrator: generates challenge
backend/app/main.py - Mission Orchestrator → Safety & Diversity: validates challenge
backend/app/agent/gemma_orchestrator.py - Mission Orchestrator → Local Gemma Runtime: requests generation
README.md - FastAPI Routes → Domain Schemas: uses models
backend/app/main.py - FastAPI Routes → Voice Service: requests speech
backend/app/main.py - Voice Service → ElevenLabs: synthesizes speech
backend/app/services/voice_service.py - Voice Service → Browser Speech: offers fallback
backend/app/services/voice_service.py - FastAPI Routes → Reflection Evaluator: evaluates reflection
backend/app/main.py - FastAPI Routes → Progression Rewards: calculates reward
backend/app/main.py - FastAPI Routes → Memory Service: records completion
backend/app/main.py - Memory Service → Local JSON Store: reads and writes
backend/app/services/memory_service.py - Memory Service → MongoDB Atlas: syncs data
backend/app/services/memory_service.py - FastAPI Routes → Vitality Forecast: forecasts conditions
backend/app/main.py - FastAPI Routes → Agent Tracing: records spans
backend/app/main.py - FastAPI Routes → Social Mode: serves feed
README.md - FastAPI Routes → Journey View: serves journey card
README.md - FastAPI Routes → Observability Drawer: serves trace data
README.md - Progression Rewards → Reward State: returns progression
README.md