A full-stack real estate platform with a Spring Boot + MongoDB backend and a React + Vite frontend. The application supports JWT authentication, role-based access, property management, image uploads, buyer purchase flows, and an admin dashboard.
- Java 17
- Spring Boot 3.4.4
- Spring Web
- Spring Security
- Spring Data MongoDB
- JWT (
jjwt) - Bean Validation
- Lombok
- Docker
- React 19
- Vite 6
- React Router DOM 7
- Axios
- Tailwind CSS
- Framer Motion
- Lucide React
Realestate-Management-System/
├── RealestateApiServer/ # Spring Boot backend
├── realestate-frontend/ # React Vite frontend
└── .github/workflows/ # GitHub Actions workflows
- User registration
- Login with JWT access and refresh tokens
- Automatic token refresh in Axios interceptor
- Role-based route protection
ROLE_BUYERROLE_AGENTROLE_ADMIN
- Create property listings with multipart image upload
- Update property details and images
- Delete listings
- Browse available properties
- Property details page
- Property purchase flow for buyers
- Owned properties page for buyers
- My Listings page for agents and admins
- Admin dashboard overview
- User listing and user details
- Role update for users
- Global property management
- Property details and agent reassignment
- Filesystem-based image storage
- Static image serving from backend
- Multiple image upload
- Frontend fallback handling for missing/broken images
Controller: REST endpointsService: business logicRepository: MongoDB data accessSecurity: JWT filter, token service, user details serviceConfig: security, password encoder, static resource mapping
src/modules: feature pages grouped by domainsrc/components: reusable UIsrc/api: Axios configurationsrc/utils: auth, property, theme helperssrc/shared: shared constants and helpers
POST /api/auth/registerPOST /api/auth/loginPOST /api/auth/refresh
GET /api/propertiesGET /api/properties/searchGET /api/properties/{id}GET /api/properties/buyer/{buyerId}POST /api/properties/addPUT /api/properties/{id}PATCH /api/properties/{id}/purchase/{buyerId}DELETE /api/properties/{id}
POST /api/upload/imagesGET /api/upload/images/{filename}
GET /api/admin/summaryGET /api/admin/usersGET /api/admin/users/{id}PATCH /api/admin/users/{id}/roleGET /api/admin/propertiesGET /api/admin/properties/{id}PATCH /api/admin/properties/{id}/reassign-agent
Set these as environment variables or rely on local defaults where noted:
MONGODB_URI=mongodb://localhost:27017/realestate_db
UPLOAD_DIR=/var/www/realestate/uploads
JWT_SECRET=change-this-to-a-strong-secret-with-32-plus-characters
CORS_ALLOWED_ORIGINS=http://localhost:3000,http://localhost:5173Useful defaults from application.properties:
- MongoDB defaults to
mongodb://localhost:27017/realestate_db - access token expiry: 15 minutes
- refresh token expiry: 7 days
VITE_API_BASE_URL=http://localhost:8080For GitHub Pages deployment, set the repository variable:
VITE_API_BASE_URL=https://your-backend-domaincd RealestateApiServer
mvn spring-boot:runBackend runs on:
http://localhost:8080cd realestate-frontend
npm install
npm run devFrontend runs on:
http://localhost:3000cd RealestateApiServer
mvn -q -DskipTests compilecd realestate-frontend
npm run buildThe backend includes a Dockerfile:
cd RealestateApiServer
docker build -t realestate-api .
docker run -p 8080:8080 realestate-apiThe frontend now includes a GitHub Actions workflow:
.github/workflows/deploy-frontend.yml
It:
- installs frontend dependencies
- builds the Vite app
- publishes
realestate-frontend/distto GitHub Pages
- Go to repository
Settings > Pages - Set source to
GitHub Actions - Add repository variable
VITE_API_BASE_URLif your backend is deployed elsewhere
- The frontend uses
BrowserRouterwith a Vitebasepath so GitHub Pages subpath deployment works. - The backend stores uploaded images on the server filesystem, so production deployments must ensure
UPLOAD_DIRis writable and persistent. - Admin routes exist on both backend and frontend, but admin registration is not public.
Current project state has been verified with:
cd RealestateApiServer && mvn -q -DskipTests compile
cd realestate-frontend && npm run build- Rahul Raman Dash
- Ayush Samanta