This project is a Property Management web application built with Next.js. It allows users to browse properties, view detailed property information, and manage property listings. Authentication is handled through NextAuth with Google as the login provider.
- Browse properties with detailed information.
- Google OAuth for authentication and property management.
- Responsive design for mobile and desktop devices.
- Image management using Cloudinary.
- Next.js
- React
- Tailwind CSS
- MongoDB
- Mongoose
- NextAuth.js
- React Icons
- Photoswipe
- Cloudinary
- Mapbox
- React Map GL
- React Geocode
- React Spinners
- React Toastify
- React Share
- Node.js version 18 or higher
- MongoDB Atlas account and a cluster. Sign up and create a cluster at MongoDB
- Cloudinary account. Sign up at Cloudinary
- Google console account. Sign up at Google Cloud
- Mapbox account. Sign up at Mapbox
git clone https://github.com/penn201500/property-management-nextjs
cd property-management-nextjs
Make sure you have node
and npm
installed, then run:
npm install
Create a .env
file in the root directory and add the following environment variables:
MONGODB_URI=mongodb+srv://mongo:...
NEXT_PUBLIC_DOMAIN=http://localhost:3000
NEXT_PUBLIC_API_DOMAIN=http://localhost:3000/api
GOOGLE_CLIENT_ID=<your-google-client-id>
GOOGLE_CLIENT_SECRET=<your-google-client-secret>
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_URL_INTERNAL=http://localhost:3000
NEXTAUTH_SECRET=<random-string>
CLOUDINARY_CLOUD_NAME=<your-cloudinary-cloud-name>
CLOUDINARY_API_KEY=<your-cloudinary-api-key>
CLOUDINARY_API_SECRET=<your-cloudinary-api-secret>
NEXT_PUBLIC_GOOGLE_GEOCODING_API_KEY=<your-google-geocoding-api-key>
NEXT_PUBLIC_MAPBOX_TOKEN=<your-mapbox-token>
- Generate a random string for
NEXTAUTH_SECRET
using the following command:
openssl rand -base64 32
npm run dev
The app will be available at http://localhost:3000
.
To create an optimized production build, run:
npm run build
- app/: Main application logic and page components.
- components/: Reusable UI components.
- context/: Global state management using React Context API.
- models/: Mongoose models for MongoDB.
- public/: Static assets.
- utils/: Utility functions.
This project is licensed under the MIT License.