Skip to content

Repository files navigation

FoodSpotHub

FoodSpotHub is a modern web application designed to help you discover the best food spots near your location. It features a Next.js frontend with dynamic routing and components, backed by a FastAPI backend that uses Google's Gemini LLM and Maps API to provide personalized food recommendations.

Features

  • AI-Powered Recommendations: Get tailored food spot suggestions based on your location and queries using CrewAI and Gemini 1.5 Flash.
  • Location-Aware: Automatically fetches your geolocation to find the best spots around you.
  • Modern UI: Built with Next.js and Tailwind CSS for a sleek, responsive experience.

Tech Stack

  • Frontend: Next.js (React), Tailwind CSS, Lucide React
  • Backend: Python, FastAPI, CrewAI, Langchain, Google Generative AI
  • APIs: Google Maps API (Places)

Getting Started

Prerequisites

  • Node.js (v18+)
  • Python (v3.12+)
  • API Keys:
    • GOOGLE_MAPS_API_KEY
    • GEMINI_API_KEY

Backend Setup

  1. Navigate to the backend directory:
    cd backend
  2. Create and activate a virtual environment (recommended):
    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install dependencies:
    pip install -r requirements.txt
  4. Create a .env file in the backend directory and add your keys:
    GOOGLE_MAPS_API_KEY=your_google_maps_key
    GEMINI_API_KEY=your_gemini_key
    
  5. Start the FastAPI server:
    python main.py
    The backend will run on http://127.0.0.1:8000.

Frontend Setup

  1. From the project root, navigate to the frontend code (or stay in root if that's where package.json is located):
    npm install
  2. Configure your environment variables in .env.local if necessary.
  3. Start the Next.js development server:
    npm run dev
  4. Open http://localhost:3000 in your browser.

How it Works

  1. The Next.js frontend requests the user's location via the browser's Geolocation API.
  2. It sends the coordinates to the Next.js API route (/api/ai-recommendations), which acts as a proxy.
  3. The request is forwarded to the FastAPI backend (/api/recommendations).
  4. CrewAI kicks off an agentic workflow:
    • A custom tool fetches nearby restaurants using the Google Maps API.
    • The Gemini model analyzes the data and formats a curated JSON list of recommendations.
  5. The frontend receives the data and renders it beautifully using FoodSpotCard components.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages