This is the backend server for Flatify, a roommate/flat listing and management web application.
It is built using Express.js and MongoDB, and deployed on Vercel.
✅ Base URL:
https://flatify-server.vercel.app
✅ Example endpoints:
- Get all listings →
/flatify
- Get featured listings →
/featured
- Get all reviews →
/reviews
- Get all banners →
/banner
- ✅ RESTful API for:
- All listings:
/flatify
- Single listing by ID:
/flatify/:id
- User-specific listings:
/flatify/mylisting/:email
- Like a listing:
/flatify/like/:id
- Featured listings:
/featured
- Reviews:
/reviews
- Banner content:
/banner
- All listings:
- ✅ MongoDB Atlas database integration
- ✅ CORS enabled for frontend access
- ✅ Environment variable support via
.env
- ✅ JSON request/response format
Layer | Technology |
---|---|
Runtime | Node.js |
Server | Express.js |
Database | MongoDB Atlas |
Deploy | Vercel |
Follow the steps below to run the Flatify Server on your local machine:
git clone https://github.com/your-username/flatify-server.git
cd flatify-server
Replace
your-username
with your actual GitHub username.
npm install
Create a .env
file in the root directory and add the following:
PORT=5000
MONGODB_URI=your_mongodb_connection_string
Make sure your MongoDB URI is from a MongoDB Atlas cluster or a local MongoDB server.
npm run dev
This assumes you have a script like
"dev": "nodemon index.js"
in yourpackage.json
. If not, usenode index.js
.
Once the server is running, go to:
http://localhost:5000/flatify
You should see the JSON data returned from the API 🎉