Real Estate.
Real Estate Marketplace
A MERN-stack real-estate marketplace where users browse, list, search, and inquire about properties, with Google OAuth (Firebase) plus JWT/cookie auth, a user dashboard for listings and inquiries, and filtering by price and location. Styled with Tailwind CSS.
A live demo is deployed at https://real-estate-marketplace-v6ch.onrender.com.
Project Status
Portfolio project. The listing, auth, dashboard, and search flows are implemented. Not under active development.
Key Features
- User registration and login with email/password and Google OAuth (Firebase)
- Property marketplace: list, search, and explore properties
- Detailed property views with image galleries and descriptions
- Inquiry/contact forms for properties
- User dashboard for managing listings and inquiries
- Advanced search and filtering by price, location, and other criteria
- Cookie/JWT-based session auth (Express backend); role/ownership checks on listing mutations
Architecture
Loading architecture diagram…
Diagram source
flowchart TD
B["Express backend (api/)<br/>port 3000"] -->|/api/auth| AR["auth.routes<br/>signup, signin, google, signout"]
B -->|/api/user| UR["user.routes<br/>CRUD user + user's listings"]
B -->|/api/listing| LR["listing.routes<br/>CRUD listings, search"]
B --> SL["Serves built client<br/>client/dist"]
AR --> DB[(("MongoDB"))]
UR --> DB
LR --> DB
C["React client (client/)<br/>Vite + Tailwind + Redux Toolkit"] -->|VITE_FIREBASE_API_KEY| FB["Firebase<br/>(Google OAuth)"]
C -->|fetch /api/*| B
In production, the Express server (port 3000) also serves the built React client from client/dist. In development, run the backend and the Vite dev server separately.
Technology Stack
- Frontend: React 18, Vite + SWC, Tailwind CSS, Redux Toolkit + redux-persist, react-router-dom, react-icons, swiper, Firebase (Google OAuth web SDK)
- Backend: Node.js, Express, Mongoose, bcryptjs, jsonwebtoken, cookie-parser, dotenv
- Database: MongoDB (Atlas or local)
- Auth: Firebase Google OAuth on the client; cookie/JWT verification on the server (
api/utils/verifyUser.js) - Deployment: Render (single web service hosting both API and built client)
Repository Structure
.
├── api/
│ ├── index.js # Express app, mongoose connect, serves client/dist in prod
│ ├── routes/
│ │ ├── auth.route.js # /api/auth: signup, signin, google, signout
│ │ ├── user.route.js # /api/user: user CRUD + user's listings
│ │ └── listing.route.js # /api/listing: listing CRUD + search
│ ├── controllers/ # auth/user/listing controllers
│ ├── models/ # user.model, listing.model
│ └── utils/ # verifyUser (JWT), error handling
├── client/
│ ├── src/
│ │ ├── firebase.js # Firebase web config (uses VITE_FIREBASE_API_KEY)
│ │ ├── redux/ # user slices + redux-persist
│ │ ├── components/ # pages/ # store
│ ├── vite.config.js
│ ├── tailwind.config.js
│ └── package.json
├── package.json # backend deps + build/dev scripts
└── README.md
Prerequisites
- Node.js 18+
- MongoDB (local instance or MongoDB Atlas connection string)
- A Firebase project with Google sign-in enabled, and its web API key (for the client)
Getting Started
-
Clone the repository:
git clone https://github.com/dilrukshax/Real-Estate-Marketplace cd Real-Estate-Marketplace -
Install backend dependencies (the backend
package.jsonlives at the repo root):npm install -
Configure environment variables. Create a
.envfile in the repo root from.env.example:cp .env.example .envSet
MONGODB_URIto your MongoDB connection string andJWT_SECRETto a long random value. -
Start the backend:
npm run dev # nodemon api/index.js (http://localhost:3000) -
In a second terminal, install and start the client:
cd client npm install npm run dev # Vite dev server (http://localhost:5173)Set
VITE_FIREBASE_API_KEYinclient/.envso Google OAuth works in the Vite dev server.
Environment Variables
Backend (.env at the repo root; see .env.example)
MONGODB_URI=your-mongodb-connection-string
JWT_SECRET=your-jwt-secret
PORT=3000
Client (client/.env)
VITE_FIREBASE_API_KEY=your-firebase-web-api-key
The remaining Firebase web config (authDomain, projectId, appId, measurementId) is present in client/src/firebase.js and is safe to keep in source (Firebase web config is public by design).
API Endpoints
All routes are prefixed as below; the server runs on port 3000.
| Method | Endpoint | Notes |
|---|---|---|
| POST | /api/auth/signup | Email/password signup |
| POST | /api/auth/signin | Sign in, sets cookie |
| POST | /api/auth/google | Google OAuth login |
| GET | /api/auth/signout | Sign out |
| POST | /api/user/update/:id | Update a user (auth) |
| DELETE | /api/user/delete/:id | Delete a user (auth) |
| GET | /api/user/listings/:id | List a user's listings (auth) |
| GET | /api/user/:id | Get a user (auth) |
| POST | /api/listing/create | Create a listing (auth) |
| GET | /api/listing/get | Search/list listings |
| GET | /api/listing/get/:id | Get one listing |
| POST | /api/listing/update/:id | Update a listing (auth) |
| DELETE | /api/listing/delete/:id | Delete a listing (auth) |
Database Setup
MongoDB schema is created by Mongoose from api/models/. No migrations to run — Mongoose creates collections on first write.
Running with Docker
There is no Dockerfile or docker-compose file in this repository; the production deployment uses Render.
API Documentation
No OpenAPI/Swagger file is present. The endpoint table above is derived from api/routes/*.js.
Testing
There is no automated test suite (no test script in either package.json); tests were not executed.
Deployment
The deployed demo runs on Render at https://real-estate-marketplace-v6ch.onrender.com. The build runs the root npm run build script, which installs backend and client deps and runs vite build in client/; the Express server then serves client/dist on port 3000. Use Render's npm run start-equivalent (node api/index.js).
Screenshots
Contributing
This is a personal portfolio project. If you'd like to suggest improvements, please open an issue first to discuss the change.
License
Licensed under the MIT License.
Author
Dilan Dilruksha
Software Engineer | Backend & Full-Stack Development
Portfolio: https://dilandilruksha.dev
LinkedIn: https://www.linkedin.com/in/dilan-dilruksha
GitHub: https://github.com/dilrukshax
Property marketplace with secure registration and Google OAuth login, advanced search with filtering and sorting by price and location, and rich property listings with image galleries, detailed descriptions, and contact forms.
Node.js and Express.js REST API with MongoDB and Firebase for auth and storage. React and Tailwind CSS frontend. Advanced search indexes listings by price, location, and other criteria, while image galleries and contact forms complete the end-to-end browsing experience.