Xen Estate is a full-stack real estate application built using the MERN stack (MongoDB, Express.js, React, Node.js). This application allows users to browse properties, view property details, and manage listings, creating a smooth and responsive experience for real estate needs.
- User Authentication - Sign in and sign up using email/password and OAuth options
- Property Listings - Users can create, update, and delete their property listings
- Profile Management - Users can view and update their profile information
- Real-Time Search - Search for properties by location, type, or other filters
- Responsive Design - Optimized for desktop and mobile
- Frontend: React, Redux, Tailwind CSS, Vite
- Backend: Node.js, Express.js
- Database: MongoDB
- Authentication: Firebase (OAuth), JWT
- Deployment: Vite
-
Clone the Repository
git clone https://github.com/your-username/xen_estate.git cd xen_estate
-
Install Dependencies
Install server dependencies:
cd server npm install
Install client dependencies:
cd ../client npm install
-
Environment Variables
Set up your environment variables. Create a
.env
file in theserver
directory and add:MONGO_URI=your-mongodb-connection-string JWT_SECRET=your-jwt-secret
In the
client
directory, create a.env
file to store Firebase credentials for authentication. -
Run the Application
In separate terminals for client and server:
- Client:
npm run dev
(from theclient
directory) - Server:
npm run dev
(from theserver
directory)
The client should be available at
http://localhost:3000
, and the server athttp://localhost:5000
. - Client:
The project is organized into logical directories and files:
- api/ - Contains the main entry file for API endpoints
- controllers/
auth.controller.js
- Handles authentication operations like login and signuplisting.controller.js
- Manages CRUD operations for property listingsuser.controller.js
- Handles user-related operations
- models/
listing.model.js
- Mongoose schema for property listingsuser.model.js
- Mongoose schema for users
- routes/
auth.route.js
- Routes related to authenticationlisting.route.js
- Routes for creating, updating, and deleting listingsuser.route.js
- Routes for user profiles and related actions
- utils/
error.js
- Custom error handling utilitiesverifyUser.js
- Middleware for user verification using JWT
index.js
- The main entry point of the server, initializing Express and connecting to MongoDB
- controllers/
- src/
- components/ - Reusable components for building the UI
Contact.jsx
- Contact form for inquiriesHeader.jsx
- Main navigation and headerListingItem.jsx
- Component to display individual property listingsOAuth.jsx
- OAuth functionality with FirebasePrivateRoute.jsx
- Protected route for authenticated users
- pages/ - Pages representing main application views
About.jsx
- About pageCreateListing.jsx
- Page for creating new listingsHome.jsx
- Homepage with featured listingsListing.jsx
- Detailed view of an individual listingProfile.jsx
- User profile pageSearch.jsx
- Search page for finding propertiesSignIn.jsx
- Sign-in pageSignUp.jsx
- Sign-up pageUpdateListing.jsx
- Page for updating existing listings
- redux/
user/
- Redux logic for managing user statestore.js
- Redux store setup for state management
App.jsx
- Main application file managing routes and layoutfirebase.js
- Firebase configuration for authenticationindex.css
- Global CSS stylesmain.jsx
- Root file rendering the React app
- components/ - Reusable components for building the UI
.eslintrc.cjs
- Linting configuration for code consistencypostcss.config.js
- PostCSS configuration for Tailwind CSStailwind.config.js
- Tailwind CSS configurationvite.config.js
- Vite configuration for building the React application
The backend provides the following RESTful API endpoints:
- Auth:
POST /auth/register
- Register a new userPOST /auth/login
- Login user and return JWT
- Users:
GET /users/:id
- Get user profile by IDPUT /users/:id
- Update user profile
- Listings:
GET /listings
- Retrieve all property listingsPOST /listings
- Create a new listingGET /listings/:id
- Retrieve a listing by IDPUT /listings/:id
- Update a listing by IDDELETE /listings/:id
- Delete a listing by ID
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a new branch (
git checkout -b feature-branch
) - Make your changes
- Commit the changes (
git commit -m 'Add new feature'
) - Push to the branch (
git push origin feature-branch
) - Open a Pull Request
This project is licensed under the MIT License.
For any questions or feedback, please reach out at [email protected].