Back to projects

EasyBook - Hotel & Restaurant Booking Platform
Hafiz Syed Usama Bin Qamar / March 20, 2024
EasyBook is a powerful, full-featured booking platform crafted with the modern MERN stack, offering a smooth and intuitive experience for users to discover, book, and manage hotel and restaurant reservations ā all in one place.
Features
- Secure Authentication: User-friendly sign-up and login powered by Firebase Authentication
- Integrated Payments: Reliable, secure transactions with Stripe
- Fully Responsive: Mobile-first design using Tailwind CSS and Shadcn UI
- Smart Listings: Advanced search and filter functionality for hotels and restaurants
- Admin Dashboard: Intuitive interface for managing listings and bookings
- Real-Time Notifications: Automated emails powered by Resend
Technologies
- Frontend: React.js, Tailwind CSS, Shadcn UI
- Backend: Node.js, Express.js
- Database: MongoDB
- Authentication: Firebase
- Payments: Stripe
- Email Service: Resend
Implementation
The core functionality includes:
// Firebase Authentication Setup
const auth = initializeAuth(app, {
persistence: browserLocalPersistence
})
// Stripe Payment Integration
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY)
const paymentIntent = await stripe.paymentIntents.create({
amount: bookingAmount,
currency: 'usd'
})
// MongoDB Schema for Listings
const listingSchema = new Schema({
name: { type: String, required: true },
type: { type: String, enum: ['hotel', 'restaurant'] },
location: {
address: String,
coordinates: {
lat: Number,
lng: Number
}
},
amenities: [String],
pricing: {
basePrice: Number,
currency: String
},
availability: [
{
date: Date,
isAvailable: Boolean
}
]
})
// Resend Email Notifications
const resend = new Resend(process.env.RESEND_API_KEY)
await resend.emails.send({
from: 'EasyBook <notifications@easybook.com>',
to: userEmail,
subject: 'Booking Confirmation',
html: emailTemplate
})
Getting Started
To run this project locally:
# Clone the repository
git clone https://github.com/UsamaBinQamar/easybook.git
# Install dependencies
npm install
# Set up environment variables
# Create .env.local and add your API keys:
NEXT_PUBLIC_FIREBASE_API_KEY=your_firebase_key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_firebase_domain
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=your_stripe_key
RESEND_API_KEY=your_resend_key
# Start development server
npm run dev
Use Cases
EasyBook serves various scenarios:
- Hotel bookings for travelers
- Restaurant reservations
- Business travel management
- Event venue bookings
- Group bookings and corporate accounts
Future Enhancements
Planned improvements include:
- Multi-language support
- Advanced analytics dashboard
- Loyalty program integration
- Mobile app development
- AI-powered recommendations
- Virtual tours integration
- Review and rating system
Conclusion
EasyBook demonstrates how modern web technologies can revolutionize the hospitality industry. By combining the power of the MERN stack with essential services like Firebase, Stripe, and Resend, it provides a comprehensive solution for both users and business owners in the hospitality sector.