Skip to content

Tanishq4501/PuneWanderer

Repository files navigation

πŸ—ΊοΈ PuneWanderer

GraphRAG Trip Planner 2820+ Places Next.js TypeScript Neo4j

AI-Powered Travel Planning with Knowledge Graphs & RAG

PuneWanderer is an intelligent travel planning application that helps you discover and explore Pune's best places using advanced AI, Knowledge Graphs, and Retrieval-Augmented Generation (RAG). Plan personalized itineraries, visualize routes on interactive maps, and get smart recommendations powered by GraphRAG.

PuneWanderer Landing Page


✨ Features

πŸ€– AI-Powered Chat Assistant

  • Natural language trip planning
  • Context-aware recommendations
  • Multi-turn conversations with memory
  • Intent classification for accurate responses

Chat Interface

πŸ—ΊοΈ Interactive Map Explorer

  • 2820+ Places visualized with marker clustering
  • Real-time map rendering with Leaflet.js
  • Category-based filtering (cafes, restaurants, parks, temples, etc.)
  • Route visualization with neon-glow paths
  • Dark theme with glassmorphism UI

Map Explorer

πŸ“Š Knowledge Graph Integration

  • Neo4j graph database for connected data
  • GraphRAG for intelligent retrieval
  • Relationship-based recommendations
  • Subgraph exploration

πŸ“… Trip Calendar

  • Visual itinerary planning
  • Day-by-day schedule management
  • Drag-and-drop interface

Trip Calendar

🎨 Modern UI/UX

  • Dark glassmorphism design
  • Smooth animations with Framer Motion
  • Three.js particle backgrounds
  • Responsive layout for all devices

πŸ—οΈ Architecture

graph TB
    A[User Query] --> B(Intent Router)
    B --> C[GraphRAG<br/>Neo4j + Vector]
    B --> D[Agent Tools<br/>Calendar/Events]
    C --> E[Google Gemini LLM]
    D --> E
    E --> F[Visual Route<br/>Map + 3D Hero]
    F --> G[Interactive UI]
    
    subgraph "Data Layer"
        H[(Neo4j Graph DB<br/>2820+ Places)]
        I[(Firebase<br/>Auth & Sessions)]
    end
    
    subgraph "AI Layer"
        C
        E
    end
    
    subgraph "Presentation Layer"
        F
        G
    end
    
    C -.->|Graph Queries| H
    E -.->|User Data| I
    
    style A fill:#ec4899,stroke:#fff,stroke-width:2px,color:#fff
    style E fill:#a855f7,stroke:#fff,stroke-width:2px,color:#fff
    style G fill:#06b6d4,stroke:#fff,stroke-width:2px,color:#fff
Loading

Data Flow

  1. User Input β†’ Natural language query via chat interface
  2. Intent Classification β†’ Determines query type (itinerary, recommendation, question)
  3. GraphRAG Retrieval β†’ Fetches relevant places from Neo4j using graph traversal
  4. LLM Processing β†’ Google Gemini generates contextual responses
  5. Visualization β†’ Results displayed on map with route planning

πŸ› οΈ Tech Stack

Frontend

  • Next.js 14 - React framework with App Router
  • TypeScript - Type-safe development
  • Tailwind CSS - Utility-first styling
  • Three.js - 3D graphics and animations
  • Framer Motion - Animation library
  • Leaflet.js - Interactive maps
  • Leaflet.markercluster - Map performance optimization

Backend & Database

  • Neo4j - Graph database for places and relationships
  • Firebase - Authentication and user management
  • Vercel AI SDK - AI chat integration
  • Google Gemini - LLM for natural language processing

AI & RAG

  • GraphRAG - Graph-based retrieval augmented generation
  • Vector Search - Semantic similarity search
  • Intent Classification - User query understanding
  • Context Management - Multi-turn conversation handling

Performance Optimizations

  • Marker Clustering - Handles 2820+ map markers efficiently
  • Chunked Loading - Progressive data loading
  • Canvas Rendering - Optimized map performance
  • Code Splitting - Dynamic imports for faster load times

πŸ“Έ Screenshots

Landing Page

Landing Hero Features Section How It Works CTA Section

Authentication

Login Signup

Dashboard & Chat

Dashboard Chat Interface Chat with Recommendations

Sidebars & Settings

Chat History Configuration Settings

πŸš€ Getting Started

Prerequisites

  • Node.js 18+ and npm
  • Neo4j database (local or cloud)
  • Firebase project
  • Google Gemini API key

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/punewanderer.git
    cd punewanderer
  2. Install dependencies

    npm install
  3. Set up environment variables

    Create a .env.local file in the root directory:

    # Firebase
    NEXT_PUBLIC_FIREBASE_API_KEY=your_firebase_api_key
    NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_auth_domain
    NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id
    NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_storage_bucket
    NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
    NEXT_PUBLIC_FIREBASE_APP_ID=your_app_id
    
    # Neo4j
    NEO4J_URI=bolt://localhost:7687
    NEO4J_USER=neo4j
    NEO4J_PASSWORD=your_neo4j_password
    
    # Google Gemini
    GOOGLE_GENERATIVE_AI_API_KEY=your_gemini_api_key
    
    # Google Maps (Optional - for 3D tiles)
    NEXT_PUBLIC_GOOGLE_MAPS_KEY=your_google_maps_key
  4. Set up Neo4j database

    Import the Pune places dataset:

    # Start Neo4j
    neo4j start
    
    # Import data (example)
    LOAD CSV WITH HEADERS FROM 'file:///pune-places.csv' AS row
    CREATE (p:Place {
      place_id: row.place_id,
      name: row.name,
      category: row.category,
      lat: toFloat(row.lat),
      long: toFloat(row.long),
      rating: toFloat(row.rating),
      address: row.address
    })
  5. Run the development server

    npm run dev
  6. Open your browser

    Navigate to http://localhost:3000


