A Next.js + React app that integrates Google Maps with AI-powered location discovery using Ollama. Displays interesting Manhattan locations discovered by local language models.
- Interactive Google Maps centered on downtown Manhattan
- AI-powered location discovery via Ollama LLM integration
- Custom markers for AI-suggested venues
- Responsive design with dark mode support
- Graceful fallback when API keys are missing
- Local-first architecture - runs locally with Ollama
-
Google Maps API Key (required)
- Get one from Google Cloud Console
- Enable Maps JavaScript API and Geocoding API
-
Ollama (optional but recommended)
- Download from ollama.ai
- Ensure it's running locally (default:
http://localhost:11434)
Copy .env.example to .env.local and fill in the required values:
cp .env.example .env.localNEXT_PUBLIC_GOOGLE_MAPS_API_KEY- Your Google Maps API key (required for map to display)
NEXT_PUBLIC_OLLAMA_BASE_URL- Ollama endpoint (default:http://localhost:11434)NEXT_PUBLIC_OLLAMA_MODEL- Ollama model to use (default:llama2)
-
Install dependencies:
npm install
-
Set up environment variables:
# Edit .env.local with your Google Maps API key NEXT_PUBLIC_GOOGLE_MAPS_API_KEY=your_key_here -
(Optional) Start Ollama:
ollama serve # In another terminal, pull a model: ollama pull llama2 # or any other available model
-
Run the development server:
npm run dev
-
Open http://localhost:3000 in your browser
- The map displays downtown Manhattan by default
- Click "Discover Locations" to fetch AI-suggested venues
- Click on location names to pan the map
- Markers are placed at coordinates returned by the AI
app/page.tsx # Main page component
components/MapContainer.tsx # Google Maps + Ollama integration
lib/ollama.ts # Ollama API client
types/location.ts # TypeScript types
- Google Maps renders an interactive map centered on downtown Manhattan
- Ollama generates location suggestions using a local LLM
- Markers are placed on the map at the coordinates returned by Ollama
- UI Panel displays discovered locations and error states
- All environment variables are public (
NEXT_PUBLIC_prefix) since they're client-side - Ollama connectivity is graceful - errors don't break the app
- The map shows a helpful message if the Google Maps API key is missing
- Works offline once the map tiles are cached