TravelNest is a full-stack booking platform built with Next.js, Prisma, and Tailwind CSS. It allows users to list properties, make reservations, and manage their bookings. The project integrates authentication using NextAuth.js and supports third-party login providers like Google and GitHub. Hosted at: https://travel-nest-one.vercel.app/

- User Authentication: Login and registration with email/password or third-party providers (Google, GitHub).
- Property Listings: Users can list properties with details like title, description, price, and location.
- Reservations: Users can book properties for specific dates.
- Favorites: Users can mark properties as favorites.
- Dashboard: Manage trips, reservations, and properties.
- Search and Filters: Search properties by location, date, and other filters.
- Responsive Design: Fully responsive UI built with Tailwind CSS.
- Map Integration: Location selection and display using Leaflet.
- Frontend: Next.js, React, Tailwind CSS
- Backend: Next.js API routes, Prisma ORM
- Database: MongoDB (via Prisma)
- Authentication: NextAuth.js
- State Management: Zustand
- File Uploads: Cloudinary
- Other Libraries: Axios, React Hook Form, React Date Range, React Icons, React Hot Toast
- Node.js (v16 or higher)
- MongoDB database
- Cloudinary account for image uploads
-
Clone the repository:
git clone https://github.com/your-username/TravelNest.git cd TravelNest
-
Install dependencies:
npm install
-
Set up environment variables:
Create a
.env
file in the root directory and add the following variables:DATABASE_URL="your-mongodb-connection-string" NEXTAUTH_SECRET="your-nextauth-secret" GITHUB_ID="your-github-client-id" GITHUB_SECRET="your-github-client-secret" GOOGLE_CLIENT_ID="your-google-client-id" GOOGLE_CLIENT_SECRET="your-google-client-secret" NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME="your-cloudinary-cloud-name"
-
Generate Prisma client:
npx prisma generate
-
Run database migrations:
npx prisma migrate dev
-
Start the development server:
npm run dev
Open http://localhost:3000 in your browser to view the app.
TravelNest/
├── app/ # Next.js app directory
│ ├── actions/ # Server-side actions
│ ├── api/ # API routes
│ ├── components/ # Reusable UI components
│ ├── hooks/ # Custom React hooks
│ ├── libs/ # Utility libraries
│ ├── providers/ # Context and providers
│ ├── types/ # TypeScript types
│ ├── favorites/ # Favorites page
│ ├── listings/ # Listings page
│ ├── properties/ # Properties page
│ ├── reservations/ # Reservations page
│ ├── trips/ # Trips page
│ ├── layout.tsx # Root layout
│ ├── page.tsx # Home page
│ ├── globals.css # Global styles
├── prisma/ # Prisma schema
│ └── schema.prisma
├── public/ # Public assets
├── .env # Environment variables
├── .eslintrc.json # ESLint configuration
├── tailwind.config.js # Tailwind CSS configuration
├── tsconfig.json # TypeScript configuration
├── Dockerfile # Docker configuration
├── package.json # Project metadata and scripts
└── README.md # Project documentation
npm run dev
: Start the development server.npm run build
: Build the project for production.npm run start
: Start the production server.npm run lint
: Run ESLint to check for code issues.
- POST
/api/auth/[...nextauth]
: Handles user authentication.
- POST
/api/listings
: Create a new listing. - DELETE
/api/listings/[listingId]
: Delete a listing.
- POST
/api/reservations
: Create a new reservation. - DELETE
/api/reservations/[reservationId]
: Cancel a reservation.
- POST
/api/favorites/[listingId]
: Add a listing to favorites. - DELETE
/api/favorites/[listingId]
: Remove a listing from favorites.
-
Install the Vercel CLI.
-
Deploy the app:
vercel
-
Set environment variables in the Vercel dashboard.
Variable | Description |
---|---|
DATABASE_URL |
MongoDB connection string |
NEXTAUTH_SECRET |
Secret for NextAuth.js |
GITHUB_ID |
GitHub OAuth client ID |
GITHUB_SECRET |
GitHub OAuth client secret |
GOOGLE_CLIENT_ID |
Google OAuth client ID |
GOOGLE_CLIENT_SECRET |
Google OAuth client secret |
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME |
Cloudinary cloud name |
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b feature-name
. - Commit your changes:
git commit -m 'Add feature'
. - Push to the branch:
git push origin feature-name
. - Submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.