πŸ“ Project Structure

punewanderer/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/                    # Next.js App Router
β”‚   β”‚   β”œβ”€β”€ page.tsx           # Dashboard (main UI)
β”‚   β”‚   β”œβ”€β”€ landing/           # Landing page
β”‚   β”‚   β”œβ”€β”€ login/             # Authentication
β”‚   β”‚   β”œβ”€β”€ signup/
β”‚   β”‚   β”œβ”€β”€ settings/
β”‚   β”‚   └── api/               # API routes
β”‚   β”‚       β”œβ”€β”€ chat/          # Chat endpoints
β”‚   β”‚       └── graph/         # Neo4j graph queries
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ chat/              # Chat UI components
β”‚   β”‚   β”œβ”€β”€ map/               # Map components
β”‚   β”‚   β”œβ”€β”€ calendar/          # Calendar components
β”‚   β”‚   β”œβ”€β”€ auth/              # Auth components
β”‚   β”‚   β”œβ”€β”€ brand/             # Logo & branding
β”‚   β”‚   β”œβ”€β”€ effects/           # Three.js effects
β”‚   β”‚   └── ui/                # Reusable UI components
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”œβ”€β”€ agent/             # AI agent logic
β”‚   β”‚   β”œβ”€β”€ rag/               # GraphRAG implementation
β”‚   β”‚   β”œβ”€β”€ db/                # Database connections
β”‚   β”‚   └── auth/              # Auth context
β”‚   β”œβ”€β”€ data/                  # Static data
β”‚   β”œβ”€β”€ shaders/               # Custom GLSL shaders
β”‚   └── utils/                 # Utility functions
β”œβ”€β”€ public/                    # Static assets
β”œβ”€β”€ screenshots/               # Project screenshots
└── .env.local                # Environment variables

🎯 Key Features Explained

1. GraphRAG Architecture

PuneWanderer uses a hybrid approach combining:

  • Graph Database (Neo4j): Stores places and their relationships
  • Vector Embeddings: Semantic search for similar places
  • LLM Integration: Natural language understanding with Google Gemini
  • Retrieval Pipeline: Multi-hop graph traversal for context-aware recommendations

2. Map Performance Optimization

Handling 2820+ markers efficiently:

  • Marker Clustering: Groups nearby markers into clusters
  • Chunked Loading: Loads markers in 200ms chunks with 50ms delays
  • Canvas Rendering: Uses Leaflet's canvas mode for better performance
  • Viewport Filtering: Only renders visible markers

3. AI Chat System

  • Intent Classification: Understands user queries (itinerary, recommendations, questions)
  • Context Management: Maintains conversation history
  • Multi-turn Conversations: Remembers previous interactions
  • Structured Responses: Returns formatted itineraries with images

4. Authentication Flow

  • Firebase Authentication with email/password
  • Google OAuth integration
  • GitHub OAuth integration
  • Protected routes with auth redirects
  • Persistent sessions

🎨 Design System

Color Palette

  • Primary: Pink (#ec4899) β†’ Purple (#a855f7) β†’ Cyan (#06b6d4)
  • Background: Dark gradients (black β†’ indigo-950 β†’ slate-900)
  • Accent: Gold (#fbbf24) for highlights
  • Text: White with varying opacity (90%, 70%, 50%, 40%)

Typography

  • Headings: Bold, gradient text effects
  • Body: Inter font family
  • Code: Monospace for technical elements

Components

  • Glassmorphism: backdrop-blur-xl with dark backgrounds
  • Animations: Smooth transitions with cubic-bezier easing
  • Shadows: Layered shadows for depth
  • Borders: Subtle white/10 borders

πŸ”§ Configuration

Map Settings

Adjust map clustering in RouteMap.tsx:

const markerClusterGroup = L.markerClusterGroup({
  maxClusterRadius: 50,        // Cluster radius in pixels
  chunkedLoading: true,        // Enable chunked loading
  chunkInterval: 200,          // Chunk processing time
  chunkDelay: 50,              // Delay between chunks
});

AI Settings

Configure AI behavior in src/lib/agent/:

  • intent-classifier.ts - Query classification
  • graph-retriever.ts - Graph traversal depth
  • chat-handler.ts - Response formatting

πŸ“Š Performance Metrics

  • Initial Load: ~2s
  • Map Rendering: 2820 places in <1s
  • Chat Response: ~2-3s (depends on LLM)
  • Bundle Size: ~500KB (gzipped)
  • Lighthouse Score: 90+ (Performance, Accessibility, Best Practices)

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments

  • Neo4j for graph database technology
  • Google Gemini for AI capabilities
  • Leaflet.js for mapping functionality
  • Vercel for hosting and deployment
  • Firebase for authentication services

πŸ“§ Contact

For questions or feedback, reach out:


Built with ❀️ for travelers exploring Pune
Powered by AI, Knowledge Graphs, and Modern Web Technologies

About

PuneWanderer is an intelligent travel planning application that helps you discover and explore Pune's best places using advanced AI, Knowledge Graphs, and Retrieval-Augmented Generation (RAG). Plan personalized itineraries, visualize routes on interactive maps, and get smart recommendations powered by GraphRAG.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors