Happora is an Event Booking Platform built with a React + TypeScript frontend and a Node.js + Express + TypeScript backend.
It supports:
- JWT authentication
- user and admin roles
- service management
- date-based slot availability
- bookings for users
- booking visibility for admins on their own services
- React
- TypeScript
- Vite
- Tailwind CSS
- Axios
- React Router
- Node.js
- Express
- TypeScript
- MongoDB
- Mongoose
- Inversify
- JWT
Happora/
├── backend/
└── frontend/
- Register
- Login
- JWT-based route protection
- View all services
- View service details
- Check date-based availability before booking
- Book a service
- View personal bookings
- Create, edit, and delete services
- View all bookings related to services created by that admin
Slots are managed per day, not globally.
When a user selects a date range:
- the backend finds overlapping bookings for that service
- availability is checked day by day
- booking is rejected if any day in the selected range has reached
totalSlots
This prevents overbooking while still allowing bookings on other dates.
Base URL:
http://localhost:5000/api
POST /api/auth/registerPOST /api/auth/login
GET /api/servicesGET /api/services/:idPOST /api/servicesPUT /api/services/:idDELETE /api/services/:id
GET /api/bookings/availabilityPOST /api/bookingsGET /api/bookings/my-bookingsGET /api/bookings/admin
//services/:id/booking/:id/my-bookings
/admin/services/admin/services/add/admin/services/edit/:id/admin/bookings
/login
git clone <your-repository-url>
cd Happoracd backend
npm installCreate a .env file in backend/ using this template:
PORT=5000
DEV_CLIENT_URL=http://localhost:5173
MONGODB_URI=mongodb://localhost:27017/happora
NODE_ENV=development
JWT_SECRET=replace-with-a-strong-secret
JWT_EXPIRES_IN=7dStart the backend:
npm run devcd frontend
npm installOptional .env for frontend:
VITE_API_BASE_URL=http://localhost:5000/apiStart the frontend:
npm run dev{
"message": "Admin bookings fetched successfully.",
"bookings": [
{
"bookingId": "67df0b7a2b5a6d0012345678",
"serviceTitle": "Wedding Photography",
"serviceCategory": "photography",
"user": {
"id": "67df0b7a2b5a6d0099999999",
"name": "Ava Johnson",
"email": "ava@example.com"
},
"startDate": "2026-04-10T00:00:00.000Z",
"endDate": "2026-04-12T00:00:00.000Z",
"totalPrice": 30000,
"status": "CONFIRMED"
}
]
}- Admin routes are protected on both frontend and backend.
- User routes require authentication.
- Availability is checked from the booking page after selecting dates.
GET /api/bookings/adminonly returns bookings for services created by the logged-in admin.
Useful checks:
cd backend
npx tsc --noEmitcd frontend
npx tsc -bIn this environment, npm run build for the frontend may fail because Vite/Tailwind native dependencies can hit a local Windows sandbox issue. Development mode and TypeScript verification still work.