Discover amazing places near you with intelligent AI-powered search and ranking
- Python 3.8+
- Node.js 18+
- API Keys (see Configuration)
# Clone the repository
clone the repo
cd pathly
# Set up environment variables
cp .env.example .env
# Edit .env with your API keys (see Configuration section)
# Install backend dependencies
pip install -r requirements.txt
# Install frontend dependencies
cd frontend
npm install
cd ..
# Start the backend server
python api_server.py
# In a new terminal, start the frontend
cd frontend
npm run devπ That's it! Open http://localhost:3000 to see Pathly in action.
pathly/
βββ π frontend/ # Next.js React application
β βββ π src/
β β βββ π app/ # Next.js App Router
β β β βββ layout.tsx # Root layout
β β β βββ page.tsx # Main page component
β β β βββ π api/ # API routes
β β βββ π components/ # React components
β β β βββ Header.tsx # Navigation header
β β β βββ HeroSection.tsx # Landing/search section
β β β βββ ChatInterface.tsx # Search interface
β β β βββ ResultsSection.tsx # Results display
β β β βββ StaticMap.tsx # Google Maps integration
β β β βββ CitySelector.tsx # City selection
β β βββ π utils/ # Utility functions
β β β βββ cache.ts # Search result caching
β β β βββ prefetch.ts # Background prefetching
β β βββ π types/ # TypeScript definitions
β βββ package.json # Frontend dependencies
β βββ next.config.ts # Next.js configuration
βββ π src/ # Python backend modules
β βββ fsgm.py # Foursquare + Google search
β βββ ranking.py # AI-powered ranking
β βββ userLocation.py # Location utilities
β βββ errors.py # Error handling
βββ π data/ # Data storage directory
βββ api_server.py # Flask API server
βββ diagnose_api.py # Diagnostic tool
βββ requirements.txt # Python dependencies
βββ .env # Environment variables
βββ README.md # This file
Create a .env file in the root directory:
# API Keys and Configuration
GROQ_API_KEY=your_groq_api_key_here
FOURSQUARE_API_KEY=your_foursquare_api_key_here
SERPAPI_KEY=your_serpapi_key_here
# Default Configuration
DEFAULT_LATITUDE=26.9240
DEFAULT_LONGITUDE=75.8267
DEFAULT_TIMEZONE=UTC
# Server Configuration
SERVER_HOST=127.0.0.1
SERVER_PORT=5000
# AI Model Configuration
GROQ_MODEL=openai/gpt-oss-120b- Visit Groq Console
- Sign up for a free account
- Generate an API key
- Free tier includes generous usage limits
- Visit Foursquare Developers
- Create a new app
- Get your API key from the app dashboard
- Free tier: 1,000 requests/day
- Visit SerpAPI
- Sign up for an account
- Get your API key from dashboard
- Free tier: 100 searches/month
# Add to .env for enhanced map features
NEXT_PUBLIC_GOOGLE_MAPS_API_KEY=your_google_maps_api_key_here# Create virtual environment (recommended)
python -m venv venv
# Activate virtual environment
# Windows:
venv\Scripts\activate
# macOS/Linux:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Verify installation
python diagnose_api.pycd frontend
# Install dependencies
npm install
# Verify installation
npm run build# Terminal 1: Backend (Flask)
python api_server.py
# Server runs on http://localhost:5000
# Terminal 2: Frontend (Next.js)
cd frontend
npm run dev
# Frontend runs on http://localhost:3000python diagnose_api.pyThis tool checks:
- Server connectivity
- API key validity
- Search functionality
- AI ranking system
- Open browser dev tools
- Check Network tab for API calls
- Look for console errors
- Verify location permissions
We welcome contributions! Here's how to get started:
This project is licensed under the MIT License - see the LICENSE file for details.
- Foursquare: Place data and venue information
- Google: Maps and local search data
- Groq: AI model hosting and inference
- Next.js Team: Amazing React framework
- Flask Team: Lightweight Python web framework
β Star this repository if you found it helpful!
Built with β€οΈ for explorers who want to discover amazing places with the power of AI