Skip to content

Aarthi1720/backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🏨 CasaStay – Hotel Booking System (Backend)

This is the backend service for CasaStay, built with Node.js + Express + MongoDB, powering hotel management, bookings, payments, reviews, and admin analytics.


βš™οΈ Features (Backend Logic)

πŸ‘€ Authentication

  • βœ… OTP-based email verification on signup.
  • πŸ”‘ JWT auth with role-based access (user/admin).
  • πŸ”„ Password reset via OTP.
  • πŸ›‘οΈ Secure password hashing with bcrypt.

🏨 Hotels & Rooms

  • βž• Add, update, delete hotels and rooms.
  • πŸ“Έ Hotel images & room descriptions.
  • πŸ“… Availability management per room.

πŸ“¦ Bookings

  • πŸ›οΈ Create bookings with check-in/out, guests, and special requests.
  • πŸ’³ Stripe payment integration (webhooks for confirmation).
  • πŸ“œ Booking history & status (paid, pending, cancelled).

πŸ’¬ Reviews

  • ⭐ Only verified, paid users can review.
  • πŸ” Review moderation (pending, approved, rejected).
  • πŸ“Š Average rating calculation with rating buckets.

🎁 Offers & Loyalty

  • 🎟️ Admin creates special offers with codes & validity.
  • πŸͺ™ Loyalty coins awarded for eligible bookings (>β‚Ή1000).
  • πŸ”— Applied automatically at checkout.

πŸ‘¨β€πŸ’Ό Admin Panel APIs

  • 🏨 Manage hotels, rooms, offers.
  • πŸ“Š View analytics: bookings, occupancy, revenue.
  • πŸ“ Approve/reject reviews.
  • πŸ›‘οΈ Handle ID verification (manual/AI/ocr).

πŸ› οΈ Tech Stack

  • 🌐 Express.js – API framework.
  • πŸ—„οΈ MongoDB + Mongoose – Database & schema modeling.
  • πŸ” JWT – Auth tokens.
  • πŸ”‘ bcryptjs – Password hashing.
  • πŸ’Œ Nodemailer – OTP / booking confirmation emails.
  • πŸ’³ Stripe – Payments + webhook handling.

πŸš€ Getting Started

# clone repo
git clone https://github.com/your-username/casastay-backend.git
cd casastay-backend

# install dependencies
npm install

# run locally
npm run dev

πŸ”— Environment Variables

PORT=5000
MONGO_URI=your_mongo_connection
JWT_SECRET=your_secret_key
STRIPE_SECRET_KEY=your_stripe_secret
EMAIL_USER=your_email
EMAIL_PASS=your_email_password
FRONTEND_URL=http://localhost:5173

πŸ“Έ Highlights

  • βœ… Email OTP verification

  • βœ… Stripe webhook integration

  • βœ… Loyalty coin system

  • βœ… Verified stay review system

  • βœ… Admin moderation tools


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

πŸš€ Built with ❀️ by Aarthi | MERN Stack Developer

About

πŸ‘©β€πŸ’»Robust Hotel Booking System backend powered by Node.js, Express, MongoDB. Provides APIs for authentication with OTP, booking management, room & offers management, review moderation, payments, and admin analytics.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors