A Next.js 15 application that intelligently discovers points of interest along your travel routes. Plan personalized journeys with multiple travel modes, customizable POI preferences, and smart time management to make the most of every trip.
A Demo site can be found here
- Driving: Traffic-aware routing with car-accessible POIs
- Walking: Local discoveries within walking distance
- Public Transport: Intelligent fallback system with global coverage - works worldwide even in areas with limited transit data
- Cycling: Bike-friendly paths and destinations
- Customizable Categories: Choose from 8 categories (Restaurants, Museums, Parks, Shopping, Attractions, Entertainment, Culture, Outdoors)
- Time-Based Filtering: Only shows POIs where you actually have time to visit
- Available Time Calculation: Shows exactly how many minutes you can spend at each location
- Intelligent Research: Remove unwanted places and discover fresh alternatives
- Time Validation: Prevents impossible itineraries by checking route duration against available time
- Per-POI Time Allocation: Calculates visit time for each destination
- Smart Exclusion: Automatically filters out locations with no available time
- POI Removal & Research: Remove places you don't want and find new options
- Detailed Route Views: Click any POI for step-by-step directions and timing
- Travel Mode Optimization: Different POI types and search radiuses per travel mode
- Interactive Maps: Embedded Google Maps with route visualization
- Global Public Transport: Smart fallback system that works in Tokyo, New York, London, and anywhere with walking data
- Robust Error Handling: Graceful degradation when APIs fail or data is unavailable
- Framework: Next.js 15 with TypeScript
- Styling: Tailwind CSS v4 with dark theme
- Authentication: Clerk
- Maps & Routing: Google Maps API (Places, Routes, Directions)
- Development: Turbopack for fast development builds
- Node.js 18+ and npm
- Google Maps API key with the following APIs enabled:
- Places API (Text Search and Nearby Search)
- Routes API
- Maps Embed API
- Clerk account for authentication
- Clone the repository:
git clone <repository-url>
cd route-explorer- Install dependencies:
npm install- Set up environment variables:
Create a
.env.localfile with:
GOOGLE_MAPS_API_KEY=your_google_maps_api_key
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key
CLERK_SECRET_KEY=your_clerk_secret_key
- Start the development server:
npm run devOpen http://localhost:3000 in your browser.
npm run dev- Start development server with Turbopacknpm run build- Create production buildnpm start- Start production servernpm run lint- Run ESLint with Next.js config
βββ app/
β βββ api/
β β βββ locations/ # Main route and POI calculation API
β β βββ detailed-route/ # Detailed route through specific POI
β β βββ research-pois/ # Alternative POI discovery
β βββ app/ # Protected main application page
β βββ sign-in/ # Authentication pages
β βββ sign-up/
βββ components/
β βββ ClientPage.tsx # Main state container with POI management
β βββ PlanYourAdventure.tsx # Route planning form with POI preferences
β βββ RouteResults.tsx # Results display with removal/research features
β βββ RouteMap.tsx # Google Maps embed
β βββ ReadySection.tsx # Landing page CTA
βββ types/ # Organized TypeScript interfaces
β βββ location.ts # Location and coordinate types
β βββ poi.ts # Point of Interest and preference types
β βββ route.ts # Route and travel mode types
β βββ form.ts # Form input types
β βββ components.ts # Component prop interfaces
β βββ api.ts # API request/response types
β βββ index.d.ts # Main export file and legacy types
βββ lib/
β βββ apiKey.ts # Google Maps API key utility
βββ middleware.ts # Clerk authentication middleware
- Location Input: Enter start and destination locations
- Travel Mode Selection: Choose from driving, walking, public transport, or cycling
- Time Budget: Set available time in minutes
- POI Preferences: Select from 8 categories of interests
- Time Validation: Ensures route is possible within time budget
- Geocoding: Converts location text to coordinates using Google Places API
- Route Calculation: Uses Google Routes API (driving/walking/cycling) or Directions API (transit)
- Public Transport Fallback: When transit data unavailable, estimates times using walking routes (40% of walking time)
- POI Discovery: Searches for places matching selected categories near route midpoint
- Time Analysis: Calculates actual travel time through each POI
- Smart Filtering: Only shows POIs with available visit time
- POI Cards: Display places with available time, travel time, and ratings
- Detailed Routes: Click any POI for step-by-step directions
- POI Removal: Remove unwanted places with β button
- Research Mode: Find alternative POIs excluding removed ones
- Interactive Maps: Embedded Google Maps with route visualization
/api/locations: Main route and POI calculation/api/detailed-route: Detailed routing through specific POI/api/research-pois: Alternative POI discovery with exclusions
- Places Text Search: Location geocoding
- Routes API v2: Modern routing for driving/walking/cycling
- Directions API: Legacy API optimized for transit routing
- Places Nearby Search: POI discovery with custom categories
- Maps Embed: Route and POI visualization
- Dynamic API Selection: Uses optimal Google API based on travel mode
- Public Transport Intelligence: Automatic fallback system for global transit coverage
- Time-based Filtering: Only viable POIs are shown
- Exclusion System: Prevents showing removed POIs in research
- Category Mapping: Translates user preferences to Google Place types
- Error Recovery: Handles API failures and unsupported location types gracefully
- Public Routes:
/,/sign-in,/sign-up - Protected Routes:
/app(requires authentication) - Middleware: Clerk handles route protection automatically
- Landing Page with modern UI
- Clerk Authentication (Sign-in/Sign-up)
- Multi-modal Route Planning (Drive/Walk/Transit/Cycle)
- Customizable POI Category Selection
- Time Budget Management and Validation
- Smart POI Discovery with Time Calculations
- Interactive Google Maps Integration
- Mobile-Responsive Design
- POI Removal and Research System
- Detailed Route Views with Step-by-Step Directions
- Time-based POI Filtering
- Travel Mode Optimization
- Global Public Transport Support with Intelligent Fallback
- Alternative POI Discovery
- Exclusion-based Research
- Dynamic API Selection
- TypeScript Interface Organization
- Robust Error Handling and Recovery
- Glassmorphism Dark Theme
- Smooth Animations and Transitions
- Loading States and Error Handling
- Intuitive POI Management
- Visual Feedback and Tooltips
- Fork the repository
- Create a feature branch
- Make your changes
- Run
npm run lintto check code style - Submit a pull request