Ollama + Google Maps

Application thats show place using AI recommend + Google Maps

pythonflaskreactaigoogle-cloudgoogle-maps

Share this project:

Project Overview

🌐 Ollama + Google Maps AI Finder

image

A modern full-stack application that combines local LLM (Ollama) and Google Maps Places API to help users find places (restaurants, cafΓ©s, etc.) using natural language.

The interface uses a dark, modern Chat-AI style, built with React + Vite + Tailwind CSS, and the backend is powered by Flask (Python) with rate-limiting, caching, and secure API communication.


πŸš€ Features

  • πŸ” AI-enhanced searching (Ollama refines user query)
  • πŸ“ Google Maps Text Search integration
  • πŸ—ΊοΈ Live embedded map preview
  • πŸš— Open Google Maps directions
  • πŸŒ™ Dark AI-chat themed UI
  • ⚑ Fast thanks to Vite + Tailwind CSS
  • πŸ” Secure backend with:
    • Flask rate limiter
    • Environment variable secrets
    • CORS protection
    • API key masking
    • Request caching

πŸ—οΈ Tech Stack

Frontend

  • React (JavaScript)
  • Vite
  • Tailwind CSS
  • Modern Dark UI

Backend

  • Python Flask
  • httpx
  • Flask-Limiter
  • Flask-Caching
  • Dotenv

AI

  • Local LLM using Ollama
    (Recommended models: llama3, llama3.1, mistral, etc.)

Maps

  • Google Maps Places API
  • Google Maps Embed API

πŸ“ Project Structure

maps-ollama-projects/
β”‚
β”œβ”€β”€ backend/
β”‚ β”œβ”€β”€ app.py
β”‚ β”œβ”€β”€ requirements.txt
β”‚ β”œβ”€β”€ .env
β”‚ └── .venv/
β”‚
└── frontend/
β”œβ”€β”€ index.html
β”œβ”€β”€ postcss.config.js
β”œβ”€β”€ tailwind.config.js
β”œβ”€β”€ src/
β”‚ β”œβ”€β”€ App.js
β”‚ β”œβ”€β”€ main.js
β”‚ β”œβ”€β”€ SearchForm.js
β”‚ └── MapEmbed.js
└── package.json

πŸ”§ 1. Backend Setup (Flask)

πŸ“Œ Install dependencies

cd backend
python -m venv .venv
.\.venv\Scripts\activate    # Windows
pip install -r requirements.txt

πŸ“Œ Create .env file

GOOGLE_MAPS_API_KEY=YOUR_GOOGLE_CLOUD_API_KEY
PORT=5000
OLLAMA_URL=http://localhost:11434/api/generate

βœ” Make sure Places API is enabled βœ” Restrict key using IP (127.0.0.1 or your local network IP)

πŸ“Œ Run backend

python app.py

Backend available at:

http://localhost:5000

🎨 2. Frontend Setup (React + Vite + Tailwind)

cd frontend
npm install
npm run dev

Frontend available at:

http://localhost:5173

▢️ 3. Running the Application

Start Ollama:

ollama serve

Start backend:

cd backend
.\.venv\Scripts\activate
python app.py

Start frontend:

cd frontend
npm run dev

Open browser:

http://localhost:5173

πŸ§ͺ Example Query

Try searching:

"24h cafΓ© in Depok"
"best sushi near Surabaya"
"romantic dinner place in Jakarta"
"cheap coffee shop near UI"

Ollama will refine the query β†’ backend sends to Google β†’ results display with map.

Ollama + Google Maps | Daffathan Labs | Daffathan Labs