Skip to content

OMZaky/Tripzy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌍 Tripzy - Travel Booking Platform

A modern, full-stack travel booking platform built with Next.js 14, TypeScript, and Firebase. Features hotel bookings with room selection, flight reservations, and car rentals - all with a beautiful, responsive UI inspired by Booking.com.

Next.js TypeScript Firebase Tailwind CSS


✨ Features

🏨 Hotels

  • Room Selection Table - Booking.com-style room picker with multiple room types
  • Dynamic Pricing - Prices update based on nights and room selection
  • Instant Booking - Skip approval, proceed directly to payment
  • 7 Room Types - Standard, Superior, Deluxe, Twin, Family Suite, Executive, Presidential

✈️ Flights

  • Flight Search - Filter by origin, destination, cabin class
  • Ticket-style Cards - Beautiful horizontal flight cards
  • Instant Confirmation - Book and pay immediately

πŸš— Car Rentals

  • Multiple Categories - Economy, Compact, SUV, Luxury, Van
  • Detailed Specs - Seats, transmission, fuel type, mileage
  • Insurance Options - Clear display of included coverage

πŸ‘€ User Roles

Role Capabilities
Traveler Search, book, pay, view trips
Owner List properties, manage bookings
Admin Approve listings, manage users, view all bookings

πŸ’³ Booking Flow

  • Instant Book (Hotels, Flights, Cars) β†’ Payment β†’ Confirmed
  • Request to Book (Private Properties) β†’ Owner Approval β†’ Payment β†’ Confirmed

πŸš€ Getting Started

Prerequisites

  • Node.js 18+
  • npm or yarn
  • Firebase project

Installation

  1. Clone the repository

    git clone https://github.com/OMZaky/Main_Tripzy.git
    cd Main_Tripzy
  2. Install dependencies

    npm install
  3. Set up environment variables

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

    NEXT_PUBLIC_FIREBASE_API_KEY=your_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.appspot.com
    NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
    NEXT_PUBLIC_FIREBASE_APP_ID=your_app_id
  4. Run the development server

    npm run dev
  5. Open in browser

    http://localhost:3000
    

πŸ“ Project Structure

tripzy/
β”œβ”€β”€ app/                    # Next.js App Router pages
β”‚   β”œβ”€β”€ page.tsx           # Homepage
β”‚   β”œβ”€β”€ search/            # Search results page
β”‚   β”œβ”€β”€ stays/[id]/        # Hotel detail page
β”‚   β”œβ”€β”€ flights/[id]/      # Flight detail page
β”‚   β”œβ”€β”€ cars/[id]/         # Car detail page
β”‚   β”œβ”€β”€ checkout/[id]/     # Payment checkout
β”‚   β”œβ”€β”€ trips/             # User bookings
β”‚   β”œβ”€β”€ dashboard/         # Owner dashboard
β”‚   β”œβ”€β”€ admin/             # Admin portal
β”‚   └── login/             # Authentication
β”œβ”€β”€ components/            # Reusable components
β”‚   β”œβ”€β”€ property/          # Property-specific components
β”‚   β”‚   └── RoomTable.tsx  # Room selection table
β”‚   β”œβ”€β”€ Navbar.tsx
β”‚   β”œβ”€β”€ Footer.tsx
β”‚   └── Toast.tsx
β”œβ”€β”€ lib/                   # Utilities and services
β”‚   β”œβ”€β”€ data/              # Data generators
β”‚   β”‚   β”œβ”€β”€ generators.ts  # Hotel/Flight/Car generators
β”‚   β”‚   └── constants.ts   # Static data
β”‚   β”œβ”€β”€ firebase.ts        # Firebase configuration
β”‚   β”œβ”€β”€ bookingService.ts  # Booking CRUD operations
β”‚   β”œβ”€β”€ adminService.ts    # Admin operations
β”‚   └── mockData.ts        # Generated mock data
β”œβ”€β”€ hooks/                 # Custom React hooks
β”‚   └── useAuthStore.ts    # Zustand auth store
β”œβ”€β”€ types/                 # TypeScript interfaces
β”‚   └── index.ts           # All type definitions
└── public/                # Static assets

πŸ› οΈ Tech Stack

Category Technology
Framework Next.js 14 (App Router)
Language TypeScript
Styling Tailwind CSS
State Zustand
Auth Firebase Authentication
Database Firebase Firestore
Icons Lucide React

πŸ” Firebase Setup

  1. Go to Firebase Console
  2. Create a new project
  3. Enable Authentication with Google Sign-in
  4. Create a Firestore Database
  5. Copy your config to .env.local

Firestore Security Rules

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /users/{userId} {
      allow read, write: if request.auth != null && request.auth.uid == userId;
    }
    match /bookings/{bookingId} {
      allow read, write: if request.auth != null;
    }
  }
}

πŸ“ Available Scripts

Command Description
npm run dev Start development server
npm run build Build for production
npm run start Start production server
npm run lint Run ESLint

🎨 Key Components

RoomTable

Booking.com-style room selection with:

  • Room type details (name, bed type, size)
  • Capacity icons
  • Per-night and total pricing
  • Quantity dropdown (limited by availability)
  • Sticky footer with selection summary

BookingWidget

Sidebar booking form with:

  • Date pickers
  • Guest counter
  • Price breakdown
  • Instant Book button

🀝 Contributing

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

πŸ“„ License

This project is open source and available under the MIT License.


πŸ‘¨β€πŸ’» Author

OMZaky


πŸ™ Acknowledgments

About

A comprehensive travel booking application providing a unified platform for hotel reservations, flight scheduling, and car rentals. Built with a focus on scalable software architecture and clean design patterns.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages