This is the backend service for CasaStay, built with Node.js + Express + MongoDB, powering hotel management, bookings, payments, reviews, and admin analytics.
- β OTP-based email verification on signup.
- π JWT auth with role-based access (user/admin).
- π Password reset via OTP.
- π‘οΈ Secure password hashing with bcrypt.
- β Add, update, delete hotels and rooms.
- πΈ Hotel images & room descriptions.
- π Availability management per room.
- ποΈ Create bookings with check-in/out, guests, and special requests.
- π³ Stripe payment integration (webhooks for confirmation).
- π Booking history & status (paid, pending, cancelled).
- β Only verified, paid users can review.
- π Review moderation (pending, approved, rejected).
- π Average rating calculation with rating buckets.
- ποΈ Admin creates special offers with codes & validity.
- πͺ Loyalty coins awarded for eligible bookings (>βΉ1000).
- π Applied automatically at checkout.
- π¨ Manage hotels, rooms, offers.
- π View analytics: bookings, occupancy, revenue.
- π Approve/reject reviews.
- π‘οΈ Handle ID verification (manual/AI/ocr).
- π Express.js β API framework.
- ποΈ MongoDB + Mongoose β Database & schema modeling.
- π JWT β Auth tokens.
- π bcryptjs β Password hashing.
- π Nodemailer β OTP / booking confirmation emails.
- π³ Stripe β Payments + webhook handling.
# clone repo
git clone https://github.com/your-username/casastay-backend.git
cd casastay-backend
# install dependencies
npm install
# run locally
npm run devPORT=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-
β Email OTP verification
-
β Stripe webhook integration
-
β Loyalty coin system
-
β Verified stay review system
-
β Admin moderation tools
π Built with β€οΈ by Aarthi | MERN Stack Developer