From f8f86a2fd25fd8f97ebb74aa807449eb5f0d0a9d Mon Sep 17 00:00:00 2001 From: Saikat Das <151205239+SaikatDash@users.noreply.github.com> Date: Wed, 14 Jan 2026 12:24:31 +0530 Subject: [PATCH 1/2] Update property.js --- backend/models/property.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/backend/models/property.js b/backend/models/property.js index 695c946..a7d7f3e 100644 --- a/backend/models/property.js +++ b/backend/models/property.js @@ -2,6 +2,25 @@ const mongoose = require("mongoose"); const propertySchema = new mongoose.Schema( { + title: String, + price: Number, + category: String, + + city: String, + state: String, + area: String, + + location: { + type: { + type: String, + enum: ["Point"], + required: true + }, + coordinates: { + type: [Number], // [longitude, latitude] + required: true + } + } title: { type: String, required: [true, "Title is required"], @@ -163,5 +182,4 @@ propertySchema.virtual("isAvailable").get(function () { }); const Property = mongoose.model("Property", propertySchema); - module.exports = Property; From 217a7cf54e63bf45d7d427e715d41203970fb44d Mon Sep 17 00:00:00 2001 From: Saikat Das <151205239+SaikatDash@users.noreply.github.com> Date: Wed, 14 Jan 2026 12:38:17 +0530 Subject: [PATCH 2/2] Add property routes to server application --- backend/server.js | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/server.js b/backend/server.js index 2b81e88..3e1558b 100644 --- a/backend/server.js +++ b/backend/server.js @@ -1,2 +1,3 @@ // Entry point for the application require("./app"); +app.use("/api/properties", require("./routes/propertyRoutes"));