Skip to content

kuldeep1324/RentHub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

RentHub - Premium Rental Marketplace

A modern, full-stack rental marketplace platform for renting physical products like clothes, shoes, boots, and accessories. Built with React, Node.js, Express, and MongoDB.

🎯 Features

Buyer Features

  • Browse products by categories with advanced filtering
  • Search products by name, brand, or description
  • View detailed product information with image gallery
  • Check real-time availability before booking
  • Book products with date/time selection
  • Track booking status (Pending, Confirmed, Completed, Cancelled)
  • Leave reviews and ratings after completion
  • Wishlist functionality
  • Personal dashboard with booking history

Seller Features

  • Comprehensive dashboard with statistics and analytics
  • Add/Edit/Delete product listings
  • Upload multiple product images
  • Set rental prices (hourly/daily)
  • Manage product availability and time slots
  • Handle booking requests (Accept/Reject)
  • Track earnings and rental history
  • View booking analytics

Technical Features

  • JWT-based authentication with role-based access control
  • Double-booking prevention with date validation
  • RESTful API architecture
  • Responsive, mobile-first design
  • Smooth animations and hover effects
  • Modern gradient-based UI design
  • Real-time form validation
  • Secure password hashing with bcrypt

πŸš€ Tech Stack

Frontend

  • React 18 - UI library
  • React Router v6 - Navigation and routing
  • Tailwind CSS - Utility-first styling
  • Axios - HTTP client
  • React Icons - Icon library
  • date-fns - Date manipulation
  • React DatePicker - Date selection

Backend

  • Node.js - Runtime environment
  • Express.js - Web framework
  • MongoDB - Database
  • Mongoose - ODM
  • JWT - Authentication
  • bcryptjs - Password hashing
  • CORS - Cross-origin resource sharing
  • dotenv - Environment variables

πŸ“‹ Prerequisites

  • Node.js (v14 or higher)
  • MongoDB (v4.4 or higher)
  • npm or yarn

πŸ› οΈ Installation & Setup

1. Clone the Repository

git clone <repository-url>
cd rental-marketplace

2. Backend Setup

cd backend

# Install dependencies
npm install

# Create .env file
cp .env.example .env

# Edit .env with your configuration
# PORT=5000
# MONGODB_URI=mongodb://localhost:27017/rental-marketplace
# JWT_SECRET=your_super_secret_jwt_key
# NODE_ENV=development

3. Frontend Setup

cd frontend

# Install dependencies
npm install

# Optional: Create .env file for custom API URL
echo "REACT_APP_API_URL=http://localhost:5000/api" > .env

4. Start MongoDB

Make sure MongoDB is running on your system:

# For macOS with Homebrew
brew services start mongodb-community

# For Linux
sudo systemctl start mongod

# For Windows
# Start MongoDB service from Services panel or run mongod.exe

5. Run the Application

Terminal 1 - Backend:

cd backend
npm start
# Server runs on http://localhost:5000

Terminal 2 - Frontend:

cd frontend
npm start
# App opens on http://localhost:3000

πŸ“± Usage

Registration

  1. Visit http://localhost:3000/register
  2. Choose role: Buyer (to rent items) or Seller (to list items)
  3. Fill in the registration form
  4. Login automatically after registration

For Buyers

  1. Browse products from the homepage or /products page
  2. Use filters to narrow down search (category, price range)
  3. Click on a product to view details
  4. Select rental dates and submit booking request
  5. Track bookings from the dashboard
  6. Leave reviews after rental completion

For Sellers

  1. Access seller dashboard after login
  2. Click "Add Product" to list new items
  3. Fill in product details, upload images, set pricing
  4. Manage incoming booking requests
  5. Accept/Reject bookings
  6. Track earnings and statistics

πŸ—‚οΈ Project Structure

