A full-stack hotel booking SaaS application built with MERN stack and integrated with LiteAPI.
book-your-hotel/
βββ backend/ # Express.js backend
β βββ src/
β β βββ config/ # Database and other configurations
β β βββ controllers/ # Route controllers
β β βββ models/ # Mongoose models
β β βββ routes/ # API routes
β β βββ middleware/ # Custom middleware
β β βββ services/ # Business logic & external APIs
β β βββ utils/ # Utility functions
β βββ .env # Environment variables
β βββ .env.example # Environment variables template
β βββ package.json
β βββ server.js # Entry point
β
βββ frontned/ # React frontend
β βββ src/
β β βββ components/ # React components
β β β βββ ui/ # Shadcn UI components
β β βββ pages/ # Page components
β β βββ hooks/ # Custom React hooks
β β βββ services/ # API services
β β βββ utils/ # Utility functions
β β βββ lib/ # Libraries (utils for Shadcn)
β β βββ App.jsx # Main App component
β β βββ main.jsx # Entry point
β β βββ index.css # Global styles (Tailwind)
β βββ .env # Environment variables
β βββ .env.example # Environment variables template
β βββ package.json
β βββ vite.config.js # Vite configuration
β βββ tailwind.config.js # Tailwind CSS configuration
β βββ components.json # Shadcn UI configuration
β
βββ postman/ # Postman collection for API testing
- Node.js & Express.js - Server framework
- MongoDB & Mongoose - Database
- Axios - HTTP client for LiteAPI
- Helmet - Security headers
- CORS - Cross-origin resource sharing
- Express Rate Limit - Rate limiting
- Morgan - HTTP request logger
- React 19 - UI library
- Vite - Build tool
- Tailwind CSS - Styling
- Shadcn UI - UI components
- React Router - Routing
- Axios - HTTP client
- Node.js (v18 or higher)
- MongoDB (local or Atlas)
- LiteAPI Key (Get one here)
git clone <your-repo-url>
cd book-your-hotelcd backend
npm install
# Create .env file (copy from .env.example)
cp .env.example .env
# Edit .env and add your configurations:
# - MONGODB_URI
# - LITEAPI_KEY
# - etc.cd frontned
npm install
# Create .env file (copy from .env.example)
cp .env.example .env
# Edit .env and add your configurations:
# - VITE_API_URL
# - VITE_LITEAPI_KEY (if needed)Terminal 1 - Backend:
cd backend
npm run devServer runs on: http://localhost:3000
Terminal 2 - Frontend:
cd frontned
npm run devFrontend runs on: http://localhost:5173
Backend:
cd backend
npm startFrontend:
cd frontned
npm run build
npm run previewGET /api/hotels/search- Search hotelsGET /api/hotels/:id- Get hotel detailsPOST /api/hotels/availability- Check availability
POST /api/bookings- Create bookingGET /api/bookings- Get user bookingsGET /api/bookings/:id- Get booking detailsDELETE /api/bookings/:id- Cancel booking
To add Shadcn UI components to your project:
cd frontned
# Example: Add button component
npx shadcn@latest add button
# Add card component
npx shadcn@latest add card
# Add input component
npx shadcn@latest add inputComponents will be added to src/components/ui/
NODE_ENV=development
PORT=3000
MONGODB_URI=mongodb://localhost:27017/hotel-booking-saas
FRONTEND_URL=http://localhost:5173
LITEAPI_KEY=your_liteapi_key_here
LITEAPI_BASE_URL=https://api.liteapi.travel/v3.0VITE_API_URL=http://localhost:3000/api
VITE_LITEAPI_KEY=your_liteapi_key_herecurl http://localhost:3000/health- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
ISC
Your Name
Note: This is a starter template with folder structure in place. Controllers, routes, models, and components need to be implemented based on your requirements.