A modern, responsive room booking application built with React and Node.js for managing conference room reservations. Features real-time availability, timeline views, and user-friendly booking management.
- ποΈ Interactive Timeline View - Visual booking calendar with drag-and-drop support
- π’ Multiple Room Support - ESR Room and VP Room management
- π€ User Management - Personal booking dashboard and history
- π± Responsive Design - Works seamlessly on desktop and mobile
- β‘ Real-time Updates - Live availability status
- π Secure API - RESTful backend with data validation
- π³ Docker Ready - Containerized deployment with Docker Compose
- React 18 with TypeScript
- Vite for fast development and building
- Tailwind CSS for styling
- shadcn/ui component library
- React Router for navigation
- Date-fns for date manipulation
- Node.js with Express framework
- MongoDB with Mongoose ODM
- CORS enabled for cross-origin requests
- Environment-based configuration
- Docker containerization
- nginx reverse proxy
- Multi-stage builds for optimization
- Node.js 18+ and npm
- MongoDB (local or cloud)
- Git
git clone https://github.com/your-username/VP-ESR.git
cd VP-ESRcd backend
npm install
# Copy and configure environment
cp .env.example .env
# Edit .env with your MongoDB URI
# Start development server
npm run devcd frontend
npm install
# Copy and configure environment
cp .env.example .env
# Edit .env if needed (defaults to localhost:5001)
# Start development server
npm run dev- Frontend: http://localhost:8080
- Backend API: http://localhost:5001
For containerized deployment:
- Docker Engine 20.10+
- Docker Compose 2.0+
# Copy and configure environment
cp .env.example .env
# Edit .env with your production values
# Build and start all services
docker-compose build --no-cache
docker-compose up -d
# Verify deployment
docker-compose ps
docker-compose logs -fVP-ESR/
βββ backend/ # Node.js API server
β βββ controllers/ # Route controllers
β βββ models/ # MongoDB models
β βββ routes/ # API routes
β βββ service/ # Business logic
β βββ app.js # Express app setup
β βββ index.js # Server entry point
β βββ Dockerfile # Backend container
βββ frontend/ # React application
β βββ src/
β β βββ components/ # Reusable UI components
β β βββ pages/ # Page components
β β βββ hooks/ # Custom React hooks
β β βββ lib/ # Utility functions
β β βββ main.tsx # React entry point
β βββ public/ # Static assets
β βββ Dockerfile # Frontend container
βββ nginx/ # Reverse proxy configuration
βββ docker-compose.yml # Production Docker setup
βββ README.md # This file
Create .env file in the backend/ directory:
PORT=5001
MONGODB_URI=mongodb://localhost:27017/vp-esr-booking
# For cloud MongoDB:
# MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/database
NODE_ENV=developmentCreate .env file in the frontend/ directory:
VITE_APP_API_PREFIX=http://localhost:5001| Method | Endpoint | Description |
|---|---|---|
GET |
/health |
Health check |
GET |
/api/bookings |
Get all bookings |
POST |
/api/bookings |
Create new booking |
DELETE |
/api/bookings?_id={id} |
Delete booking |
GET |
/api/bookings/myBookings |
Get user's bookings |
- Select date from the calendar
- Choose room (ESR Room or VP Room)
- View available time slots in the timeline
- Click "New Booking" to create a reservation
- Fill in the booking form with your details
- Submit to confirm the booking
- Click "My Bookings" to view your reservations
- Use the cancel button to remove bookings
- View booking details including time, room, and purpose
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes
- Test thoroughly
- Commit your changes:
git commit -am 'Add feature' - Push to the branch:
git push origin feature-name - Submit a pull request
- Add routes in
backend/routes/ - Add controllers in
backend/controllers/ - Add models in
backend/models/ - Update service logic in
backend/service/
- Add components in
frontend/src/components/ - Add pages in
frontend/src/pages/ - Update routing if needed
- Add custom hooks in
frontend/src/hooks/
- Use TypeScript for type safety
- Follow ESLint configuration
- Use Prettier for code formatting
- Write meaningful commit messages
# View backend logs
cd backend && npm run dev
# View frontend logs
cd frontend && npm run dev# View all service logs
docker-compose logs -f
# View specific service logs
docker-compose logs -f backend
docker-compose logs -f frontend
# Check service status
docker-compose ps
# Restart services
docker-compose restart# Check if services are running
npm run dev # in respective directories
# For Docker
docker-compose ps
docker-compose logs service-name# Check what's using the port
netstat -tulpn | grep :5001
# Change port in .env file if needed
PORT=5002# Verify MongoDB URI in backend/.env
# Check if MongoDB service is running
# Ensure network connectivity# Clear npm cache
npm cache clean --force
# Remove node_modules and reinstall
rm -rf node_modules package-lock.json
npm install
# For Docker builds
docker-compose build --no-cache- Input Validation: Server-side validation for all API inputs
- CORS Configuration: Proper cross-origin request handling
- Environment Variables: Sensitive data stored in environment files
- Error Handling: Graceful error responses without data exposure
- Health Checks: Service monitoring endpoints
- Code Splitting: React lazy loading for optimal bundle size
- Caching: Static asset caching with proper headers
- Compression: Gzip compression in production
- Database Indexing: Optimized MongoDB queries
- Docker Multi-stage Builds: Minimal production images
This project is licensed under the MIT License - see the LICENSE file for details.
For support, questions, or contributions:
- Issues: Create an issue on GitHub
- Documentation: Check this README and inline comments
- Code Review: All contributions welcome via pull requests
- React - Frontend framework
- Node.js - Backend runtime
- MongoDB - Database
- Tailwind CSS - CSS framework
- shadcn/ui - UI components
- Vite - Build tool
Made with β€οΈ for efficient room booking management