Workbnb is a comprehensive workspace booking platform built with the MERN stack, similar to Airbnb but focused exclusively on workspaces. Users can search, book, and review workspaces while providers can list and manage their spaces.
- User Authentication: JWT-based auth with role-based access (User, Provider, Admin)
- Workspace Search: Advanced filtering by location, category, price, amenities
- Booking System: Real-time availability checking and booking management
- Payment Integration: Razorpay payment gateway with secure transactions
- Review System: User reviews and ratings for workspaces
- Admin Dashboard: Complete system management and analytics
- Register/Login with email verification
- Search workspaces with advanced filters
- Book workspaces with date/time selection
- Online payment integration
- Leave reviews and ratings
- Manage bookings and profile
- Register as workspace provider
- List workspace with detailed information
- Upload workspace images
- Manage availability schedules
- View and manage bookings
- Update pricing and amenities
- Dashboard with system analytics
- Manage users, providers, and listings
- Handle disputes and verification
- Generate system reports
- Monitor platform performance
- Node.js - Runtime environment
- Express.js - Web framework
- MongoDB - Database
- Mongoose - ODM
- JWT - Authentication
- bcryptjs - Password hashing
- Razorpay - Payment gateway
- Cloudinary - Image storage
- Express Validator - Input validation
- React.js - UI framework
- React Router - Routing
- Axios - HTTP client
- Tailwind CSS - Styling
- React Hook Form - Form handling
- React Hot Toast - Notifications
- React Icons - Icon library
workbnb/
├── backend/
│ ├── controllers/ # Route controllers
│ ├── middleware/ # Custom middleware
│ ├── models/ # Database models
│ ├── routes/ # API routes
│ ├── scripts/ # Database scripts
│ ├── config/ # Configuration files
│ └── server.js # Entry point
├── frontend/
│ ├── public/ # Static files
│ ├── src/
│ │ ├── components/ # Reusable components
│ │ ├── contexts/ # React contexts
│ │ ├── pages/ # Page components
│ │ ├── services/ # API services
│ │ └── App.js # Main app component
│ └── package.json
├── package.json # Root package.json
└── README.md
- Node.js (v14 or higher)
- MongoDB (local or cloud)
- npm or yarn
-
Clone the repository
git clone <repository-url> cd workbnb
-
Install dependencies
# Install root dependencies npm install # Install backend dependencies npm run install-server # Install frontend dependencies npm run install-client
-
Environment Setup
Create
.envfile in the backend directory:NODE_ENV=development PORT=5000 MONGODB_URI=mongodb://localhost:27017/workbnb JWT_SECRET=your_jwt_secret_key_here JWT_EXPIRE=7d # Cloudinary (for image uploads) CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name CLOUDINARY_API_KEY=your_cloudinary_api_key CLOUDINARY_API_SECRET=your_cloudinary_api_secret # Razorpay (for payments) RAZORPAY_KEY_ID=your_razorpay_key_id RAZORPAY_KEY_SECRET=your_razorpay_key_secret # Email (for notifications) EMAIL_FROM=[email protected] EMAIL_HOST=smtp.gmail.com EMAIL_PORT=587 EMAIL_USER=[email protected] EMAIL_PASS=your_app_password
-
Seed the database
cd backend npm run seed -
Start the application
# Start both backend and frontend npm run dev # Or start individually npm run server # Backend only npm run client # Frontend only
- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
- API Documentation: http://localhost:5000/api/health
After running the seed script, you can use these test accounts:
- Admin: [email protected] / admin123
- Provider: [email protected] / provider123
- User: [email protected] / user123
POST /api/auth/register- Register userPOST /api/auth/login- Login userGET /api/auth/me- Get current userPUT /api/auth/profile- Update profile
GET /api/workspaces- Get all workspacesGET /api/workspaces/search- Search workspacesGET /api/workspaces/:id- Get workspace detailsPOST /api/workspaces- Create workspace (Provider)PUT /api/workspaces/:id- Update workspace (Provider)
POST /api/bookings- Create bookingGET /api/bookings/my-bookings- Get user bookingsGET /api/bookings/availability/:workspaceId- Check availabilityPUT /api/bookings/:id/cancel- Cancel booking
POST /api/payments/create- Create payment orderPOST /api/payments/verify- Verify paymentGET /api/payments/history- Get payment history
POST /api/reviews- Create reviewGET /api/reviews/workspace/:workspaceId- Get workspace reviewsPUT /api/reviews/:id- Update review
The frontend is built with a modern, responsive design using Tailwind CSS:
- Responsive Design: Mobile-first approach
- Component Library: Reusable UI components
- Form Validation: Client-side and server-side validation
- Loading States: Skeleton loaders and spinners
- Error Handling: User-friendly error messages
- Toast Notifications: Real-time feedback
- JWT Authentication: Secure token-based auth
- Password Hashing: bcrypt for password security
- Input Validation: Express-validator for sanitization
- Rate Limiting: API rate limiting
- CORS: Cross-origin resource sharing
- Environment Variables: Secure configuration
- Users: User accounts and profiles
- Workspaces: Workspace listings and details
- Bookings: Booking records and status
- Reviews: User reviews and ratings
- Payments: Payment transactions (integrated with Razorpay)
- Users can have multiple workspaces (providers)
- Users can make multiple bookings
- Workspaces can have multiple bookings and reviews
- Bookings are linked to users, workspaces, and payments
- Connect your GitHub repository to Render
- Set environment variables in Render dashboard
- Deploy the backend service
- Connect your GitHub repository to Netlify
- Set build command:
cd frontend && npm run build - Set publish directory:
frontend/build - Set environment variables for API URL
NODE_ENV=production
MONGODB_URI=mongodb+srv://username:[email protected]/workbnb
JWT_SECRET=your_production_jwt_secret
RAZORPAY_KEY_ID=your_production_razorpay_key
RAZORPAY_KEY_SECRET=your_production_razorpay_secret
CLOUDINARY_CLOUD_NAME=your_cloudinary_name
CLOUDINARY_API_KEY=your_cloudinary_key
CLOUDINARY_API_SECRET=your_cloudinary_secret- Test user registration and login
- Test workspace search and filtering
- Test booking flow and payment
- Test provider workspace creation
- Test admin dashboard functionality
Use tools like Postman or Thunder Client to test API endpoints:
- Import the API collection
- Set up authentication tokens
- Test all CRUD operations
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Create an issue in the repository
- Contact the development team
- Check the documentation
- Real-time chat between users and providers
- Mobile app (React Native)
- Advanced analytics and reporting
- Multi-language support
- Social login integration
- Advanced booking features (recurring bookings)
- Integration with calendar systems
- Automated email notifications
- Advanced search with AI recommendations
Built with ❤️ using the MERN stack