An open API service indexing awesome lists of open source software.

https://github.com/himuexe/hotel-booking-website

Hotel-Booking-Website Fullstack using Typescript , Tailwind , Cloudinary , Playwright .
https://github.com/himuexe/hotel-booking-website

authentication cloudinary e2e-tests expressjs hotel-booking mongodb nodejs playwright-typescript project react search-interface sorting-visualization tailwindcss typescript vite

Last synced: about 2 months ago
JSON representation

Hotel-Booking-Website Fullstack using Typescript , Tailwind , Cloudinary , Playwright .

Awesome Lists containing this project

README

          

# ๐Ÿจ Vacays - Hotel Booking Platform

[![Build Status](https://img.shields.io/badge/build-passing-brightgreen?style=for-the-badge&logo=github-actions)](https://github.com/himuexe/Hotel-Booking-Website/actions)
[![Docker](https://img.shields.io/badge/docker-ready-blue?style=for-the-badge&logo=docker)](https://hub.docker.com/)
[![License](https://img.shields.io/badge/license-MIT-green?style=for-the-badge&logo=opensourceinitiative)](LICENSE)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen?style=for-the-badge&logo=github)](https://github.com/himuexe/Hotel-Booking-Website/issues)

**A modern, full-stack hotel booking platform built with React, TypeScript, Node.js, and MongoDB**

[๐Ÿš€ Quick Start](#-quick-start-30-seconds) โ€ข [๐Ÿณ Docker Setup](#-docker-deployment) โ€ข [๐Ÿ“– Documentation](#-documentation) โ€ข [๐Ÿค Contributing](#-contributing)

---

## โœจ Features

### ๐ŸŽฏ Feature Matrix

```mermaid
mindmap
root((๐Ÿจ Vacays Platform))
๐Ÿ” Authentication
๐Ÿ‘ค User Registration
๐Ÿ”‘ JWT Login
๐Ÿช Secure Cookies
๐Ÿ”’ Password Hashing
๐Ÿจ Hotel Management
โž• Create Hotels
โœ๏ธ Edit Properties
๐Ÿ“ธ Image Upload
๐Ÿ“Š Analytics
๐Ÿ” Search & Discovery
๐ŸŒ Location Search
๐Ÿ“… Date Filtering
๐Ÿ’ฐ Price Range
โญ Star Rating
๐Ÿท๏ธ Amenities Filter
๐Ÿ’ณ Booking System
๐Ÿ“‹ Guest Information
๐Ÿ’ฐ Price Calculation
๐Ÿ’ณ Stripe Payment
๐Ÿ“ง Confirmation
๐Ÿ‘ค User Experience
๐Ÿ“ฑ Mobile Responsive
โšก Fast Loading
โ™ฟ Accessibility
๐ŸŽจ Modern UI
```

| ๐ŸŽจ **Modern UI/UX** | ๐Ÿ” **Secure Authentication** | ๐Ÿ’ณ **Payment Integration** |
|:---:|:---:|:---:|
| Responsive design with Tailwind CSS | JWT-based auth with HTTP-only cookies | Stripe payment processing |
| **๐Ÿ” Advanced Search** | **๐Ÿ“ฑ Mobile Optimized** | **๐Ÿณ Docker Ready** |
| Filter by location, dates, price | Works seamlessly on all devices | One-command deployment |

### ๐ŸŽฏ Core Functionality

- **๐Ÿจ Hotel Management**: Complete CRUD operations for hotels with image uploads
- **๐Ÿ“… Booking System**: Real-time availability checking and reservation management
- **๐Ÿ‘ค User Profiles**: Registration, authentication, and profile management
- **๐Ÿ” Smart Search**: Advanced filtering by location, dates, price range, and amenities
- **๐Ÿ’ฐ Payment Processing**: Secure Stripe integration for seamless transactions
- **๐Ÿ“Š Admin Dashboard**: Comprehensive hotel and booking management
- **๐Ÿ”’ Security**: Rate limiting, input validation, and secure authentication
- **๐Ÿ“ฑ Responsive Design**: Mobile-first approach with Tailwind CSS

---

## ๐Ÿ› ๏ธ Technology Stack

### ๐Ÿ—๏ธ Architecture Overview

```mermaid
graph TB
subgraph "๐ŸŽจ Frontend Layer"
FE[React 18.3.1
TypeScript 5.2.2
Vite 5.3.4
Tailwind CSS 3.4.10]
end

subgraph "๐Ÿ–ฅ๏ธ Backend Layer"
BE[Node.js 20+
Express 4.19.2
TypeScript
JWT Auth]
end

subgraph "๐Ÿ—„๏ธ Data Layer"
DB[MongoDB 6.8.0
Mongoose 8.5.1
Schema Validation]
end

subgraph "โ˜๏ธ External Services"
CL[Cloudinary
Image Storage & CDN]
ST[Stripe 17.1.0
Payment Processing]
end

subgraph "๐Ÿ› ๏ธ DevOps & Tools"
DO[Docker
GitHub Actions
Swagger API Docs
ESLint & Prettier]
end

FE <--> BE
BE <--> DB
BE <--> CL
FE <--> ST
DO -.-> FE
DO -.-> BE
DO -.-> DB

style FE fill:#61DAFB,stroke:#333,stroke-width:2px,color:#000
style BE fill:#339933,stroke:#333,stroke-width:2px,color:#fff
style DB fill:#47A248,stroke:#333,stroke-width:2px,color:#fff
style CL fill:#3448C5,stroke:#333,stroke-width:2px,color:#fff
style ST fill:#008CDD,stroke:#333,stroke-width:2px,color:#fff
style DO fill:#FF6B6B,stroke:#333,stroke-width:2px,color:#fff
```

### Frontend
[![React](https://img.shields.io/badge/React-18.3.1-61DAFB?style=flat&logo=react)](https://reactjs.org/)
[![TypeScript](https://img.shields.io/badge/TypeScript-5.2.2-3178C6?style=flat&logo=typescript)](https://www.typescriptlang.org/)
[![Vite](https://img.shields.io/badge/Vite-5.3.4-646CFF?style=flat&logo=vite)](https://vitejs.dev/)
[![Tailwind CSS](https://img.shields.io/badge/Tailwind_CSS-3.4.10-38B2AC?style=flat&logo=tailwind-css)](https://tailwindcss.com/)
[![React Query](https://img.shields.io/badge/React_Query-3.39.3-FF4154?style=flat&logo=react-query)](https://tanstack.com/query)

### Backend
[![Node.js](https://img.shields.io/badge/Node.js-20+-339933?style=flat&logo=node.js)](https://nodejs.org/)
[![Express](https://img.shields.io/badge/Express-4.19.2-000000?style=flat&logo=express)](https://expressjs.com/)
[![MongoDB](https://img.shields.io/badge/MongoDB-6.8.0-47A248?style=flat&logo=mongodb)](https://www.mongodb.com/)
[![Mongoose](https://img.shields.io/badge/Mongoose-8.5.1-880000?style=flat&logo=mongoose)](https://mongoosejs.com/)
[![Stripe](https://img.shields.io/badge/Stripe-17.1.0-008CDD?style=flat&logo=stripe)](https://stripe.com/)

### DevOps & Tools
[![Docker](https://img.shields.io/badge/Docker-Ready-2496ED?style=flat&logo=docker)](https://www.docker.com/)
[![GitHub Actions](https://img.shields.io/badge/GitHub_Actions-CI/CD-2088FF?style=flat&logo=github-actions)](https://github.com/features/actions)
[![Swagger](https://img.shields.io/badge/Swagger-API_Docs-85EA2D?style=flat&logo=swagger)](https://swagger.io/)
[![ESLint](https://img.shields.io/badge/ESLint-Code_Quality-4B32C3?style=flat&logo=eslint)](https://eslint.org/)

---

## ๐Ÿš€ Quick Start (30 seconds)

> ๐Ÿ’ก **Prerequisites**: Docker and Docker Compose installed on your system

### ๐Ÿณ One-Command Deployment

```bash
# Clone the repository
git clone https://github.com/himuexe/Hotel-Booking-Website.git
cd Hotel-Booking-Website

# Create environment file
touch .env
# Edit .env with your configuration (see Environment Setup below)

# ๐Ÿš€ Deploy with Docker (Production Ready)
docker compose -f docker-compose.prod.yml up -d --build

# โœ… Access your application
# Frontend: http://localhost
# Backend API: http://localhost:7000
# API Documentation: http://localhost:7000/api-docs
```

### ๐Ÿ› ๏ธ Development Mode (with hot reloading)

```bash
# Install dependencies
cd frontend && npm install
cd ../backend && npm install

# Start development servers
cd backend && npm run dev # Terminal 1
cd frontend && npm run dev # Terminal 2

# Access at http://localhost:5173
```

---

## ๐Ÿ”ง Environment Setup

Create a `.env` file in the project root:

```env
# Database Configuration
MONGODB_CONNECTION_STRING=mongodb://admin:password123@mongodb:27017/vacays?authSource=admin
MONGO_INITDB_ROOT_USERNAME=admin
MONGO_INITDB_ROOT_PASSWORD=password123

# Authentication
JWT_SECRET_KEY=your-super-secret-jwt-key-at-least-32-characters-long

# Application URLs
FRONTEND_URL=http://localhost:5173

# Cloudinary (Backend Image Storage)
CLOUDINARY_CLOUD_NAME=your-cloudinary-cloud-name
CLOUDINARY_API_KEY=your-cloudinary-api-key
CLOUDINARY_API_SECRET=your-cloudinary-api-secret

# Stripe (Backend Payment Processing)
STRIPE_API_KEY=sk_test_your-stripe-secret-key
```

Create `frontend/.env` file:

```env
# Frontend API Configuration
VITE_API_BASE_URL=http://localhost:7000
VITE_STRIPE_PUB_KEY=pk_test_your-stripe-publishable-key
```

> ๐Ÿ” **Security Note**: Never commit your `.env` file to version control

---

## ๐Ÿณ Docker Deployment

### ๐Ÿš€ Production Deployment

```bash
# Build and start all services
docker compose -f docker-compose.prod.yml up -d --build

# View logs
docker compose -f docker-compose.prod.yml logs -f

# Scale services (if needed)
docker compose -f docker-compose.prod.yml up -d --scale backend=3

# Stop services
docker compose -f docker-compose.prod.yml down
```

### ๐Ÿ› ๏ธ Using Deployment Script

```bash
# Make script executable
chmod +x scripts/deploy.sh

# Deploy with Docker Compose
./scripts/deploy.sh --type docker-compose --env production

# View deployment status
docker compose -f docker-compose.prod.yml ps
```

### ๐Ÿ” Health Checks

```bash
# Check backend health
curl http://localhost:7000/health

# Check frontend
curl http://localhost

# View container status
docker compose -f docker-compose.prod.yml ps
```

---

## ๐Ÿ“– Documentation

| ๐Ÿ“‹ **Development** | ๐Ÿ—๏ธ **Architecture** | ๐Ÿณ **Deployment** | ๐Ÿงช **Testing** |
|:---:|:---:|:---:|:---:|
| [Development Setup](docs/setup-guides.md) | [Architecture Overview](docs/architecture.md) | [Docker Deployment](docs/docker-deployment.md) | [Testing Guide](docs/testing.md) |
| Local development environment | System design and components | Complete containerized deployment | Comprehensive testing strategy |

### ๐Ÿ“š Documentation Hub

**[๐Ÿ“– Documentation Hub](docs/README.md)** - Centralized access to all project documentation with role-based guides

### ๐Ÿ”ง Additional Resources

- **[๐Ÿš€ CI/CD Setup](docs/ci-cd-setup.md)** - Automated deployment pipelines
- **[๐Ÿ“Š API Documentation](http://localhost:7000/api-docs)** - Interactive Swagger API docs
- **[๐Ÿ“„ License](LICENSE)** - MIT License details

---

## ๐Ÿงช Testing

### Run All Tests

```bash
# Backend tests
cd backend && npm test

# Frontend tests
cd frontend && npm test

# E2E tests
cd e2e-tests && npm test

# Docker test script
./docker-test.sh
```

### Test Coverage

- **Unit Tests**: Component and function testing
- **Integration Tests**: API endpoint testing
- **E2E Tests**: Full user journey testing with Playwright
- **Performance Tests**: Load testing and optimization
- **Accessibility Tests**: WCAG compliance testing

---

## ๐Ÿ’ฐ Free Production Deployment

Deploy Vacays to production using **Docker-compatible free services**:

| Service | Cost | Docker Support | Database | Best For |
|---------|------|----------------|----------|----------|
| **Railway** | $5 credit/month | โœ… Full Docker | MongoDB Atlas Free | **Recommended** |
| **Render** | Free tier | โœ… Dockerfile | MongoDB Atlas Free | Simplicity |
| **DigitalOcean** | $4/month | โœ… Full Docker | Self-hosted MongoDB | Full Control |

### ๐Ÿš€ Quick Deploy to Railway

```bash
# 1. Push your code to GitHub
git add . && git commit -m "Deploy to Railway"
git push origin main

# 2. Connect to Railway
# - Visit railway.app
# - Connect GitHub repo
# - Deploy with Docker

# 3. Set environment variables in Railway dashboard
# 4. Your app is live! ๐ŸŽ‰
```

> ๐Ÿณ **Docker Advantage**: Your app runs the same everywhere - local, staging, production!

---

## ๐Ÿค Contributing

We welcome contributions! Here's how to get started:

### ๐Ÿ› Found a Bug?

1. Check [existing issues](https://github.com/himuexe/Hotel-Booking-Website/issues)
2. Create a [new issue](https://github.com/himuexe/Hotel-Booking-Website/issues/new) with details
3. Include steps to reproduce and expected behavior

### ๐Ÿ’ก Want to Contribute?

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

### ๐Ÿ“‹ Development Guidelines

- Follow the existing code style
- Write tests for new features
- Update documentation as needed
- Ensure all tests pass before submitting
- Test with Docker before submitting

---

## ๐Ÿ“Š Project Stats

![GitHub stars](https://img.shields.io/github/stars/himuexe/Hotel-Booking-Website?style=social)
![GitHub forks](https://img.shields.io/github/forks/himuexe/Hotel-Booking-Website?style=social)
![GitHub issues](https://img.shields.io/github/issues/himuexe/Hotel-Booking-Website)
![GitHub pull requests](https://img.shields.io/github/issues-pr/himuexe/Hotel-Booking-Website)

---

## ๐Ÿ“„ License

This project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for details.

---

## ๐Ÿ™ Acknowledgments

- **[React](https://reactjs.org/)** - Frontend framework
- **[Express](https://expressjs.com/)** - Backend framework
- **[MongoDB](https://www.mongodb.com/)** - Database
- **[Stripe](https://stripe.com/)** - Payment processing
- **[Cloudinary](https://cloudinary.com/)** - Image management
- **[Docker](https://www.docker.com/)** - Containerization
- **[Tailwind CSS](https://tailwindcss.com/)** - Styling framework

---

**โญ If you found this project helpful, please give it a star!**

[๐Ÿ” Back to Top](#-vacays---hotel-booking-platform)