Skip to content

Latest commit

Β 

History

80 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

UrbanNest Banner

🏠 UrbanNest β€” Real Estate Marketplace

A full-stack real estate marketplace to discover, list, and manage property rentals and sales. Built with the MERN stack, JWT authentication, and a premium amber/orange design system.

Live Demo GitHub React Node.js License

πŸ“Œ Table of Contents

🧭 Overview

UrbanNest is a production-grade real estate marketplace where users can browse properties for sale or rent, post listings with photo galleries, and contact landlords directly. Built to strengthen full-stack development skills β€” with a focus on secure authentication, RESTful API design, and cloud service integration.

Feature Detail
πŸ” Authentication JWT (HTTP-only cookies) + Google OAuth via Firebase
πŸ”‘ Password Reset 3-step email flow β€” SHA-256 hashed token, 1-hour expiry
🏘️ Listings Full CRUD with up to 6 Cloudinary-hosted photos per listing
πŸ”Ž Search & Filter Filter by type, offer, parking, furnished Β· sort Β· pagination
πŸ“± Responsive Mobile, tablet, and desktop

πŸ“Έ Screenshots

🏑 Home Page

Home Page

πŸ” Sign In & Sign Up

Sign In Sign Up
Sign In Sign Up

πŸ”‘ Forgot Password β€” 3-Step Flow

Step 1 β€” Enter Email Step 2 β€” Check Inbox Step 3 β€” Set New Password
Step 1 Step 2 Step 3

πŸ”Ž Search & Listing Detail

| Search |--------|---------------| | Search |

βž• Create & Edit Listing

Create Update
Create Update

πŸ‘€ Profile & About

Profile About
Profile About

πŸ› οΈ Tech Stack

Layer Technologies
Frontend React 19, Vite, Tailwind CSS 4, Redux Toolkit + Persist, React Router v7, Swiper.js, Axios
Backend Node.js, Express, MongoDB, Mongoose, JWT, bcryptjs
Services Firebase (Google OAuth) Β· Cloudinary (image CDN) Β· Nodemailer (emails)
Deployment Vercel (frontend + backend)

πŸš€ Getting Started

Prerequisites

Setup

# 1. Clone the repo
git clone https://github.com/AqibNiazi/urban-nest.git
cd urban-nest

# 2. Install backend dependencies
cd server && npm install

# 3. Install frontend dependencies
cd ../client && npm install

# 4. Add .env files (see Environment Variables below)

# 5. Run backend β†’ http://localhost:3000
cd server && npm run dev

# 6. Run frontend β†’ http://localhost:5173
cd ../client && npm run dev

Add resetPasswordToken and resetPasswordExpires fields to your User schema β€” see user.model.js.

πŸ”‘ Environment Variables

server/.env

MONGO_URI=mongodb+srv://<user>:<pass>@cluster.mongodb.net/urban-nest
JWT_SECRET=your_jwt_secret
NODE_ENV=development
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USER=your@gmail.com
EMAIL_PASS=your-gmail-app-password
CLIENT_URL=http://localhost:5173

For Gmail, generate an App Password at myaccount.google.com β†’ Security β†’ App Passwords.

client/.env

VITE_WEBSITE_BASE_URL=http://localhost:3000
VITE_FIREBASE_API_KEY=AIza...
VITE_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
VITE_FIREBASE_PROJECT_ID=your-project
VITE_FIREBASE_STORAGE_BUCKET=your-project.appspot.com
VITE_FIREBASE_MESSAGING_SENDER_ID=123456789
VITE_FIREBASE_APP_ID=1:123456789:web:abc123

πŸ“‘ API Reference

Auth β€” /api/auth

Method Endpoint Auth Description
POST /signup ❌ Register new user
POST /signin ❌ Sign in, sets JWT cookie
POST /google ❌ Google OAuth
POST /signout βœ… Clear auth cookie
POST /forgot-password ❌ Send reset email
POST /reset-password ❌ Set new password via token

Users β€” /api/user

Method Endpoint Auth Description
GET /get-user/:id βœ… Get user profile
POST /upload-avatar βœ… Upload profile photo
PUT /update-user/:id βœ… Update account
DELETE /delete-user/:id βœ… Delete account
GET /user-listings/:id βœ… Get user's listings

Listings β€” /api/listing

Method Endpoint Auth Description
POST /create-listing βœ… Create listing
GET /get-listing/:id ❌ Get single listing
PUT /update-listing/:id βœ… Update (owner only)
DELETE /delete-listing/:id βœ… Delete (owner only)
GET /get-listings ❌ Search with filters

Search params: searchTerm Β· type Β· offer Β· parking Β· furnished Β· sort Β· order Β· startIndex Β· limit

☁️ Deployment

Both services are deployed on Vercel as separate projects.

Service Root Directory Framework
Frontend client/ Vite
Backend server/ Node.js

Production checklist:

  • Set NODE_ENV=production on backend
  • Update CLIENT_URL to your frontend Vercel URL
  • Add Vercel domain to Firebase Authorized Domains
  • Set JWT cookie secure: true, sameSite: 'none'
  • Add vercel.json in client/ to fix React Router on direct URL visits
{ "rewrites": [{ "source": "/(.*)", "destination": "/index.html" }] }

πŸ‘¨β€πŸ’» Author

Aqib Niazi β€” Full Stack Engineer

GitHub LinkedIn

πŸ“„ License

MIT β€” see LICENSE for details.

If this project helped you, consider giving it a ⭐

About

A full-stack real estate marketplace built with the MERN stack. Features JWT + Google OAuth authentication, a secure forgot-password email flow, Cloudinary image uploads, and a search/filter engine with pagination.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages