A modern, full-featured platform connecting travelers with passionate local guides who offer authentic, personalized experiences. Built with Next.js 16, TypeScript, and Tailwind CSS, featuring role-based authentication, booking management, payment processing, and comprehensive dashboards for tourists, guides, and admins.
- Multi-Role Authentication: Secure JWT-based authentication for Tourists, Guides, and Admins
- Tour Listings: Create, edit, and manage tour listings with rich descriptions, images, and pricing
- Advanced Search & Filtering: Search tours by destination, category, price range, language, and more
- Booking System: Complete booking workflow with availability management and status tracking
- Payment Integration: Stripe payment processing with secure checkout and payment release
- Review & Rating: Post-tour review system for tourists to rate guides
- Wishlist: Save favorite tours for later booking
- Availability Management: Guides can set specific dates and times for tour availability
- Badge System: Achievement badges for guides (Super Guide, Newcomer, Foodie Expert, etc.)
- Admin Dashboard: Comprehensive admin panel for managing users, listings, bookings, and analytics
- Responsive Design: Mobile-first design with Tailwind CSS
- Modern UI: Built with shadcn/ui and Radix UI components
- Real-time Updates: Dynamic data fetching and state management
- Form Validation: Zod schema validation for all forms
- Error Handling: Robust error handling and user feedback
- Loading States: Skeleton loaders and suspense boundaries for better UX
- Next.js 16 β React framework with App Router and Server Components
- TypeScript β Full type safety across the application
- Tailwind CSS v4 β Utility-first CSS framework
- shadcn/ui β Modern, accessible UI component library
- Radix UI β Unstyled, accessible component primitives
- React Hook Form β Performant form library
- Zod β TypeScript-first schema validation
- Stripe β Payment processing integration
- Framer Motion β Smooth animations and transitions
- TanStack Table β Powerful data table component
- date-fns β Date utility library
- Sonner β Toast notification system
- Cloudinary β Image and video storage
- vercel β Deployment platform
- Node.js 18+
- npm, yarn, pnpm, or bun
- Backend API server running (see backend repository)
# 1. Clone the repository
git clone <repository-url>
cd b5a8-client
# 2. Install dependencies
npm install
# 3. Configure environment variables
cp .env.example .env.local
# 4. Update .env.local with your configuration
NEXT_PUBLIC_BASE_API_URL=http://localhost:5000/api/v1
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_....
JWT_ACCESS_SECRET=secret
NODE_ENV=development
# 5. Run the development server
npm run devOpen http://localhost:3000 with your browser to see the result.
# Build the application
npm run build
# Start production server
npm startπ€ Dummy Users for Testing
Email and password for some dummy users:
// ADMIN
email: super@next.com
password: ph@123456
// TOURIST
email: john.tourist@localguide.com
password: tourist123
// GUIDE
email: ahmed.guide@localguide.com
password: guide123
- Card Number: 4242 4242 4242 4242
- Expiry Date: 05/2026
- CVV: 123
- Zip Code: 12345
- Country: United States
.
βββ app/
β βββ (commonLayout)/ # Public pages layout
β β βββ (auth)/ # Authentication pages
β β β βββ login/ # Login page
β β β βββ register/ # Registration page
β β β βββ forgot-password/ # Password recovery
β β β βββ verify-otp/ # OTP verification
β β βββ explore/ # Tour search and filtering
β β βββ tours/[id]/ # Tour details page
β β βββ profile/[id]/ # Public profile pages
β β βββ become-guide/ # Guide registration CTA
β β βββ payment/ # Payment pages
β β β βββ [bookingId]/ # Payment checkout
β β β βββ success/ # Payment success page
β β βββ page.tsx # Homepage
β βββ (dashboardLayout)/ # Authenticated dashboard layout
β β βββ guide/ # Guide dashboard
β β β βββ dashboard/
β β β βββ listings/ # Listing management
β β β βββ availability/# Availability management
β β β βββ payments/ # Payment management
β β βββ tourist/ # Tourist dashboard
β β β βββ dashboard/ # Bookings, wishlist
β β βββ admin/ # Admin dashboard
β β β βββ dashboard/
β β β βββ users-management/ # User management
β β β βββ listings-management/ # Listing management
β β β βββ booking-management/ # Booking management
β β βββ profile/ # User profile management
β βββ globals.css # Global styles
β βββ layout.tsx # Root layout
βββ components/
β βββ auth/ # Authentication components
β β βββ login-form.tsx
β β βββ register-form.tsx
β βββ availability/ # Availability management
β β βββ availability-client.tsx
β β βββ availability-table.tsx
β β βββ availability-create-dialog.tsx
β β βββ availability-edit-dialog.tsx
β β βββ availability-delete-dialog.tsx
β βββ dashboard/ # Dashboard components
β β βββ data-table.tsx
β β βββ dashboard-pagination.tsx
β β βββ stat-card.tsx
β βββ layout/ # Layout components
β β βββ navbar.tsx
β β βββ footer.tsx
β βββ modals/ # Modal components
β β βββ booking-confirmation-modal.tsx
β β βββ booking-details-modal.tsx
β β βββ review-modal.tsx
β βββ payments/ # Payment components
β β βββ payment-form.tsx
β β βββ payments-client.tsx
β β βββ payments-table.tsx
β β βββ payment-release-dialog.tsx
β βββ profile/ # Profile components
β β βββ profile-header.tsx
β β βββ guide-profile.tsx
β β βββ tourist-profile.tsx
β β βββ admin-profile.tsx
β β βββ edit-profile-dialog.tsx
β βββ sections/ # Homepage sections
β β βββ hero-section.tsx
β β βββ search-section.tsx
β β βββ categories-section.tsx
β β βββ destinations-section.tsx
β β βββ guides-section.tsx
β β βββ how-it-works-section.tsx
β β βββ features-section.tsx
β β βββ testimonials-section.tsx
β β βββ cta-section.tsx
β βββ tours/ # Tour components
β β βββ tour-details-client.tsx
β βββ shared/ # Shared components
β β βββ InputFieldError.tsx
β β βββ stat-card.tsx
β βββ ui/ # shadcn/ui components
β βββ button.tsx
β βββ card.tsx
β βββ dialog.tsx
β βββ input.tsx
β βββ ...
βββ services/ # API service layer
β βββ auth/ # Authentication services
β βββ listing/ # Listing services
β βββ booking/ # Booking services
β βββ payment/ # Payment services
β βββ review/ # Review services
β βββ availability/ # Availability services
β βββ wishlist/ # Wishlist services
β βββ user/ # User services
β βββ badge/ # Badge services
β βββ stats/ # Statistics services
βββ lib/ # Utility functions
β βββ auth-context.tsx # Auth context provider
β βββ auth-utils.ts # Auth utilities
β βββ server-fetch.ts # Server-side fetch helper
β βββ stripe.ts # Stripe configuration
β βββ utils.ts # General utilities
βββ types/ # TypeScript type definitions
β βββ guide.ts
β βββ profile.ts
βββ zod/ # Zod validation schemas
β βββ auth.validation.ts
β βββ listing.validation.ts
β βββ availability.validation.ts
β βββ user.validation.ts
βββ hooks/ # Custom React hooks
β βββ useDebounce.ts
βββ constants/ # Application constants
β βββ service-fee.ts
βββ public/ # Static assets
- Hero Section: Hero section with search, categories, destination filters functionality
- Search Section: Quick search bar for finding tours
- Categories Section: Browse tours by category (Food, Art, Adventure, etc.)
- Destinations Section: Featured cities and popular destinations
- Guides Section: Top-rated guides showcase
- How It Works: Step-by-step guide for using the platform
- Features Section: Platform highlights and benefits
- Testimonials Section: User reviews and testimonials
- CTA Section: Call-to-action for becoming a guide
- Registration: Role-based registration (Tourist/Guide) with profile setup
- Login: Secure email/password authentication with JWT tokens
- Password Recovery: Forgot password flow with OTP verification
- OTP Verification: Email-based OTP for password reset
- Token Management: Automatic token refresh and secure storage
- Advanced Filtering: Filter by category, city, price range, language
- Search Functionality: Full-text search across tour listings
- Pagination: Efficient pagination for large result sets
- Sorting Options: Sort by price, rating, date, etc.
- Responsive Grid: Beautiful tour card layout
- Rich Tour Information: Detailed descriptions, images, itinerary
- Guide Profile: Guide information and ratings
- Availability Calendar: View and select available dates
- Booking Widget: Select date/time and request booking
- Reviews Section: Read past traveler reviews
- Image Gallery: Multiple tour images with lightbox
- Pricing Details: Transparent pricing with service fees
- My Bookings: View upcoming and past bookings
- Booking Management: View details, cancel bookings, make payments
- Wishlist: Saved tours for later booking
- Payment History: Track all payment transactions
- Review Management: Leave reviews for completed tours
- My Listings: Create, edit, and manage tour listings
- Availability Management: Set available dates and times
- Booking Requests: Accept or decline booking requests
- Booking Management: View and manage all bookings
- Payment Tracking: View earnings and payment status
- Statistics: Tour performance and booking analytics
- User Management: View, block, and manage all users
- Listing Management: Approve, edit, or remove tour listings
- Booking Management: Monitor all bookings across the platform
- Analytics: Comprehensive statistics and revenue reports
- Badge Management: Recalculate and manage guide badges
- Profile View: Public profile with stats and reviews
- Profile Edit: Update profile information, bio, languages
- Guide-Specific: Expertise areas and daily rate
- Tourist-Specific: Travel preferences
- Image Upload: Profile picture management
- Stripe Integration: Secure payment processing
- Payment Checkout: Complete payment flow for bookings
- Payment Release: Guides can release payments after tour completion
- Payment History: Track all payment transactions
- Service Fee: Transparent service fee calculation
- Create Availability: Set specific dates and times for tours
- Bulk Creation: Create multiple availability slots at once
- Edit/Delete: Manage existing availability slots
- Quick Add: Fast availability creation interface
- Post-Tour Reviews: Tourists can review guides after completion
- Rating System: 1-5 star rating system
- Review Display: Show reviews on guide profiles and tour pages
- Review Management: Edit or delete own reviews
The frontend integrates with a comprehensive REST API. Key endpoints include:
POST /auth/register- Register new user (Tourist/Guide)POST /auth/login- User loginPOST /auth/logout- User logoutPOST /auth/refresh-token- Refresh access tokenPOST /auth/forgot-password- Request password resetPOST /auth/reset-password- Reset password with tokenPOST /auth/change-password- Change password (authenticated)
GET /users/me- Get current user profileGET /users/:id- Get user by IDPATCH /users/:id- Update user profileGET /users/top-rated-guides- Get top-rated guidesGET /users- Get all users (Admin)PATCH /users/:id/block- Block user (Admin)POST /users/create-admin- Create admin account (Admin)
GET /listings- Get all listings with filtersGET /listings/:id- Get listing by IDGET /listings/featured-cities- Get featured citiesGET /listings/categories- Get distinct categoriesGET /listings/my-listings- Get guide's listingsPOST /listings- Create listing (Guide)PATCH /listings/:id- Update listing (Guide)DELETE /listings/:id- Delete listing (Guide)
GET /availabilities- Get all availabilitiesGET /availabilities/:id- Get availability by IDGET /availabilities/my-availabilities- Get guide's availabilitiesPOST /availabilities- Create availability (Guide)POST /availabilities/bulk- Create bulk availability (Guide)PATCH /availabilities/:id- Update availability (Guide)DELETE /availabilities/:id- Delete availability (Guide)
POST /bookings- Create booking (Tourist)GET /bookings/my-bookings- Get tourist's bookingsGET /bookings/guide-bookings- Get guide's bookingsGET /bookings- Get all bookings (Admin)GET /bookings/:id- Get booking by IDPATCH /bookings/:id/status- Update booking status (Guide)
POST /payments/confirm- Confirm payment (Tourist)GET /payments/my-payments- Get user's paymentsGET /payments/booking/:bookingId- Get payment by booking IDGET /payments/:id- Get payment by IDPOST /payments/:id/release- Release payment to guide
GET /reviews- Get all reviewsGET /reviews/:id- Get review by IDPOST /reviews- Create review (Tourist)PATCH /reviews/:id- Update review (Tourist)DELETE /reviews/:id- Delete review (Tourist)GET /reviews/guide/:guideId- Get reviews by guide IDGET /reviews/reviewable-bookings- Get reviewable bookings (Tourist)
POST /wishlist- Add to wishlist (Tourist)GET /wishlist- Get wishlist (Tourist)GET /wishlist/check/:listingId- Check wishlist statusDELETE /wishlist/:listingId- Remove from wishlist (Tourist)
GET /badges/guide/:guideId- Get guide badgesPOST /badges/recalculate/:guideId- Recalculate badges (Admin)POST /badges/recalculate-all- Recalculate all badges (Admin)
GET /stats/overview- Get overview statisticsGET /stats/users- Get user statisticsGET /stats/tourists- Get tourist statisticsGET /stats/guides- Get guide statisticsGET /stats/listings- Get listing statisticsGET /stats/bookings- Get booking statisticsGET /stats/revenue- Get revenue statisticsGET /stats/profit- Get profit statistics
POST /otp/send- Send OTPPOST /otp/verify- Verify OTP
Create a .env.local file in the root directory:
# Backend API URL
NEXT_PUBLIC_BASE_API_URL=http://localhost:5000/api/v1
# Stripe Configuration
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=your_stripe_publishable_key- Browse and search tours
- View tour details and guide profiles
- Create booking requests
- Make payments
- Leave reviews after tour completion
- Manage wishlist
- View booking history
- Create and manage tour listings
- Set availability dates and times
- Accept or decline booking requests
- View booking details and manage bookings
- Track earnings and payments
- View reviews and ratings
- Manage all users (view, block, create admin)
- Manage all listings (approve, edit, delete)
- Monitor all bookings
- View comprehensive analytics and statistics
- Manage guide badges
- Access revenue and profit reports
npm run buildEnsure all environment variables are configured in your deployment platform (Vercel, Netlify, etc.)
- Backend API server must be running and accessible
- CORS must be configured to allow frontend domain
- Database must be properly configured
- Use TypeScript for all code
- Prefer
typeoverinterfacefor consistency - Use PascalCase for components and types
- Follow Next.js App Router conventions
- Use Server Components where possible
- Server Components for data fetching
- Client Components for interactivity
- Shared UI components in
components/ui/ - Feature-specific components in respective folders
- Use React Hook Form for all forms
- Validate with Zod schemas
- Display errors using
InputFieldErrorcomponent
- Use service layer in
services/directory - Handle errors gracefully
- Show loading states during API calls
- Use toast notifications for user feedback
If you see connection errors, ensure:
- Backend server is running on the configured port
NEXT_PUBLIC_BASE_API_URLis correctly set- CORS is properly configured on the backend
- Verify
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEYis set - Ensure Stripe account is properly configured
- Check browser console for detailed error messages
- Clear browser cookies
- Verify JWT token is being stored correctly
- Check token expiration and refresh logic
Faisal Akbar