Online platform that aims to streamline meet ups and location indecision.
Integrating location searching with carpark availability and navigation for an all encompassing solution.
This application is deployed on Vercel for production testing.
Live Demo: https://hangout-hub-ten.vercel.app/
- Framework: Next.js 14 (App Router)
- Language: TypeScript 5
- UI Library: React 18.3.1
- Styling: Tailwind CSS 4.1.9
- Component Library: Radix UI + shadcn/ui
- State Management: Zustand 5.0.8
- Form Handling: React Hook Form with Zod validation
- Icons: Lucide React, React Icons
- Map Rendering: MapLibre GL JS 5.9.0
- Geocoding: Google Places API (Text Search v1)
- Routing: OpenStreetMap Routing Machine (OSRM)
- Coordinate Conversion: svy21 (SVY21 ↔ WGS84 for Singapore data)
- Authentication: Firebase Authentication (email/password)
- Database: Cloud Firestore (NoSQL)
- Admin SDK: Firebase Admin 13.5.0
- Package Manager: npm
- CSS Processing: PostCSS 8.5, Autoprefixer
- Analytics: Vercel Analytics
Hangout Hub is a Next.js web application with a client-server architecture using Firebase as the backend.
- Frontend: React-based Next.js application with server-side rendering
- Authentication: Firebase Authentication for user login and session management
- Database: Cloud Firestore (NoSQL) storing users, meetups, invitations, and real-time locations
- State Management: Zustand for managing global application state
- Real-time Updates: Firestore listeners enable live location tracking and automatic UI updates
- External APIs:
- Google Places API for venue search and geocoding
- Singapore Data.gov.sg for HDB carpark availability
- OpenStreetMap Routing Machine (OSRM) for directions
- Users sign in via Firebase Authentication
- Application data is stored and retrieved from Firestore
- Real-time location sharing updates automatically through Firestore listeners
- Map interface displays hangout spots, parking, and live member locations
- External APIs provide venue search, parking data, and navigation
hangout-hub/
├── app/ # Next.js 14 App Router
│ ├── layout.tsx # Root layout with metadata
│ ├── page.tsx # Home page (map interface)
│ ├── api/places/ # Google Places API routes
│ ├── auth/ # Authentication pages (login, register, verify, reset)
│ ├── meetups/ # Meetups list & invitations page
│ ├── meetup/[id]/ # Individual meetup page with live map
│ ├── places/[id]/ # Place details page
│ └── profile/ # User profile management
│
├── components/ # React components
│ ├── layout/ # App-wide layout (header, auth guard, theme)
│ ├── map/ # Map components (map view, search, drawers, markers, controls)
│ ├── meetup/ # Meetup features (create, invitations, management)
│ └── ui/ # Reusable UI primitives (shadcn/ui components)
│
├── lib/ # Core business logic
│ ├── config/ # Configuration
│ │ └── firebase.ts # Firebase initialization
│ ├── auth/ # Authentication
│ │ └── auth-service.ts # Firebase auth operations (signup, login, password reset)
│ ├── models/ # Domain models (Active Record pattern)
│ │ ├── user.ts # User model with persistence methods
│ │ ├── meetup.ts # Meetup model
│ │ ├── hangoutspot.ts # Hangout location data
│ │ ├── parkingspot.ts # Parking location data
│ │ ├── invitation.ts # Invitation type definitions
│ │ └── location.ts # Location interface
│ ├── services/ # Business services
│ │ ├── db/ # Database abstraction layer
│ │ │ ├── db-service.ts # Database interface
│ │ │ ├── db-factory.ts # Factory for DB implementation
│ │ │ ├── firestore-db.ts # Firestore implementation (production)
│ │ │ └── mock-db.ts # Mock implementation (testing)
│ │ ├── google-places.ts # Google Places API wrapper
│ │ ├── carpark-api.ts # Singapore HDB carpark integration
│ │ ├── invitations.ts # Invitation management
│ │ ├── location-tracking.ts # Real-time location updates
│ │ ├── osrm.ts # OSRM routing engine
│ │ └── osrm-directions.ts # Direction calculation
│ ├── map/ # Map abstraction
│ │ ├── map-provider.tsx # Map context provider
│ │ ├── maplibre-map.ts # MapLibre wrapper
│ │ └── types.ts # Map type definitions
│ ├── utils/ # Utility functions
│ └── constants/ # Application constants
│
├── hooks/ # React hooks
│ ├── user-store.ts # Zustand user state management
│ └── use-toast.ts # Toast notification hook
│
├── public/ # Static assets
│ ├── manifest.json # PWA manifest
│ └── singapore-boundary.json # GeoJSON for Singapore boundary
│
└── Configuration files
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript configuration
├── next.config.mjs # Next.js configuration
├── tailwind.config.js # Tailwind CSS configuration
├── postcss.config.mjs # PostCSS configuration
└── .env.local # Environment variables
app/- Next.js pages and API routes using the App Router architecturecomponents/- Reusable React components organized by feature (layout, map, meetup, UI)lib/models/- Domain models with business logic that delegate persistence to database strategieslib/services/- Business logic and external service integrationslib/services/db/- Database abstraction layer implementing Strategy Pattern:db-service.ts- Interface defining database contract (DBInterface)db-factory.ts- Factory for selecting database strategy at runtimefirestore-db.ts- Firestore strategy implementation (production)mock-db.ts- Mock strategy implementation (testing)
hooks/- Custom React hooks for state management and UI interactions, including Observer pattern for reactive updates
- Node.js: Version 18.x or higher
- npm: Version 9.x or higher
- Firebase Project: Active Firebase project with Authentication and Firestore enabled
- API Keys: Google Places API key, Singapore Data.gov.sg HDB Carpark resource ID
-
Clone the repository:
git clone <repository-url> cd hangout-hub
-
Install dependencies:
npm install
-
Configure environment variables:
Create a
.env.localfile in the root directory with the following variables:# Google Places API NEXT_PUBLIC_GOOGLE_PLACES_API_KEY=your_google_places_api_key # Singapore HDB Carpark Data NEXT_PUBLIC_HDB_CARPARK_RESOURCE_ID=d_23f946fa557947f93a8043bbef41dd09 # Firebase Configuration NEXT_PUBLIC_FIREBASE_API_KEY=your_firebase_api_key NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_project.firebasestorage.app NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_sender_id NEXT_PUBLIC_FIREBASE_APP_ID=your_app_id NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=your_measurement_id # Application URL (for email verification links) NEXT_PUBLIC_APP_URL=http://localhost:3000
-
Run the development server:
npm run dev
-
Open your browser:
Navigate to
http://localhost:3000
The application uses Cloud Firestore with the following collections:
-
users- User profilesid(string) - User UID from Firebase Authname(string) - Display nameemail(string) - Email addresscurrentLocation(array | null) - [longitude, latitude]meetupIds(array) - Array of meetup IDs user is part ofcreatedAt,updatedAt(timestamp)
-
meetups- Meetup dataid(string) - Auto-generated document IDtitle(string) - Meetup titledateTime(timestamp) - Scheduled date and timedestination(object) - HangoutSpot details (name, coordinates, address, etc.)creatorId(string) - User ID of creatormemberIds(array) - Array of member user IDsmembers(object) - Map of userId to member status (traveling/arrived, location sharing settings)
-
invitations- Meetup invitationsid(string) - Auto-generated document IDmeetupId(string) - Associated meetup IDsenderId,recipientId(string) - User IDsstatus(string) - "pending" | "accepted" | "rejected"sentAt,respondedAt(timestamp)
-
locations- Real-time location trackinguserId(string) - User IDmeetupId(string) - Associated meetup IDlatitude,longitude(number) - Coordinatestimestamp(timestamp) - Last update time
- Hangout Spot Discovery - Search for venues across Singapore using Google Places API with geofencing
- Parking Integration - Real-time HDB carpark availability from Singapore Data.gov.sg
- Group Meetups - Create and manage meetups with up to 5 members
- Invitations System - Send, accept, and reject meetup invitations
- Real-Time Location Tracking - Optional location sharing with live map updates for meetup members
- Directions & Navigation - Route planning using OSRM with distance and duration calculations
- Authentication & User Management - Secure email/password authentication with email verification
- Responsive Design - Desktop (split-screen with sidebars) and mobile (bottom drawer) layouts
- Google Places API (v1) - Venue search, autocomplete, place details
- Singapore Data.gov.sg - HDB carpark information and availability
- OpenStreetMap Routing Machine (OSRM) - Route calculation and navigation
- Firebase Authentication - User authentication and session management
- Cloud Firestore - NoSQL database for all application data