rental-marketplace/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ controllers/         # Request handlers
β”‚   β”‚   β”œβ”€β”€ authController.js
β”‚   β”‚   β”œβ”€β”€ productController.js
β”‚   β”‚   β”œβ”€β”€ bookingController.js
β”‚   β”‚   └── reviewController.js
β”‚   β”œβ”€β”€ models/             # Database schemas
β”‚   β”‚   β”œβ”€β”€ User.js
β”‚   β”‚   β”œβ”€β”€ Product.js
β”‚   β”‚   β”œβ”€β”€ Booking.js
β”‚   β”‚   └── Review.js
β”‚   β”œβ”€β”€ routes/             # API routes
β”‚   β”‚   β”œβ”€β”€ authRoutes.js
β”‚   β”‚   β”œβ”€β”€ productRoutes.js
β”‚   β”‚   β”œβ”€β”€ bookingRoutes.js
β”‚   β”‚   └── reviewRoutes.js
β”‚   β”œβ”€β”€ middleware/         # Custom middleware
β”‚   β”‚   └── auth.js
β”‚   β”œβ”€β”€ server.js           # Express app setup
β”‚   β”œβ”€β”€ package.json
β”‚   └── .env.example
β”‚
└── frontend/
    β”œβ”€β”€ public/
    β”‚   └── index.html
    β”œβ”€β”€ src/
    β”‚   β”œβ”€β”€ components/     # Reusable components
    β”‚   β”‚   β”œβ”€β”€ Navbar.js
    β”‚   β”‚   β”œβ”€β”€ Hero.js
    β”‚   β”‚   β”œβ”€β”€ Categories.js
    β”‚   β”‚   └── ProductCard.js
    β”‚   β”œβ”€β”€ context/        # React Context
    β”‚   β”‚   └── AuthContext.js
    β”‚   β”œβ”€β”€ pages/          # Page components
    β”‚   β”‚   β”œβ”€β”€ Home.js
    β”‚   β”‚   β”œβ”€β”€ Products.js
    β”‚   β”‚   β”œβ”€β”€ Login.js
    β”‚   β”‚   β”œβ”€β”€ Register.js
    β”‚   β”‚   β”œβ”€β”€ seller/
    β”‚   β”‚   β”‚   └── Dashboard.js
    β”‚   β”‚   └── buyer/
    β”‚   β”‚       └── Bookings.js
    β”‚   β”œβ”€β”€ utils/          # Utilities
    β”‚   β”‚   └── api.js
    β”‚   β”œβ”€β”€ App.js
    β”‚   β”œβ”€β”€ index.js
    β”‚   └── index.css
    β”œβ”€β”€ package.json
    └── tailwind.config.js

πŸ”Œ API Endpoints

Authentication

  • POST /api/auth/register - Register new user
  • POST /api/auth/login - Login user
  • GET /api/auth/me - Get current user
  • PUT /api/auth/profile - Update user profile

Products

  • GET /api/products - Get all products (with filters)
  • GET /api/products/featured - Get featured products
  • GET /api/products/:id - Get single product
  • POST /api/products - Create product (Seller only)
  • PUT /api/products/:id - Update product (Seller only)
  • DELETE /api/products/:id - Delete product (Seller only)
  • POST /api/products/:id/check-availability - Check availability

Bookings

  • POST /api/bookings - Create booking (Buyer only)
  • GET /api/bookings - Get user's bookings
  • GET /api/bookings/:id - Get single booking
  • PUT /api/bookings/:id/status - Update booking status (Seller only)
  • PUT /api/bookings/:id/cancel - Cancel booking (Buyer only)
  • GET /api/bookings/stats/dashboard - Get seller statistics

Reviews

  • POST /api/reviews - Create review (Buyer only)
  • GET /api/reviews/product/:productId - Get product reviews
  • GET /api/reviews/my-reviews - Get user's reviews

🎨 Design Features

  • Color Scheme: Primary blue (#0ea5e9) with accent purple (#d946ef)
  • Typography: Archivo for headings, Inter for body text
  • Animations: Smooth transitions, hover effects, fade-in animations
  • Responsive: Mobile-first design, works on all screen sizes
  • Accessibility: ARIA labels, keyboard navigation, high contrast

πŸ”’ Security Features

  • Password hashing with bcryptjs
  • JWT token authentication
  • Protected routes with role-based access
  • Input validation and sanitization
  • CORS configuration
  • MongoDB injection prevention

🚧 Future Enhancements

  • Payment integration (Stripe/PayPal)
  • Real-time chat between buyers and sellers
  • Email notifications
  • Advanced search with Elasticsearch
  • Image upload to cloud storage (AWS S3/Cloudinary)
  • Social media authentication
  • Admin dashboard
  • Multi-language support
  • Mobile app (React Native)

πŸ“ License

This project is open source and available under the MIT License.

πŸ‘₯ Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

πŸ“§ Contact

For questions or support, please open an issue in the repository.


Built with ❀️ using React, Node.js, and MongoDB

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages