A modern, full-stack Next.js application that revolutionizes place discovery through intelligent filtering and interactive mapping. StarMap helps users find restaurants, hotels, tourist attractions, shopping centers, and healthcare facilities based on personalized preferences including star ratings, location proximity, and place types.
- πΊοΈ Interactive Maps: Advanced Google Maps integration with custom markers and rich info windows
- π Smart Search: Advanced place discovery with real-time filtering and caching
- π€ User Accounts: Secure authentication with JWT tokens and persistent search history
- π± Mobile-First: Responsive design with touch interactions and burger menu navigation
- π Global Coverage: Search any city or region worldwide with geocoding support
- π Performance: Optimized API calls with debouncing, caching, and smart result limits
- β Advanced Search Engine: Multi-criteria place discovery with real-time results
- β Interactive Map Interface: Google Maps with custom advanced markers and info windows
- β Intelligent Filtering: Filter by place type, star ratings (1-5), and search radius (1-10km)
- β Global Location Support: Search any city/region worldwide or use GPS location
- β Rich Place Details: Photos, ratings, addresses, and direct Google Maps navigation
- β Secure Authentication: JWT-based login/register with HTTP-only cookies
- β Persistent Preferences: Cloud storage for authenticated users, local storage for guests
- β Search History: Database-stored search history with detailed statistics and replay
- β Responsive Design: Mobile-optimized with animated burger menu and touch interactions
- β Performance Optimization: Smart caching, debouncing, and API call optimization
- β Accessibility: Keyboard navigation, screen reader support, and semantic HTML
- β Real-time Geocoding: Convert addresses to coordinates with intelligent caching
- β Advanced Markers: Custom Google Maps markers with info windows and photos
- β State Management: React Context API with custom hooks for complex state
- β Error Handling: Comprehensive error boundaries and user-friendly error messages
- β SEO Optimization: Structured data, meta tags, and OpenGraph integration
- β Analytics Ready: Google Analytics integration and performance monitoring
- Framework: Next.js 14 (App Router)
- Language: TypeScript/JavaScript
- Database: PostgreSQL with Prisma ORM
- Authentication: JWT tokens with HTTP-only cookies
- Maps: Google Maps API with Places API
- Styling: CSS Modules
- State Management: React Context API + Hooks (useState, useEffect)
- Storage: localStorage (client-side) + PostgreSQL (server-side)
- Icons: Lucide React Icons
- Animations: Framer Motion & GSAP
- Spinners: React Spinners
- Fonts: Geist Sans & Geist Mono
src/app/
βββ layout.tsx # Root layout with global header and AuthProvider
βββ page.tsx # Home page with landing content
βββ MainPageClient.tsx # Client component for home page animations
βββ globals.css # Global styles and CSS variables
βββ AuthProvider.tsx # Authentication context provider
βββ StructuredData.tsx # SEO structured data component
βββ components/
β βββ Header.tsx # Navigation header with auth and mobile menu
β βββ Header.module.css # Header styles with responsive design
β βββ Logo.tsx # Logo component
βββ preferences/
β βββ page.tsx # Server component with metadata
β βββ PreferencesClient.tsx # Client component for preferences form
β βββ Preferences.module.css # Preferences styles
βββ map/
β βββ page.tsx # Server component with metadata
β βββ MapClient.tsx # Interactive map with markers and sidebar
β βββ Map.module.css # Map styles
βββ history/
β βββ page.tsx # Server component with metadata
β βββ HistoryClient.tsx # Search history management
β βββ History.module.css # History styles
βββ auth/
β βββ login/
β β βββ page.tsx # Login server component
β β βββ LoginClient.tsx # Login form with validation
β β βββ Login.module.css # Login styles
β βββ register/
β βββ page.tsx # Register server component
β βββ RegisterClient.tsx # Registration form
β βββ Register.module.css # Registration styles
βββ api/
βββ auth/
β βββ login/route.ts # Login API endpoint
β βββ register/route.ts # Registration API endpoint
β βββ me/route.ts # User profile endpoint
βββ search-history/
βββ route.ts # Search history CRUD operations
src/hooks/
βββ useGoogleMap.tsx # Google Maps initialization and management
βββ usePlacesSearch.tsx # Places API with caching and optimization
βββ useSearchHistory.tsx # Search history database operations
βββ useIsMobile.tsx # Mobile breakpoint detection hook
src/lib/
βββ CookieBanner.tsx # GDPR cookie consent banner
βββ auth.ts # JWT token utilities
- Node.js 18+
- npm, yarn, pnpm, or bun
- Clone the repository:
git clone <repository-url>
cd starmap- Install dependencies:
npm install
# or
yarn install
# or
pnpm install- Run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev- Open http://localhost:3000 in your browser.
-
Set Preferences: Visit
/preferencesto configure your search criteria- Choose your region/city or use current location
- Select place types (restaurants, hotels, tourist attractions, shopping, healthcare)
- Set minimum star rating (1-5 stars)
- Define search radius (1-10 km)
- Click "Save & Search" to find places
-
View Map: Go to
/mapto see places matching your criteria- Interactive map with custom markers
- Click markers to see place details with photos
- Direct links to Google Maps for navigation
- Responsive sidebar with place list
-
Search History: Register/login to save your searches
- View past searches at
/history - Click any search to reload those results
- Clear history or view statistics
- View past searches at
-
Authentication: Optional but recommended
- Register at
/auth/registerfor automatic login - Login at
/auth/loginto access saved searches - All preferences sync between devices
- Register at
Create a .env.local file in the root directory:
# Google Maps API Keys
NEXT_PUBLIC_GOOGLE_MAPS_API_KEY=your_google_maps_api_key
NEXT_PUBLIC_GOOGLE_MAPS_MAP_ID=your_google_maps_map_id
# Database
DATABASE_URL=postgresql://username:password@localhost:5432/starmap_db
# Authentication
JWT_SECRET=your_jwt_secret_key
# SEO & Analytics
NEXT_PUBLIC_BASE_URL=http://localhost:3000
NEXT_PUBLIC_GOOGLE_MEASUREMENT_ID=your_ga_measurement_id
NEXT_PUBLIC_GOOGLE_VERIFICATION=your_google_verification_code- User Input β Preferences form with validation
- Geocoding β Convert locations to coordinates (cached)
- Places API β Search places with filters (debounced)
- Map Rendering β Display results with advanced markers
- Storage β Save to localStorage + database (if authenticated)
useGoogleMap: Manages Google Maps instance and initializationusePlacesSearch: Handles Places API calls with caching and optimizationuseSearchHistory: Manages database operations for search historyuseAuth: Authentication state and user managementuseIsMobile: Responsive design breakpoint detection
- API Call Reduction: Intelligent caching with 10-minute TTL
- Request Debouncing: 1-second delay to prevent excessive API calls
- Result Limiting: Maximum 15 results per search to control costs
- Smart Radius: Automatic radius optimization (max 10km)
- Coordinate Detection: Direct coordinate parsing to skip geocoding
- Basic routing and navigation
- Preferences management
- Local storage integration
- Responsive design
- Google Maps integration
- Place search API integration
- Real-time place filtering
- Place details with photos
- User authentication
- Cloud preferences sync
- User profiles
- Search history
- Favorite places system
- Advanced filters (price level, opening hours)
- Place reviews and ratings
- Social features and place sharing
- Offline mode with cached data
- Mobile app (React Native)
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Next.js
- Bootstrapped with
create-next-app - Font optimization with Geist
- Maps powered by Google Maps Platform
- Icons by Lucide
- Animations by Framer Motion
Status: π§ In Development | Version: 0.1.0 | Last Updated: January 2025