Live Demo: https://home-sharing-platform-five.vercel.app/
Demo Credentials:
Email: emma@example.com
Password: emma123!A full-stack web application for listing and booking homes, built with Next.js, Node.js, and MongoDB. This platform allows users to list their properties, search for available homes, and manage bookings seamlessly.
- Secure user registration and login system using NextAuth.js
- Password encryption with bcrypt
- Protected routes and API endpoints
- Session management and JWT tokens
- Create and manage property listings with detailed information
- Upload multiple property images using Cloudinary
- Set availability dates and pricing
- Add property details (bedrooms, bathrooms, amenities)
- Advanced search with multiple filters:
- Location-based search
- Date availability
- Number of guests
- Property type
- Real-time availability checking
- Date selection with calendar interface
- Booking management for hosts and guests
- Booking status tracking (pending, confirmed, cancelled)
- Host Dashboard:
- Manage property listings
- View and respond to booking requests
- Track earnings and occupancy
- Update listing details and availability
- Guest Dashboard:
- View booking history
- Manage upcoming stays
- Save favorite listings
- Update profile and preferences
- Optimized for all screen sizes
- Fast loading and smooth transitions
- Framework: Next.js 13 (App Router)
- Styling: Tailwind CSS
- State Management: React Hooks
- Form Handling: React Hook Form
- Date Handling: date-fns
- Runtime: Node.js
- API Routes: Next.js API Routes
- Database: MongoDB Atlas
- ORM: Mongoose
- Authentication: NextAuth.js
- File Storage: Cloudinary
- Node.js 16.8 or later
- MongoDB Atlas account
- Cloudinary account
- Google Maps API key (optional)
- Clone the repository:
git clone <repository-url>
cd home-sharing-platform- Install dependencies:
npm install- Create a
.env.localfile in the root directory:
# MongoDB
MONGODB_URI=your_mongodb_connection_string
# NextAuth
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your_nextauth_secret
# Cloudinary
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret- Run the development server:
npm run dev- Open http://localhost:3000 in your browser.
For security reasons, the .env file is not included in the repository. To run the project:
- Create a MongoDB Atlas account and get your connection string
- Generate a random string for NEXTAUTH_SECRET (you can use
openssl rand -base64 32) - Create a Cloudinary account and get your credentials
- (Optional) Get a Google Maps API key
home-sharing-platform/
├── app/
│ ├── api/ # API routes
│ │ ├── auth/ # Authentication endpoints
│ │ ├── bookings/ # Booking management
│ │ ├── listings/ # Listing management
│ │ └── upload/ # Image upload
│ ├── (auth)/ # Authentication pages
│ │ ├── login/ # Login page
│ │ └── register/ # Registration page
│ ├── dashboard/ # User dashboard
│ ├── listings/ # Listing pages
│ ├── search/ # Search page
│ └── page.js # Homepage
├── components/ # React components
│ ├── layout/ # Layout components
│ ├── ui/ # UI components
│ └── forms/ # Form components
├── lib/ # Utility functions
├── models/ # Mongoose models
└── public/ # Static files
- Password hashing with bcrypt
- JWT-based authentication
- Protected API routes
- Input validation and sanitization
- Rate limiting on API routes
- Secure file upload handling
- Environment variable protection
- Clean and modern design
- Responsive layout for all devices
- Loading states and animations
- Error handling and user feedback
- Intuitive navigation
- Accessible components
- Dark mode support
- Mobile-first design approach
- Touch-friendly interfaces
- Optimized images and assets
- Responsive typography
- Flexible grid layouts
- Adaptive navigation
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Next.js team for the amazing framework
- MongoDB Atlas for the database service
- Cloudinary for image management
- All contributors and supporters