FauxDoorz is a modern vacation rental platform built with Next.js 14, MongoDB, NextAuth.js, and TailwindCSS. Users can browse properties, search based on location and price, and manage their listings.
- User Authentication: Secure authentication using NextAuth.js
- Property Management: Users can create, view, and manage their property listings
- Image Upload: Support for property images with preview
- Responsive Design: Mobile-first approach using TailwindCSS
- Search & Filter: Advanced property search with location and price filters
- User Dashboard: Personalized dashboard for property management
- Real-time Validation: Form validation and error handling
- Session Management: Secure session handling with MongoDB
-
Frontend:
- Next.js 14
- React 18
- TailwindCSS
- NextAuth.js
- React Icons
-
Backend:
- Next.js API Routes
- MongoDB Atlas
- Mongoose ODM
- bcrypt for password hashing
-
Database:
- MongoDB Atlas
- Mongoose Schemas
- Indexed Collections
- Node.js 18+
- MongoDB Atlas account
- npm or pnpm
- Clone the repository
git clone https://github.com/yourusername/fauxdoorz.git
cd fauxdoorz
- Install dependencies
pnpm install
# or
npm install
- Set up environment variables
Create a
.env.local
file:
MONGODB_URI=your_mongodb_connection_string
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your_nextauth_secret
- Start the development server
pnpm dev
# or
npm run dev
fauxdoorz/
├── components/
│ ├── dashboard/
│ │ └── PropertyForm.js
│ ├── PropertyCard.js
│ ├── Navbar.js
│ └── Footer.js
├── models/
│ ├── User.js
│ ├── Property.js
│ └── Session.js
├── pages/
│ ├── api/
│ │ ├── auth/
│ │ │ ├── [...nextauth].js
│ │ │ ├── signup.js
│ │ │ └── session.js
│ │ └── properties/
│ │ ├── create.js
│ │ └── index.js
│ ├── auth/
│ │ ├── signin.js
│ │ └── signup.js
│ └── dashboard/
│ └── properties.js
└── utils/
├── dbConnect.js
└── sessionTracker.js
GET/POST /api/auth/signin
: NextAuth.js signinGET/POST /api/auth/signout
: NextAuth.js signoutGET /api/auth/session
: Get current sessionGET /api/auth/csrf
: Get CSRF token
GET /api/properties
: List all propertiesPOST /api/properties/create
: Create new propertyGET /api/properties/[id]
: Get property detailsPUT /api/properties/[id]
: Update propertyDELETE /api/properties/[id]
: Delete property
{
name: String,
email: String,
password: String,
role: String,
properties: [ObjectId],
createdAt: Date
}
{
title: String,
description: String,
location: String,
pricePerNight: Number,
images: [String],
owner: ObjectId,
status: String,
createdAt: Date
}
{
userId: ObjectId,
email: String,
lastActivity: Date,
isActive: Boolean,
deviceInfo: String,
ipAddress: String
}
Required environment variables:
MONGODB_URI=your_mongodb_connection_string
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your_nextauth_secret_key
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License.
Note: Authentication is handled through NextAuth.js. Direct API endpoints for signin/signup are not used.