Stop doomscrolling, start exploring. Touch Grass transforms your mood into personalized walking routes, guiding you through adventures tailored to your vibe.
Touch Grass is a mood-based walking route generator that uses AI to understand how you're feeling and creates real walking routes with actual footpaths, POIs, and turn-by-turn directions. Whether you want a peaceful stroll through parks or a chaotic bar-hopping adventure, we've got you covered.
🤖 AI Mood Detection
- Type how you're feeling in natural language
- Gemini AI extracts your vibe and optional location mentions
- 4 unique vibes: Chill, Date, Chaos, Aesthetic
🗺️ Smart Route Generation
- Real walking routes using Google Maps Directions API
- Duration-based planning (10-120 minutes)
- Circular routes (return to start) or one-way routes
- Custom destination input for one-way routes
- POI selection based on your vibe (parks, cafes, bars, landmarks)
📍 Interactive Maps
- Beautiful map visualization with Mapbox GL
- Directional arrows showing your path
- Place markers with details and ratings
- Auto-fit to route bounds
🎨 Nature-Themed UI
- Consistent icon system with Lucide React
- Plant-growth animations for loading states
- Vibe-specific color schemes
- Responsive design for mobile and desktop
Backend
- Python 3.11 + Flask
- Google Gemini AI (mood detection)
- Google Maps Directions API (real walking routes)
- Google Places API (POI discovery)
Frontend
- React + Vite
- Mapbox GL (map visualization)
- Lucide React (icons)
- CSS3 with animations
- Python 3.11+
- Node.js 18+ and npm
- Google Gemini API key
- Google Maps API key (with Directions & Places APIs enabled)
- Mapbox access token
-
Navigate to backend and create virtual environment:
cd backend python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Create
.envfile inbackend/directory:GEMINI_API_KEY=your_gemini_api_key_here GOOGLE_MAPS_API_KEY=your_google_maps_api_key_here
-
Run the server:
python app.py
Backend runs on
http://localhost:5001
-
Navigate to frontend and install dependencies:
cd frontend npm install -
Create
.envfile infrontend/directory:VITE_MAPBOX_TOKEN=your_mapbox_token_here VITE_API_URL=http://localhost:5001/api
-
Run the development server:
npm run dev
Frontend runs on
http://localhost:5173
- Start both servers (backend and frontend)
- Open
http://localhost:5173in your browser - Allow location access when prompted
- Describe your mood in the text box (e.g., "I want to relax in Central Park")
- Click "Detect Vibe" to let AI understand your mood
- Set duration (10-120 minutes) and route type (circular or one-way)
- For one-way routes: optionally specify a destination
- Click "Start Exploring" to generate your route
- View your route on the map with turn-by-turn directions!
- Mood Detection: Gemini AI analyzes your text to determine your vibe and extract any location mentions
- Route Calculation: Based on duration and vibe, we calculate target distance using pace multipliers (chill walks slower, chaos walks faster)
- POI Selection: Google Places API finds relevant spots matching your vibe within the search radius
- Route Optimization: For circular routes, waypoints are positioned at ~120° intervals to create true loops. For one-way routes, we select intermediates between start and destination
- Directions: Google Directions API generates real walking routes with actual footpaths
- Visualization: Mapbox renders the route with directional arrows and place markers
Touch-Grass/
├── backend/
│ ├── app.py # Flask API server
│ ├── config.py # Vibe configurations
│ ├── services/
│ │ ├── ai_service.py # Gemini mood detection
│ │ ├── maps_service.py # Google Maps integration
│ │ ├── place_service.py # POI filtering
│ │ └── route_service.py # Route optimization
│ ├── utils/
│ │ └── geo_utils.py # Distance & angle calculations
│ └── requirements.txt
├── frontend/
│ ├── src/
│ │ ├── App.jsx # Main component
│ │ ├── components/ # UI components
│ │ ├── hooks/ # Custom React hooks
│ │ └── services/ # API client
│ └── package.json
└── README.md