An open API service indexing awesome lists of open source software.

https://github.com/abchatterjee7/flat-broker

This full stack project features **role-based access** for users (buyers/sellers) and admins, with image uploads, enquiries, approval workflows, and dashboards. This repo contains react frontend part.
https://github.com/abchatterjee7/flat-broker

cloudinary framer-motion mern-stack postgresql tailwindcss

Last synced: about 2 months ago
JSON representation

This full stack project features **role-based access** for users (buyers/sellers) and admins, with image uploads, enquiries, approval workflows, and dashboards. This repo contains react frontend part.

Awesome Lists containing this project

README

          

# ๐Ÿข Flat Broker - Full Stack Real Estate Management System

A **complete full-stack real estate platform** for managing flat listings, built using
**React.js**, **Node.js**, **Express**, **Prisma**, **Cloudinary** and **PostgreSQL**. The project
features **role-based access** for users (buyers/sellers) and admins, with image uploads to cloudinary,
enquiries, approval workflows, and dashboards.

---

## ๐Ÿš€ Features

### ๐Ÿ” Authentication & Authorization

- JWT-based secure login
- Role-based dashboards:
- **Buyer/Seller**: Submit, view, and manage flats
- **Admin**: Approve/reject flats, view sold flats, manage enquiries

### ๐Ÿ˜๏ธ Flat Management

- Add new flat listings with **multiple images**
- View approved or pending flats
- Admin can approve, reject, or mark flats as sold

### ๐Ÿ’ฌ Enquiry System

- Buyers can send enquiries for approved flats
- Sellers receive and manage enquiries
- Admin can view all enquiries across the platform

### ๐Ÿ“ธ Image Uploads to cloudinary

- Multiple image upload support via **Multer**
- Images linked to flat records
- Stored locally or can be connected to cloud storage

### ๐Ÿ’ป Frontend UI

- Built with **React + Vite**
- **Tailwind CSS** for styling (optional)
- Clean, dashboard-based layout using **React Router (v6+)**
- Fully responsive design

---

## ๐Ÿ› ๏ธ Tech Stack

| Frontend | Backend | Database |
|--------------------|---------------------|---------------|
| React.js (Vite) | Node.js + Express | PostgreSQL |
| React Router v6 | Prisma ORM | Prisma Client |
| Axios | JWT + Bcrypt | Cloudinary |
| Tailwind CSS | Multer (Image Uploads)| |

---

## ๐Ÿ“ฆ Folder Structure

```

flat-broker-app/
โ”œโ”€โ”€ flat-broker/ # React frontend
โ”‚ โ””โ”€โ”€ src/
โ”‚ โ””โ”€โ”€ components/
โ”‚ โ””โ”€โ”€ pages/
โ”‚ โ””โ”€โ”€ api/
โ”‚ โ””โ”€โ”€ App.jsx
โ”‚ โ””โ”€โ”€ .env
โ”‚ โ””โ”€โ”€ main.jsx
โ”‚
โ”œโ”€โ”€ flat-broker-backend/ # Node.js backend
โ”‚ โ””โ”€โ”€ controllers/
โ”‚ โ””โ”€โ”€ routes/
โ”‚ โ””โ”€โ”€ models/ (via Prisma)
โ”‚ โ””โ”€โ”€ middlewares/
โ”‚ โ””โ”€โ”€ .env
โ”‚ โ””โ”€โ”€ server.js
โ”‚ โ””โ”€โ”€ prisma/
โ”‚ โ””โ”€โ”€ schema.prisma

````

---

## โš™๏ธ Setup Instructions

### 1๏ธโƒฃ Backend (Express + Prisma + PostgreSQL)

```bash
cd server

# Install dependencies
npm install

# Setup .env
cp .env.example .env

# Setup DB with Prisma
npx prisma migrate dev --name init

# Start server
npm run dev
````

> Ensure PostgreSQL is running and your database URL is correctly configured in `.env`.

---

### 2๏ธโƒฃ Frontend (React + Vite)

```bash
cd client

# Install dependencies
npm install

# Setup .env
cp .env.example .env
# VITE_API_URL=http://localhost:8000/api

# Start frontend
npm run dev
```

> The React app will start at `http://localhost:5173`

---

## ๐Ÿ“ธ Image Upload Details

* Supports up to **5 images per flat**
* Images are stored on the cloud, using `cloudinary` on the backend
* File validation included (max size: 5MB per file)

---

## ๐Ÿ” Authentication Flow

* JWT token saved in `localStorage`
* Role (Admin / Buyer / Seller) also saved in `localStorage`
* Protected routes using role-based access
* Auto-redirect based on role after login

---

## ๐Ÿ“Š Dashboards

### Admin Panel

* `/admin-dash`
* View & manage:

* Pending Flats
* Approved Flats
* Sold Flats
* All Enquiries

### User Panel

* `/user-dash`
* Add new flats
* View approved flats
* Enquire about other listings
* Manage enquiries for own flats

---

## ๐Ÿงช Sample Admin Credentials

> You may hardcode or seed an admin account initially for testing

```bash
email: admin@flatbroker.com
password: admin123
```

---

## ๐Ÿง  Learning Outcomes

* Real-world **CRUD application** development
* Image uploading with **Multer**
* Auth system with **JWT & Bcrypt**
* Prisma ORM & PostgreSQL integration
* **Role-based routing** and access control
* **React Dashboards** with dynamic routing
* Environment-based configuration handling

---

## ๐Ÿ“„ License

This project is open source and available under the **MIT License**.

---

## ๐Ÿ“ฌ Find here, in case deployed live
- https://flat-broker.vercel.app