├── records ├── new ├── owner.json ├── cancellation.json ├── transaction.json ├── loan.json ├── testimonial.json ├── registration.json ├── property.json └── customer.json ├── scrshts ├── er.jpg └── home.jpg ├── public ├── css │ ├── skyline.png │ └── login.css ├── properties.png └── index0.css ├── routes ├── customer.js ├── ologin.html ├── clogin.html ├── home.html ├── about.html └── owner.js ├── package.json ├── models ├── testimonial.js ├── registration.js ├── cancellation.js ├── loan.js ├── owner.js ├── transaction.js ├── property.js └── customer.js ├── views ├── layout.hbs ├── owner │ ├── registrationlist.hbs │ ├── cancellationlist.hbs │ ├── testimoniallist.hbs │ ├── transactionlist.hbs │ ├── propertylist.hbs │ ├── loanlist.hbs │ ├── customerlist.hbs │ ├── registration.hbs │ ├── testimonial.hbs │ ├── cancellation.hbs │ ├── transaction.hbs │ ├── home.hbs │ ├── loan.hbs │ ├── customer.hbs │ └── property.hbs └── customer │ └── register.hbs ├── app.js ├── controllers └── customer.controller.js ├── .gitignore └── README.md /records/new: -------------------------------------------------------------------------------- 1 | del 2 | -------------------------------------------------------------------------------- /scrshts/er.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Defcon27/Real-Estate-Management-System-using-NodeJS-Express-MongoDB/HEAD/scrshts/er.jpg -------------------------------------------------------------------------------- /scrshts/home.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Defcon27/Real-Estate-Management-System-using-NodeJS-Express-MongoDB/HEAD/scrshts/home.jpg -------------------------------------------------------------------------------- /public/css/skyline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Defcon27/Real-Estate-Management-System-using-NodeJS-Express-MongoDB/HEAD/public/css/skyline.png -------------------------------------------------------------------------------- /public/properties.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Defcon27/Real-Estate-Management-System-using-NodeJS-Express-MongoDB/HEAD/public/properties.png -------------------------------------------------------------------------------- /public/index0.css: -------------------------------------------------------------------------------- 1 | 2 | 3 | .button{ 4 | padding-left: 600px; 5 | padding-top: 320px; 6 | } 7 | 8 | .btn-outline-secondary { 9 | font-size: 30px; 10 | } 11 | .btn-outline-dark {font-size: 30px} 12 | -------------------------------------------------------------------------------- /routes/customer.js: -------------------------------------------------------------------------------- 1 | //jshint esversion:6 2 | const router = require('express').Router(); 3 | const customer = require('../controllers/customer.controller'); 4 | 5 | 6 | router.get("/login", customer.loginGet); 7 | 8 | router.post("/register", customer.register); 9 | 10 | router.post("/regsub", customer.regsub); 11 | 12 | router.post("/login", customer.login); 13 | 14 | module.exports = router; 15 | -------------------------------------------------------------------------------- /records/owner.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "_id": { 3 | "$oid": "5dbc307d39d8ed1f99873e71" 4 | }, 5 | "ownerid": 9999, 6 | "ownerpassword": "password" 7 | }, 8 | { 9 | "_id": { 10 | "$oid": "5dc300a981e0d3180cbb5213" 11 | }, 12 | "ownerid": 538, 13 | "ownerpassword": "password" 14 | }, 15 | { 16 | "_id": { 17 | "$oid": "5dc379315d0bd5ca4b6254fc" 18 | }, 19 | "ownerid": 561, 20 | "ownerpassword": "password" 21 | }, 22 | { 23 | "_id": { 24 | "$oid": "5dc379425d0bd5ca4b625505" 25 | }, 26 | "ownerid": 562, 27 | "ownerpassword": "password" 28 | }, 29 | { 30 | "_id": { 31 | "$oid": "5dc379535d0bd5ca4b625509" 32 | }, 33 | "ownerid": 249, 34 | "ownerpassword": "password" 35 | }] 36 | 37 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rms", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "start": "node app.js", 9 | "dev": "nodemon app.js" 10 | }, 11 | "author": "", 12 | "license": "ISC", 13 | "dependencies": { 14 | "body-parser": "^1.19.0", 15 | "bootstrap": "^4.3.1", 16 | "bower": "^1.8.8", 17 | "dotenv": "^16.0.2", 18 | "express": "^4.17.1", 19 | "express-handlebars": "^6.0.6", 20 | "jquery": "^3.4.1", 21 | "mongoose": "^5.7.7", 22 | "popper.js": "^1.16.0", 23 | "popups": "^1.1.3", 24 | "pug": "^3.0.2" 25 | }, 26 | "devDependencies": { 27 | "nodemon": "^2.0.20" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /routes/ologin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Login Form 7 | 8 | 9 | 10 | 11 |
12 |
13 |
14 |
Real Estate Management
15 |
16 |
17 |
18 |
19 |
20 |
21 | 22 |
23 |
24 |
25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /models/testimonial.js: -------------------------------------------------------------------------------- 1 | //jshint esversion:6 2 | const mongoose = require('mongoose'); 3 | 4 | let testimonialSchema = mongoose.Schema({ 5 | testimonialid:{ 6 | type:Number, 7 | required: 'Enter ID' 8 | }, 9 | customername:{ 10 | type:String, 11 | required:'Customer name is required !' 12 | }, 13 | occupation:{ 14 | type:String 15 | }, 16 | propertyname:{ 17 | type:String, 18 | required: 'Property name is required !' 19 | }, 20 | customerdesc:{ 21 | type:String 22 | }, 23 | customersat:{ 24 | type:String, 25 | required:'Satisfaction is required !' 26 | } 27 | 28 | }); 29 | 30 | let Testimonial = module.exports = mongoose.model('Testimonial',testimonialSchema,'testimonial'); 31 | -------------------------------------------------------------------------------- /models/registration.js: -------------------------------------------------------------------------------- 1 | //jshint esversion:6 2 | const mongoose = require('mongoose'); 3 | 4 | let registrationSchema = mongoose.Schema({ 5 | registrationid:{ 6 | type:Number, 7 | required: 'Enter ID' 8 | }, 9 | propertyname:{ 10 | type:String, 11 | required:'Property name is required !' 12 | }, 13 | customername:{ 14 | type:String, 15 | required:'Customer name is required !' 16 | }, 17 | registrationdate:{ 18 | type:String, 19 | required: 'Registration Date is required !' 20 | }, 21 | registrationstatus:{ 22 | type:String, 23 | required:'Status is required !' 24 | } 25 | 26 | }); 27 | 28 | let Registration = module.exports = mongoose.model('Registration',registrationSchema,'registration'); 29 | -------------------------------------------------------------------------------- /models/cancellation.js: -------------------------------------------------------------------------------- 1 | //jshint esversion:6 2 | const mongoose = require('mongoose'); 3 | 4 | let cancellationSchema = mongoose.Schema({ 5 | cancellationid:{ 6 | type:Number, 7 | required: 'Enter ID' 8 | }, 9 | propertyname:{ 10 | type:String, 11 | required:'Property name is required !' 12 | }, 13 | customername:{ 14 | type:String, 15 | required:'Customer name is required !' 16 | }, 17 | cancellationdate:{ 18 | type:Date, 19 | required: 'Cancellation is required !' 20 | }, 21 | amtrefund:{ 22 | type:Number, 23 | required:'Refund amt is required !' 24 | }, 25 | referencenum:{ 26 | type:String, 27 | required:'reference number is required !' 28 | } 29 | }); 30 | 31 | let Cancellation = module.exports = mongoose.model('Cancellation',cancellationSchema,'cancellation'); 32 | -------------------------------------------------------------------------------- /models/loan.js: -------------------------------------------------------------------------------- 1 | //jshint esversion:6 2 | const mongoose = require('mongoose'); 3 | 4 | let loanSchema = mongoose.Schema({ 5 | loanid:{ 6 | type:Number, 7 | required: 'Enter ID' 8 | }, 9 | bankname:{ 10 | type:String, 11 | required:'Bank name is required !' 12 | }, 13 | rate:{ 14 | type:String, 15 | required: 'Rate is required !' 16 | }, 17 | installments:{ 18 | type:Number 19 | }, 20 | fee:{ 21 | type:Number 22 | }, 23 | tenure:{ 24 | type:Number, 25 | required: 'Tenure is required' 26 | }, 27 | maxamt:{ 28 | type:Number, 29 | required:'Maximum amt is required' 30 | }, 31 | emailid:{ 32 | type:String, 33 | required: 'Email is required' 34 | } 35 | }); 36 | 37 | let Loan = module.exports = mongoose.model('Loan',loanSchema,'loan'); 38 | -------------------------------------------------------------------------------- /routes/clogin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Login Form 7 | 8 | 9 | 10 | 11 |
12 |
13 |
14 |
Real Estate Management
Customer Login
15 |
16 |
17 |
18 |
19 |
20 |
21 | 22 |
23 |
24 |
25 | 26 |
27 |
28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /models/owner.js: -------------------------------------------------------------------------------- 1 | //jshint esversion:6 2 | const mongoose = require('mongoose'); 3 | 4 | let ownerSchema = mongoose.Schema({ 5 | ownerid:{ 6 | type:Number, 7 | required: 'Enter ID' 8 | }, 9 | ownerpassword:{ 10 | type:String, 11 | required:true 12 | } 13 | // firstname:{ 14 | // type:String, 15 | // required: true 16 | // }, 17 | // middlename:{ 18 | // type:String 19 | // }, 20 | // lastname:{ 21 | // type:String, 22 | // required: true 23 | // }, 24 | // email:{ 25 | // type:String, 26 | // required: true, 27 | // }, 28 | // phonenumber:{ 29 | // type:String, 30 | // required: true, 31 | // minlength:10, 32 | // maxlength:10 33 | // }, 34 | // address:{ 35 | // type:String, 36 | // } 37 | }); 38 | 39 | let Owner = module.exports = mongoose.model('Owner',ownerSchema,'owner'); 40 | -------------------------------------------------------------------------------- /models/transaction.js: -------------------------------------------------------------------------------- 1 | //jshint esversion:6 2 | const mongoose = require('mongoose'); 3 | 4 | let transactionSchema = mongoose.Schema({ 5 | transactionid:{ 6 | type:Number, 7 | required: 'Enter ID' 8 | }, 9 | transactiondate:{ 10 | type:Date, 11 | required:'Transaction Date is required !' 12 | }, 13 | transactionmode:{ 14 | type:String, 15 | required:'Mode is required !' 16 | }, 17 | bankname:{ 18 | type:String, 19 | required: 'Bank Name is required !' 20 | }, 21 | amtpaid:{ 22 | type:Number, 23 | required:'Amount is required !' 24 | }, 25 | transactionstatus:{ 26 | type:String, 27 | required:'Status is required !' 28 | }, 29 | referencenum:{ 30 | type:String, 31 | required:'Reference Number is required !' 32 | } 33 | 34 | }); 35 | 36 | let Transaction = module.exports = mongoose.model('Transaction',transactionSchema,'transaction'); 37 | -------------------------------------------------------------------------------- /models/property.js: -------------------------------------------------------------------------------- 1 | //jshint esversion:6 2 | const mongoose = require('mongoose'); 3 | 4 | let propertySchema = mongoose.Schema({ 5 | propertyid:{ 6 | type:Number, 7 | required: 'Enter ID' 8 | }, 9 | propertyname:{ 10 | type:String, 11 | required:'Property name is required !' 12 | }, 13 | propertystatus:{ 14 | type:String, 15 | required: 'Status is required !' 16 | }, 17 | propertytype:{ 18 | type:String, 19 | required:'Type is required' 20 | }, 21 | propertybhk:{ 22 | type:String, 23 | required: 'BHK is required' 24 | }, 25 | area:{ 26 | type:Number, 27 | required: 'Area is required' 28 | }, 29 | price:{ 30 | type:Number, 31 | required:'Price is required' 32 | }, 33 | location:{ 34 | type:String, 35 | required: 'Location is required' 36 | } 37 | }); 38 | 39 | let Property = module.exports = mongoose.model('Property',propertySchema,'property'); 40 | -------------------------------------------------------------------------------- /views/layout.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Real Estate Management System 7 | 9 | 10 | 11 | 12 | 17 | 18 | 19 | 20 |
21 |
22 | {{{body}}} 23 |
24 |
25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | //jshint esversion:6 2 | const express = require("express"); 3 | const bodyParser = require("body-parser"); 4 | const app = express(); 5 | const path = require('path'); 6 | const exphbs = require('express-handlebars'); 7 | require('dotenv').config() 8 | app.use(express.static("public")); 9 | 10 | const mongoose = require('mongoose'); 11 | mongoose.connect(process.env.DB_PATH,{ useUnifiedTopology: true,useNewUrlParser: true }); 12 | var db=mongoose.connection; 13 | db.on('error', console.log.bind(console, "connection error")); 14 | db.once('open', function(callback){console.log("MongoDatabase Connected Successfully");}); 15 | 16 | app.use(bodyParser.urlencoded({extended: true})); 17 | app.use(bodyParser.json()); 18 | app.use(express.static("public")); 19 | app.set('views', path.join(__dirname, '/views/')); 20 | app.engine('hbs', exphbs.engine({ extname: 'hbs', defaultLayout: 'layout', layoutsDir: __dirname + '/views/' })); 21 | app.set('view engine', 'hbs'); 22 | 23 | //Home route 24 | app.get("/", function(req, res){ 25 | // res.sendFile(__dirname +'/index0.html'); 26 | res.render("owner/home"); 27 | }); 28 | 29 | //Route files 30 | let owner = require('./routes/owner'); 31 | let customer = require('./routes/customer'); 32 | app.use('/owner', owner); 33 | app.use('/customer', customer); 34 | 35 | 36 | app.listen(3000, function(){ 37 | console.log("Server started on port 3000."); 38 | }); 39 | -------------------------------------------------------------------------------- /views/owner/registrationlist.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 12 | 13 |
5 |

Registration Records

6 |
9 | Add Registration 10 | Home 11 |
14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | {{#each list}} 29 | 30 | 31 | 32 | 33 | 34 | 35 | 39 | 40 | {{/each}} 41 | 42 |
Property NameCustomer NameRegistration DateRegistration Status
{{this.propertyname}}{{this.customername}}{{this.registrationdate}}{{this.registrationstatus}}
43 | -------------------------------------------------------------------------------- /records/cancellation.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "_id": { 3 | "$oid": "5dbeed0575aaff82a583d6bb" 4 | }, 5 | "cancellationid": 7211, 6 | "propertyname": "Aparna towers", 7 | "customername": "Asley", 8 | "cancellationdate": { 9 | "$date": "2016-05-14T01:33:20.201Z" 10 | }, 11 | "amtrefund": 60000, 12 | "referencenum": "DDTYU2154" 13 | }, 14 | { 15 | "_id": { 16 | "$oid": "5dbeed0575aaff82a583d6be" 17 | }, 18 | "cancellationid": 7212, 19 | "propertyname": "Modern appartments", 20 | "customername": "Chitresh", 21 | "cancellationdate": { 22 | "$date": "2017-05-06T01:25:20.201Z" 23 | }, 24 | "amtrefund": 100000, 25 | "referencenum": "DSSRA1319" 26 | }, 27 | { 28 | "_id": { 29 | "$oid": "5dbeed0575aaff82a583d6c1" 30 | }, 31 | "cancellationid": 7213, 32 | "propertyname": "MyHome Villas", 33 | "customername": "Arjun", 34 | "cancellationdate": { 35 | "$date": "2015-11-10T07:29:20.201Z" 36 | }, 37 | "amtrefund": 200000, 38 | "referencenum": "DOOPA0984" 39 | }, 40 | { 41 | "_id": { 42 | "$oid": "5dbeed0575aaff82a583d6c4" 43 | }, 44 | "cancellationid": 7214, 45 | "propertyname": "Lodha towers", 46 | "customername": "Manas", 47 | "cancellationdate": { 48 | "$date": "2016-05-23T01:42:20.201Z" 49 | }, 50 | "amtrefund": 70000, 51 | "referencenum": "DTUYA7560" 52 | }, 53 | { 54 | "_id": { 55 | "$oid": "5dbeed0575aaff82a583d6c7" 56 | }, 57 | "cancellationid": 7215, 58 | "propertyname": "Jains towers", 59 | "customername": "Anand", 60 | "cancellationdate": { 61 | "$date": "2018-02-09T22:29:20.201Z" 62 | }, 63 | "amtrefund": 800000, 64 | "referencenum": "DPYUA3568" 65 | }] 66 | 67 | -------------------------------------------------------------------------------- /views/owner/cancellationlist.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 12 | 13 |
5 |

Cancellation Records

6 |
9 | Add Cancellation 10 | Home 11 |
14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | {{#each list}} 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 41 | 42 | {{/each}} 43 | 44 |
Property NameCustomer NameCancellation DateRefundReference Id
{{this.propertyname}}{{this.customername}}{{this.cancellationdate}}{{this.amtrefund}}{{this.referencenum}} 38 | 40 |
45 | -------------------------------------------------------------------------------- /views/owner/testimoniallist.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 12 | 13 |
5 |

Testimonial Records

6 |
9 | Add Testimonial 10 | Home 11 |
14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | {{#each list}} 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 41 | 42 | {{/each}} 43 | 44 |
Customer NameOccupationProperty NameCustomer DescriptionCustomer Satisfaction (/10)
{{this.customername}}{{this.occupation}}{{this.propertyname}}{{this.customerdesc}}{{this.customersat}} 38 | 40 |
45 | -------------------------------------------------------------------------------- /models/customer.js: -------------------------------------------------------------------------------- 1 | //jshint esversion:6 2 | const mongoose = require('mongoose'); 3 | 4 | let customerSchema = mongoose.Schema({ 5 | customerid:{ 6 | type:Number, 7 | required: 'Enter ID' 8 | }, 9 | customerpassword:{ 10 | type:String, 11 | required:'Password is required' 12 | }, 13 | firstname:{ 14 | type:String, 15 | required:'First Name is required' 16 | }, 17 | middlename:{ 18 | type:String 19 | }, 20 | lastname:{ 21 | type:String, 22 | required: 'Last name is required' 23 | }, 24 | emailid:{ 25 | type:String, 26 | required: 'Email ID is required' 27 | }, 28 | dateofbirth:{ 29 | type:Date, 30 | required:'Birthdate is required' 31 | }, 32 | phonenumber:{ 33 | type:String, 34 | required: 'Phone number is required', 35 | minlength:10, 36 | maxlength:10 37 | }, 38 | occupation:{ 39 | type:String, 40 | required:'Occupation is required' 41 | }, 42 | annualincome:{ 43 | type:Number, 44 | required:'Annual Income is required' 45 | }, 46 | address:{ 47 | type:String, 48 | required: 'Address is required' 49 | } 50 | }); 51 | 52 | customerSchema.path('emailid').validate((val) => { 53 | emailRegex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; 54 | return emailRegex.test(val); 55 | }, 'Invalid e-mail.'); 56 | 57 | 58 | let Customer = module.exports = mongoose.model('Customer',customerSchema,'customer'); 59 | -------------------------------------------------------------------------------- /views/owner/transactionlist.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 12 | 13 |
5 |

Transaction Records

6 |
9 | Add Transaction 10 | Home 11 |
14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | {{#each list}} 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 42 | 43 | {{/each}} 44 | 45 |
Transaction DateTransaction ModeBank NameAmountTransaction StatusReference Id
{{this.transactiondate}}{{this.transactionmode}}{{this.bankname}}{{this.amtpaid}}{{this.transactionstatus}}{{this.referencenum}}
46 | -------------------------------------------------------------------------------- /views/owner/propertylist.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 12 | 13 |
5 |

Property Records

6 |
9 | Add Property 10 | Home 11 |
14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | {{#each list}} 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 43 | 44 | {{/each}} 45 | 46 |
Property NameStatusTypeBHKArea(SQ. Ft)PriceLocation
{{this.propertyname}}{{this.propertystatus}}{{this.propertytype}}{{this.propertybhk}}{{this.area}}{{this.price}}{{this.location}} 40 | Edit 41 | Delete 42 |
47 | -------------------------------------------------------------------------------- /views/owner/loanlist.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 12 | 13 |
5 |

Loan Provider Records

6 |
9 | Add Loan 10 | Home 11 |
14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | {{#each list}} 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 45 | 46 | {{/each}} 47 | 48 |
Bank NameRate Of Interest(%)InstallmentsProcessing FeeTenureMaximum AmountEmail ID
{{this.bankname}}{{this.rate}}{{this.installments}}{{this.fee}}{{this.tenure}}{{this.maxamt}}{{this.emailid}} 42 | Edit 43 | Delete 44 |
49 | -------------------------------------------------------------------------------- /views/owner/customerlist.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 12 | 13 |
5 |

Customers Records

6 |
9 | Add Customer 10 | Home 11 |
14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | {{#each list}} 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 45 | 46 | {{/each}} 47 | 48 |
First NameLast NameEmailBirthdayPhoneOccupationIncomeAddress
{{this.firstname}}{{this.lastname}}{{this.emailid}}{{this.dateofbirth}}{{this.phonenumber}}{{this.occupation}}{{this.annualincome}}{{this.address}} 42 | Edit 43 | Delete 44 |
49 | -------------------------------------------------------------------------------- /routes/home.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Real Estate Management Systems 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 18 | 19 | 20 | 36 |
37 |
38 | properties 39 |

Real Estate Management System

40 |
41 |
42 |
43 | Manage Customers 44 | Manage Properties 45 | Manage Loans 46 | Registrations 47 | Testimonials 48 | Transactions 49 | Cancellations 50 |
51 | 52 | 53 | -------------------------------------------------------------------------------- /controllers/customer.controller.js: -------------------------------------------------------------------------------- 1 | const express = require('express') 2 | const router = express.Router() 3 | router.use(express.static("public")); 4 | 5 | let Customer = require('../models/customer'); 6 | let cid=1110; 7 | 8 | function register(req,res){ 9 | res.render("customer/register",{ 10 | viewTitle: "Customer Registration Form" 11 | }); 12 | } 13 | 14 | function regsub(req, res){ 15 | let customer = new Customer(); 16 | cid=cid+1; 17 | console.log(cid); 18 | customer.customerid = cid; 19 | customer.email=req.body.email; 20 | customer.customerpassword=req.body.customerpassword; 21 | customer.firstname=req.body.customername; 22 | customer.firstname=req.body.firstname; 23 | customer.middlename=req.body.middlename; 24 | customer.lastname=req.body.lastname; 25 | customer.dob=req.body.dob; 26 | customer.phonenumber=req.body.phonenumber; 27 | customer.occupation=req.body.occupation; 28 | customer.aincome=req.body.aincome; 29 | customer.address=req.body.address; 30 | 31 | customer.save(function(err,customer){ 32 | if (err){ 33 | console.log(err); 34 | res.send("Error"); 35 | return;} 36 | else{ 37 | console.log("Saved customer to DB"); 38 | res.redirect("/customer/login"); 39 | } 40 | }); 41 | } 42 | 43 | function login(req, res){ 44 | console.log(req.body.customerid); 45 | console.log(req.body.password); 46 | let id=req.body.customerid; 47 | let pass=req.body.password; 48 | Customer.findOne({customerid:id},function(err,customer){ 49 | if(err){ 50 | console.log(err); 51 | }else{ 52 | console.log(customer.customerpassword); 53 | if(customer.customerpassword==pass){ 54 | res.send("Logged in"); 55 | } 56 | } 57 | } 58 | 59 | ); 60 | } 61 | function loginGet(req, res){ 62 | res.sendFile(__dirname +'/clogin.html'); 63 | } 64 | 65 | 66 | const customer = { 67 | register, 68 | regsub, 69 | login, 70 | loginGet 71 | } 72 | 73 | module.exports = customer; -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | uploads/ 44 | 45 | # TypeScript v1 declaration files 46 | typings/ 47 | 48 | # TypeScript cache 49 | *.tsbuildinfo 50 | 51 | # Optional npm cache directory 52 | .npm 53 | 54 | # Optional eslint cache 55 | .eslintcache 56 | 57 | # Microbundle cache 58 | .rpt2_cache/ 59 | .rts2_cache_cjs/ 60 | .rts2_cache_es/ 61 | .rts2_cache_umd/ 62 | 63 | # Optional REPL history 64 | .node_repl_history 65 | 66 | # Output of 'npm pack' 67 | *.tgz 68 | 69 | # Yarn Integrity file 70 | .yarn-integrity 71 | 72 | # dotenv environment variables file 73 | .env 74 | .env.test 75 | 76 | # parcel-bundler cache (https://parceljs.org/) 77 | .cache 78 | 79 | # Next.js build output 80 | .next 81 | 82 | # Nuxt.js build / generate output 83 | .nuxt 84 | dist 85 | 86 | # Gatsby files 87 | .cache/ 88 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 89 | # https://nextjs.org/blog/next-9-1#public-directory-support 90 | # public 91 | 92 | # vuepress build output 93 | .vuepress/dist 94 | 95 | # Serverless directories 96 | .serverless/ 97 | 98 | # FuseBox cache 99 | .fusebox/ 100 | 101 | # DynamoDB Local files 102 | .dynamodb/ 103 | 104 | # TernJS port file 105 | .tern-port -------------------------------------------------------------------------------- /views/owner/registration.hbs: -------------------------------------------------------------------------------- 1 |

{{viewTitle}}

2 | 3 |
4 | 5 | 11 |
12 | 13 | 14 |
15 | {{registration.propertynameError}}
16 |
17 |
18 |
19 | 20 | 21 |
22 | {{registration.customernameError}}
23 |
24 |
25 | 26 | 27 |
28 | {{registration.registrationdateError}}
29 |
30 |
31 | 32 | 33 |
34 | {{registration.registrationstatusError}}
35 |
36 | 37 |
38 |
39 | 40 | View Records 41 |
42 |
43 | -------------------------------------------------------------------------------- /views/owner/testimonial.hbs: -------------------------------------------------------------------------------- 1 |

{{viewTitle}}

2 | 3 |
4 | 5 | 11 |
12 | 13 | 14 |
15 | {{testimonial.customernameError}}
16 |
17 |
18 |
19 | 20 | 21 |
22 |
23 | 24 | 25 |
26 | {{testimonial.propertynameError}}
27 |
28 |
29 | 30 | 31 |
32 |
33 | 34 | 35 |
36 | {{testimonial.customersatError}}
37 |
38 | 39 |
40 |
41 | 42 | View Records 43 |
44 |
45 | -------------------------------------------------------------------------------- /views/owner/cancellation.hbs: -------------------------------------------------------------------------------- 1 |

{{viewTitle}}

2 | 3 |
4 | 5 | 11 |
12 | 13 | 14 |
15 | {{cancellation.propertynameError}}
16 |
17 |
18 |
19 | 20 | 21 |
22 | {{cancellation.customernameError}}
23 |
24 |
25 | 26 | 27 |
28 | {{cancellation.cancellationdateError}}
29 |
30 |
31 | 32 | 33 |
34 | {{cancellation.amtrefundError}}
35 |
36 |
37 | 38 | 39 |
40 | {{cancellation.referencenumError}}
41 |
42 | 43 |
44 |
45 | 46 | View Records 47 |
48 |
49 | -------------------------------------------------------------------------------- /public/css/login.css: -------------------------------------------------------------------------------- 1 | 2 | body{ 3 | margin: 0; 4 | padding: 0; 5 | background: #fff; 6 | 7 | color: #fff; 8 | font-family: Arial; 9 | font-size: 12px; 10 | } 11 | 12 | .body{ 13 | position: absolute; 14 | top: -20px; 15 | left: -20px; 16 | right: -40px; 17 | bottom: -40px; 18 | width: auto; 19 | height: auto; 20 | background-image:url("skyline.png"); 21 | background-size: cover; 22 | -webkit-filter: blur(5px); 23 | z-index: 0; 24 | } 25 | 26 | .grad{ 27 | position: absolute; 28 | top: -20px; 29 | left: -20px; 30 | right: -40px; 31 | bottom: -40px; 32 | width: auto; 33 | height: auto; 34 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,0)), color-stop(100%,rgba(0,0,0,0.65))); 35 | z-index: 1; 36 | opacity: 0.7; 37 | } 38 | 39 | .header{ 40 | position: absolute; 41 | top: calc(50% - 35px); 42 | left: calc(50% - 450px); 43 | z-index: 2; 44 | } 45 | 46 | .header div{ 47 | float: left; 48 | color: #fff; 49 | font-family: 'Exo', sans-serif; 50 | font-size: 35px; 51 | font-weight: 200; 52 | } 53 | 54 | .header div span{ 55 | color: white; 56 | } 57 | 58 | .login{ 59 | position: absolute; 60 | top: calc(50% - 90px); 61 | left: calc(50% - 50px); 62 | height: 150px; 63 | width: 350px; 64 | padding: 10px; 65 | z-index: 2; 66 | } 67 | 68 | .login input[type=text]{ 69 | width: 250px; 70 | height: 30px; 71 | background: transparent; 72 | border: 1px solid rgba(255,255,255,0.6); 73 | border-radius: 2px; 74 | color: #fff; 75 | font-family: 'Exo', sans-serif; 76 | font-size: 16px; 77 | font-weight: 400; 78 | padding: 4px; 79 | } 80 | 81 | .login input[type=password]{ 82 | width: 250px; 83 | height: 30px; 84 | background: transparent; 85 | border: 1px solid rgba(255,255,255,0.6); 86 | border-radius: 2px; 87 | color: #fff; 88 | font-family: 'Exo', sans-serif; 89 | font-size: 16px; 90 | font-weight: 400; 91 | padding: 4px; 92 | margin-top: 10px; 93 | } 94 | 95 | .login input[type=submit]{ 96 | width: 260px; 97 | height: 35px; 98 | background: #fff; 99 | border: 1px solid #fff; 100 | cursor: pointer; 101 | border-radius: 2px; 102 | color: #a18d6c; 103 | font-family: 'Exo', sans-serif; 104 | font-size: 16px; 105 | font-weight: 400; 106 | padding: 6px; 107 | margin-top: 10px; 108 | } 109 | .login input[type=submit]:hover{ 110 | opacity: 0.8; 111 | } 112 | 113 | .login input[type=submit]:active{ 114 | opacity: 0.6; 115 | } 116 | 117 | .login input[type=text]:focus{ 118 | outline: none; 119 | border: 1px solid rgba(255,255,255,0.9); 120 | } 121 | 122 | .login input[type=password]:focus{ 123 | outline: none; 124 | border: 1px solid rgba(255,255,255,0.9); 125 | } 126 | 127 | .login input[type=submit]:focus{ 128 | outline: none; 129 | } 130 | .new{ 131 | font-size: 20px; 132 | color: white; 133 | } 134 | -------------------------------------------------------------------------------- /views/owner/transaction.hbs: -------------------------------------------------------------------------------- 1 |

{{viewTitle}}

2 | 3 |
4 | 5 | 11 |
12 | 13 | 14 |
15 | {{transaction.transactiondateError}}
16 |
17 |
18 |
19 | 20 | 21 |
22 | {{transaction.transactionmodeError}}
23 |
24 |
25 | 26 | 27 |
28 | {{transaction.banknameError}}
29 |
30 |
31 | 32 | 33 |
34 | {{transaction.amtpaidError}}
35 |
36 |
37 | 38 | 39 |
40 | {{transaction.transactionstatusError}}
41 |
42 |
43 | 44 | 45 |
46 | {{transaction.referencenumError}}
47 |
48 | 49 |
50 |
51 | 52 | View Records 53 |
54 |
55 | -------------------------------------------------------------------------------- /routes/about.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Real Estate Management Systems 6 | 7 | 8 | 9 | 10 | 11 | 12 | 27 | 28 | 29 | 30 | 46 |
47 |
48 |

About Us

49 |

50 |

The Real Estate Management system is a web application designed for any real estate agency, which has 51 | an intuitive and effortless to use to interface for both its agency owner and its customers. Here owners 52 | can log in with their given ID and password in order to manage the website. The owner can post the 53 | property that needs to be sold by the agency in the property listings. The owner of the agency can 54 | register and log into the website. Here the owner can browse through various properties listed on the 55 | website which enable the customer to find the property as per his/her requirements.

56 |

This real estate management system is developed using the latest technologies available like HTML5, 57 | JavaScript ES6, MongoDB with the intention of incorporating innovative features and enhancing the 58 | existing ones to increase the overall efficiency of the system

59 |
60 |
61 | 62 |
63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /views/owner/home.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Real Estate Management Systems 6 | 7 | 8 | 9 | 10 | 11 | 12 | 25 | 26 | 27 | 28 | 53 |
54 |
55 | 56 |

Pilla Pakodi

57 |

Some text that represents "Pakodi"...

58 |
59 |
60 |
61 | Manage Customers 62 | Manage Properties 63 | Registrations 64 | Loans 65 | Testimonials 66 | Transactions 67 | Cancellations 68 |
69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /views/owner/loan.hbs: -------------------------------------------------------------------------------- 1 |

{{viewTitle}}

2 | 3 |
4 | 5 | 11 |
12 | 13 | 14 |
15 | {{loan.banknameError}}
16 |
17 |
18 |
19 | 20 | 21 |
22 | {{loan.rateError}}
23 |
24 |
25 | 26 | 27 |
28 | 29 |
30 | 31 | 32 |
33 | 34 |
35 | 36 | 37 |
38 | {{loan.tenureError}}
39 |
40 |
41 | 42 | 43 |
44 | {{loan.maxamtError}}
45 |
46 | 47 |
48 | 49 | 50 |
51 | {{loan.emailidError}}
52 |
53 | 57 | 61 |
62 |
63 | 64 | View Records 65 |
66 |
67 | -------------------------------------------------------------------------------- /views/customer/register.hbs: -------------------------------------------------------------------------------- 1 |

{{viewTitle}}

2 | 3 |
4 | 5 |
6 | 7 | 8 |
9 |
10 | {{customer.emailError}}
11 | 17 |
18 | 19 | 20 | 21 |
22 |
23 |
24 | 25 | 26 |
27 |
28 | 29 | 30 |
31 |
32 | 33 | 34 |
35 |
36 | 37 | 38 |
39 | 40 |
41 | 42 | 43 |
44 |
45 | 46 | 47 |
48 |
49 | 50 | 51 |
52 |
53 | 54 | 55 |
56 |
57 |
58 | 59 | View All 60 |
61 |
62 | -------------------------------------------------------------------------------- /views/owner/customer.hbs: -------------------------------------------------------------------------------- 1 |

{{viewTitle}}

2 | 3 |
4 | 5 |
6 | 7 | 8 |
9 |
10 | {{customer.emailidError}}
11 | 17 | 23 |
24 |
25 | 26 | 27 |
28 | {{customer.firstnameError}}
29 |
30 |
31 | 32 | 33 |
34 |
35 | 36 | 37 |
38 | {{customer.lastnameError}}
39 |
40 |
41 | 42 | 43 |
44 | {{customer.dateofbirthError}}
45 |
46 | 47 |
48 | 49 | 50 |
51 | {{customer.phonenumberError}}
52 |
53 |
54 | 55 | 56 |
57 | {{customer.occupationError}}
58 |
59 |
60 | 61 | 62 |
63 | {{customer.annualincomeError}}
64 |
65 |
66 | 67 | 68 |
69 | {{customer.addressError}}
70 |
71 |
72 |
73 | 74 | View Records 75 |
76 |
77 | -------------------------------------------------------------------------------- /views/owner/property.hbs: -------------------------------------------------------------------------------- 1 |

{{viewTitle}}

2 | 3 | 4 | 5 | 6 | 12 | 13 | 19 |
20 | 21 | 27 |
28 | 29 | 30 |
31 | {{property.propertynameError}}
32 |
33 |
34 |
35 | 36 | 37 |
38 | {{property.propertystatusError}}
39 |
40 |
41 | 42 | 43 |
44 | {{property.propertytypeError}}
45 |
46 |
47 | 48 | 49 |
50 | {{property.propertybhkError}}
51 |
52 |
53 | 54 | 55 |
56 | {{property.areaError}}
57 |
58 |
59 | 60 | 61 |
62 | {{property.priceError}}
63 |
64 |
65 | 66 | 67 |
68 | {{property.locationError}}
69 |
70 | 74 |
75 |
76 | 77 | View Records 78 |
79 |
80 | 81 | 82 | -------------------------------------------------------------------------------- /records/transaction.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "_id": { 3 | "$oid": "5dbecdc475aaff82a583cf88" 4 | }, 5 | "transactionid": 7111, 6 | "transactiondate": { 7 | "$date": "2015-04-06T00:25:20.201Z" 8 | }, 9 | "transactionmode": "card", 10 | "bankname": "ICICI", 11 | "amtpaid": 1000000, 12 | "transactionstatus": "success", 13 | "referencenum": "CICA2636" 14 | }, 15 | { 16 | "_id": { 17 | "$oid": "5dbecdc475aaff82a583cf8b" 18 | }, 19 | "transactionid": 7112, 20 | "transactiondate": { 21 | "$date": "2013-06-24T02:43:20.201Z" 22 | }, 23 | "transactionmode": "cheque", 24 | "bankname": "HDFC", 25 | "amtpaid": 1500000, 26 | "transactionstatus": "pending", 27 | "referencenum": "BIBA2736" 28 | }, 29 | { 30 | "_id": { 31 | "$oid": "5dbecdc475aaff82a583cf8e" 32 | }, 33 | "transactionid": 7113, 34 | "transactiondate": { 35 | "$date": "2016-01-30T21:50:20.201Z" 36 | }, 37 | "transactionmode": "cash", 38 | "bankname": "SBI", 39 | "amtpaid": 2500000, 40 | "transactionstatus": "success", 41 | "referencenum": "YUTF5698" 42 | }, 43 | { 44 | "_id": { 45 | "$oid": "5dbecdc475aaff82a583cf91" 46 | }, 47 | "transactionid": 7114, 48 | "transactiondate": { 49 | "$date": "2008-03-23T23:43:20.2Z" 50 | }, 51 | "transactionmode": "cheque", 52 | "bankname": "ICICI", 53 | "amtpaid": 1000000, 54 | "transactionstatus": "success", 55 | "referencenum": "CICA2636" 56 | }, 57 | { 58 | "_id": { 59 | "$oid": "5dbecdc475aaff82a583cf94" 60 | }, 61 | "transactionid": 7115, 62 | "transactiondate": { 63 | "$date": "2007-02-15T22:35:20.2Z" 64 | }, 65 | "transactionmode": "card", 66 | "bankname": "KOTAK", 67 | "amtpaid": 1400000, 68 | "transactionstatus": "success", 69 | "referencenum": "FGTSD724" 70 | }, 71 | { 72 | "_id": { 73 | "$oid": "5dbecdc475aaff82a583cf97" 74 | }, 75 | "transactionid": 7116, 76 | "transactiondate": { 77 | "$date": "2014-08-22T04:41:20.201Z" 78 | }, 79 | "transactionmode": "cheque", 80 | "bankname": "SBI", 81 | "amtpaid": 1450000, 82 | "transactionstatus": "success", 83 | "referencenum": "ASFCV453" 84 | }, 85 | { 86 | "_id": { 87 | "$oid": "5dbecdc475aaff82a583cf9a" 88 | }, 89 | "transactionid": 7117, 90 | "transactiondate": { 91 | "$date": "2011-11-30T07:49:20.201Z" 92 | }, 93 | "transactionmode": "cash", 94 | "bankname": "INDIAN", 95 | "amtpaid": 1780000, 96 | "transactionstatus": "success", 97 | "referencenum": "HJIGHD56" 98 | }, 99 | { 100 | "_id": { 101 | "$oid": "5dbecdc475aaff82a583cf9d" 102 | }, 103 | "transactionid": 7118, 104 | "transactiondate": { 105 | "$date": "2017-09-26T05:45:20.201Z" 106 | }, 107 | "transactionmode": "cheque", 108 | "bankname": "ICICI", 109 | "amtpaid": 7800000, 110 | "transactionstatus": "success", 111 | "referencenum": "JHKJH788" 112 | }, 113 | { 114 | "_id": { 115 | "$oid": "5dbecdc475aaff82a583cfa0" 116 | }, 117 | "transactionid": 7119, 118 | "transactiondate": { 119 | "$date": "2015-04-06T00:25:20.201Z" 120 | }, 121 | "transactionmode": "card", 122 | "bankname": "SBI", 123 | "amtpaid": 1000000, 124 | "transactionstatus": "success", 125 | "referencenum": "JIYST569" 126 | }, 127 | { 128 | "_id": { 129 | "$oid": "5dbecdc475aaff82a583cfa3" 130 | }, 131 | "transactionid": 7120, 132 | "transactiondate": { 133 | "$date": "2013-07-27T03:46:20.201Z" 134 | }, 135 | "transactionmode": "cash", 136 | "bankname": "HDFC", 137 | "amtpaid": 1230000, 138 | "transactionstatus": "success", 139 | "referencenum": "JJSIJA56" 140 | }, 141 | { 142 | "_id": { 143 | "$oid": "5dbecdc475aaff82a583cfa6" 144 | }, 145 | "transactionid": 7121, 146 | "transactiondate": { 147 | "$date": "2018-03-12T23:32:20.201Z" 148 | }, 149 | "transactionmode": "cheque", 150 | "bankname": "SBI", 151 | "amtpaid": 1100000, 152 | "transactionstatus": "success", 153 | "referencenum": "NJDUYHD5" 154 | }, 155 | { 156 | "_id": { 157 | "$oid": "5dbecdc475aaff82a583cfa9" 158 | }, 159 | "transactionid": 7122, 160 | "transactiondate": { 161 | "$date": "2005-09-12T05:31:20.2Z" 162 | }, 163 | "transactionmode": "card", 164 | "bankname": "KOTAK", 165 | "amtpaid": 6700000, 166 | "transactionstatus": "pending", 167 | "referencenum": "XSDFGHT4" 168 | }, 169 | { 170 | "_id": { 171 | "$oid": "5dbecdc475aaff82a583cfac" 172 | }, 173 | "transactionid": 7123, 174 | "transactiondate": { 175 | "$date": "2010-07-18T03:37:20.201Z" 176 | }, 177 | "transactionmode": "cash", 178 | "bankname": "SBI", 179 | "amtpaid": 5500000, 180 | "transactionstatus": "success", 181 | "referencenum": "AXGHTY43" 182 | }, 183 | { 184 | "_id": { 185 | "$oid": "5dbecdc475aaff82a583cfaf" 186 | }, 187 | "transactionid": 7124, 188 | "transactiondate": { 189 | "$date": "2005-02-15T22:35:20.2Z" 190 | }, 191 | "transactionmode": "cheque", 192 | "bankname": "ICICI", 193 | "amtpaid": 1200000, 194 | "transactionstatus": "pending", 195 | "referencenum": "VBFGD53" 196 | }, 197 | { 198 | "_id": { 199 | "$oid": "5dbecdc475aaff82a583cfb2" 200 | }, 201 | "transactionid": 7125, 202 | "transactiondate": { 203 | "$date": "2006-03-08T23:28:20.2Z" 204 | }, 205 | "transactionmode": "cash", 206 | "bankname": "HDFC", 207 | "amtpaid": 1654000, 208 | "transactionstatus": "success", 209 | "referencenum": "GHYTRS23" 210 | }] 211 | 212 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Real-Estate-Management-System-using-NodeJS-Express-MongoDB 2 | 3 | [![Not Maintained](https://img.shields.io/badge/Maintenance%20Level-Not%20Maintained-yellow.svg)](https://gist.github.com/cheerfulstoic/d107229326a01ff0f333a1d3476e068d) 4 | 5 | 6 | ### The real estate management system is a web application designed for any real estate agency, which has an intuitive and effortless to use to interface for both its agency owner and its customers. Here owners can log in with their given ID and password in order to manage the website. The owner can post the property that needs to be sold by the agency in the property listings. The customers of the agency can register and log into the website. Here the customers can browse through various properties listed on the website which enable the customer to find the property as per his/her requirements 7 | 8 | ## ABSTRACT 9 | Nowadays everything is automated using computer systems, so many companies are developing web applications to provide online services to their customers. Real Estate Management System is an online web application developed for real estate builders and their customers to handle real estate consultations between the buyer and seller. This is a simple yet efficient management system to manage records of properties instead of using traditional methods to manage data like manual records or file systems. This system provides an added benefit to its customers since they no longer need to depend upon an intermediary agent who can help to find the required property. Also, their customers can always be in the comfort of their homes to check the various properties listed in the website as to their choice. Hence reducing the cost, saving time and increasing the comfort of their customers.In the case of a traditional method where the sales and purchase records are stored manually through registers or file systems which is very time consuming and inefficient. Moreover, in this kind of management, there is lots of paperwork involved for the generation of bills, reports, invoices for every transaction which needs to be sorted and maintained manually which are prone to human errors and may lead to problems like misplacing. The management of these manual records is very hard, productivity is lost using manual records, searching of manual records is tedious, the security of records is unreliable.This real estate management system is a digitalized web-based application where the entire records are maintained by the database management system itself. It provides an intuitive user interface, which is easy to use, for both the real estate builders and their customers. It will reduce manual work and helps the builder to save the records related to the details of customers, properties, transactions efficiently. Any calculations involved in the transactions will be automated increasing the work pace of the system and also reduces the possibilities of incidents of human mistakes. 10 | 11 | ## INTRODUCTION 12 | 13 | The real estate management system is a web application designed for any real estate agency, which has an intuitive and effortless to use to interface for both its agency owner and its customers. Here owners can log in with their given ID and password in order to manage the website. The owner can post the property that needs to be sold by the agency in the property listings. The customers of the agency can register and log into the website. Here the customers can browse through various properties listed on the website which enable the customer to find the property as per his/her requirements.Customers can search properties in the property listings and can then view the complete specification of each property listing with its features, location, price, etc. according to their requirements and can buy the property by initiating a registration with the property. Then the customer needs to pay the agency the price of the property that the customer wants to purchase. After successful completion of the transaction process, the property gets registered under the customer's name and the money gets wired to the agency owner. If the customer in case wants to cancel a purchase, they have made with the agency they can carry out a cancellation where the amount of the purchase will be refunded back to the customer and the property gets relisted in the owner's property listings. This method greatly enhances the speed of any process and reduces the overhead of documentation. The agency owner also provides details concerning the home loans provided by various banks which can be inquired by the customer by accessing the respective website of the bank provided by the owner. Being a web application, the agency can showcase the testimonials of its customers who have purchased a property from the agency using this real management application. 14 | 15 | ![Webpage Scrsht](https://github.com/Defcon27/Real-Estate-Management-System-using-NodeJS-Express-MongoDB/blob/master/scrshts/home.jpg) 16 | 17 | ### ER DIAGRAM FOR DATABASE 18 | ![er diagram](https://github.com/Defcon27/Real-Estate-Management-System-using-NodeJS-Express-MongoDB/blob/master/scrshts/er.jpg) 19 | 20 | ### NOTE: 21 | - Install all the dependencies with the `Node Package Manager(npm)` listed in the `dependencies.json` file 22 | - Run `app.js` to initiate the website 23 | - Port of running server is `3000` 24 | - `MongoDB` connect automatically to `27017` 25 | -------------------------------------------------------------------------------- /records/loan.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "_id": { 3 | "$oid": "5dbec76e75aaff82a583cddf" 4 | }, 5 | "loanid": 5211, 6 | "bankname": "ICICI", 7 | "rate": "8", 8 | "installments": 10, 9 | "fee": 10000, 10 | "tenure": 12, 11 | "maxamt": 800000, 12 | "emailid": "info@iciciloans.com" 13 | }, 14 | { 15 | "_id": { 16 | "$oid": "5dbec76e75aaff82a583cde2" 17 | }, 18 | "loanid": 5212, 19 | "bankname": "SBI", 20 | "rate": 7, 21 | "installments": 13, 22 | "fee": 14000, 23 | "tenure": 18, 24 | "maxamt": 500000, 25 | "emailid": "info@sbiloans.com" 26 | }, 27 | { 28 | "_id": { 29 | "$oid": "5dbec76e75aaff82a583cde5" 30 | }, 31 | "loanid": 5213, 32 | "bankname": "HDFC", 33 | "rate": 9, 34 | "installments": 8, 35 | "fee": 12000, 36 | "tenure": 18, 37 | "maxamt": 800000, 38 | "emailid": "info@hdfcloans.com" 39 | }, 40 | { 41 | "_id": { 42 | "$oid": "5dbec76e75aaff82a583cde8" 43 | }, 44 | "loanid": 5214, 45 | "bankname": "Andhra", 46 | "rate": "6", 47 | "installments": 9, 48 | "fee": 8000, 49 | "tenure": 12, 50 | "maxamt": 500000, 51 | "emailid": "info@andhraloans.com" 52 | }, 53 | { 54 | "_id": { 55 | "$oid": "5dbec76e75aaff82a583cdeb" 56 | }, 57 | "loanid": 5215, 58 | "bankname": "Karur Vysya", 59 | "rate": "8", 60 | "installments": 7, 61 | "fee": 9000, 62 | "tenure": 36, 63 | "maxamt": 900000, 64 | "emailid": "info@karurloans.com" 65 | }, 66 | { 67 | "_id": { 68 | "$oid": "5dbec76e75aaff82a583cdee" 69 | }, 70 | "loanid": 5216, 71 | "bankname": "Baroda", 72 | "rate": "7", 73 | "installments": 11, 74 | "fee": 6000, 75 | "tenure": 18, 76 | "maxamt": 800000, 77 | "emailid": "info@barodaloans.com" 78 | }, 79 | { 80 | "_id": { 81 | "$oid": "5dbec76e75aaff82a583cdf1" 82 | }, 83 | "loanid": 5217, 84 | "bankname": "BOI", 85 | "rate": "9", 86 | "installments": 8, 87 | "fee": 19000, 88 | "tenure": 24, 89 | "maxamt": 500000, 90 | "emailid": "info@boiloans.com" 91 | }, 92 | { 93 | "_id": { 94 | "$oid": "5dbec76e75aaff82a583cdf4" 95 | }, 96 | "loanid": 5218, 97 | "bankname": "Canara", 98 | "rate": "6", 99 | "installments": 6, 100 | "fee": 12000, 101 | "tenure": 24, 102 | "maxamt": 800000, 103 | "emailid": "info@canaraloans.com" 104 | }, 105 | { 106 | "_id": { 107 | "$oid": "5dbec76e75aaff82a583cdf7" 108 | }, 109 | "loanid": 5219, 110 | "bankname": "CitiBank", 111 | "rate": "8", 112 | "installments": 9, 113 | "fee": 13000, 114 | "tenure": 24, 115 | "maxamt": 600000, 116 | "emailid": "info@citiloans.com" 117 | }, 118 | { 119 | "_id": { 120 | "$oid": "5dbec76e75aaff82a583cdfa" 121 | }, 122 | "loanid": 5220, 123 | "bankname": "Dhanalakshmi", 124 | "rate": "7", 125 | "installments": 5, 126 | "fee": 10000, 127 | "tenure": 18, 128 | "maxamt": 900000, 129 | "emailid": "info@dhanaloans.com" 130 | }, 131 | { 132 | "_id": { 133 | "$oid": "5dbec76e75aaff82a583cdfd" 134 | }, 135 | "loanid": 5221, 136 | "bankname": "Federal", 137 | "rate": "9", 138 | "installments": 7, 139 | "fee": 12000, 140 | "tenure": 12, 141 | "maxamt": 500000, 142 | "emailid": "info@fedloans.com" 143 | }, 144 | { 145 | "_id": { 146 | "$oid": "5dbec76e75aaff82a583ce00" 147 | }, 148 | "loanid": 5222, 149 | "bankname": "HSBC", 150 | "rate": "6", 151 | "installments": 6, 152 | "fee": 12000, 153 | "tenure": 12, 154 | "maxamt": 800000, 155 | "emailid": "info@hsbcloans.com" 156 | }, 157 | { 158 | "_id": { 159 | "$oid": "5dbec76e75aaff82a583ce03" 160 | }, 161 | "loanid": 5223, 162 | "bankname": "India", 163 | "rate": "8", 164 | "installments": 8, 165 | "fee": 15000, 166 | "tenure": 12, 167 | "maxamt": 500000, 168 | "emailid": "info@indialoans.com" 169 | }, 170 | { 171 | "_id": { 172 | "$oid": "5dbec76e75aaff82a583ce06" 173 | }, 174 | "loanid": 5224, 175 | "bankname": "Kotak", 176 | "rate": "7", 177 | "installments": 7, 178 | "fee": 9000, 179 | "tenure": 24, 180 | "maxamt": 800000, 181 | "emailid": "info@kotakloans.com" 182 | }, 183 | { 184 | "_id": { 185 | "$oid": "5dbec76e75aaff82a583ce09" 186 | }, 187 | "loanid": 5225, 188 | "bankname": "Mahindra", 189 | "rate": "9", 190 | "installments": 9, 191 | "fee": 6000, 192 | "tenure": 36, 193 | "maxamt": 700000, 194 | "emailid": "info@mahindraloans.com" 195 | }, 196 | { 197 | "_id": { 198 | "$oid": "5dbec76e75aaff82a583ce0c" 199 | }, 200 | "loanid": 5226, 201 | "bankname": "PNB", 202 | "rate": "6", 203 | "installments": 8, 204 | "fee": 10000, 205 | "tenure": 24, 206 | "maxamt": 800000, 207 | "emailid": "info@pnbloans.com" 208 | }, 209 | { 210 | "_id": { 211 | "$oid": "5dbec76e75aaff82a583ce0f" 212 | }, 213 | "loanid": 5227, 214 | "bankname": "Standard Chartered", 215 | "rate": "8", 216 | "installments": 9, 217 | "fee": 10000, 218 | "tenure": 12, 219 | "maxamt": 500000, 220 | "emailid": "info@scloans.com" 221 | }, 222 | { 223 | "_id": { 224 | "$oid": "5dbec76e75aaff82a583ce12" 225 | }, 226 | "loanid": 5228, 227 | "bankname": "Syndicate", 228 | "rate": "7", 229 | "installments": 8, 230 | "fee": 1000, 231 | "tenure": 12, 232 | "maxamt": 800000, 233 | "emailid": "info@syndicateloans.com" 234 | }, 235 | { 236 | "_id": { 237 | "$oid": "5dbec76e75aaff82a583ce15" 238 | }, 239 | "loanid": 5229, 240 | "bankname": "Union Bank", 241 | "rate": "9", 242 | "installments": 12, 243 | "fee": 10000, 244 | "tenure": 20, 245 | "maxamt": 800000, 246 | "emailid": "info@unionloans.com" 247 | }, 248 | { 249 | "_id": { 250 | "$oid": "5dbec76e75aaff82a583ce18" 251 | }, 252 | "loanid": 5230, 253 | "bankname": "YES", 254 | "rate": "6", 255 | "installments": 10, 256 | "fee": 13000, 257 | "tenure": 18, 258 | "maxamt": 400000, 259 | "emailid": "info@yesloans.com" 260 | }] 261 | 262 | -------------------------------------------------------------------------------- /records/testimonial.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "_id": { 3 | "$oid": "5dbee3d275aaff82a583d403" 4 | }, 5 | "testimonialid": 6211, 6 | "customername": "Asley", 7 | "occupation": "Business", 8 | "propertyname": "Aparna towers", 9 | "customerdesc": "I was incredibly impressed", 10 | "customersat": "10" 11 | }, 12 | { 13 | "_id": { 14 | "$oid": "5dbee3d275aaff82a583d406" 15 | }, 16 | "testimonialid": 6212, 17 | "customername": "Koushik", 18 | "occupation": "Business", 19 | "propertyname": "NCC Villas", 20 | "customerdesc": "I am extremely pleased", 21 | "customersat": "9" 22 | }, 23 | { 24 | "_id": { 25 | "$oid": "5dbee3d275aaff82a583d409" 26 | }, 27 | "testimonialid": 6213, 28 | "customername": "Hemanth", 29 | "occupation": "Teacher", 30 | "propertyname": "JP towers", 31 | "customerdesc": "I would definitely recommend", 32 | "customersat": "10" 33 | }, 34 | { 35 | "_id": { 36 | "$oid": "5dbee3d275aaff82a583d40c" 37 | }, 38 | "testimonialid": 6214, 39 | "customername": "John", 40 | "occupation": "software developer", 41 | "propertyname": "NCC appartments", 42 | "customerdesc": " I can't thank you enough", 43 | "customersat": "9" 44 | }, 45 | { 46 | "_id": { 47 | "$oid": "5dbee3d275aaff82a583d40f" 48 | }, 49 | "testimonialid": 6215, 50 | "customername": "Chitresh", 51 | "occupation": "Business", 52 | "propertyname": "Modern appartments", 53 | "customerdesc": "You have done a great job", 54 | "customersat": "9" 55 | }, 56 | { 57 | "_id": { 58 | "$oid": "5dbee3d275aaff82a583d412" 59 | }, 60 | "testimonialid": 6216, 61 | "customername": "Devang", 62 | "occupation": "Business", 63 | "propertyname": "Alps", 64 | "customerdesc": "very professional", 65 | "customersat": "8" 66 | }, 67 | { 68 | "_id": { 69 | "$oid": "5dbee3d275aaff82a583d415" 70 | }, 71 | "testimonialid": 6217, 72 | "customername": "Yash", 73 | "occupation": "Doctor", 74 | "propertyname": "Ashville towers", 75 | "customerdesc": "loved the flexibility", 76 | "customersat": "9" 77 | }, 78 | { 79 | "_id": { 80 | "$oid": "5dbee3d275aaff82a583d418" 81 | }, 82 | "testimonialid": 6218, 83 | "customername": "Pranav", 84 | "occupation": "Manager", 85 | "propertyname": "Bayou Oaks", 86 | "customerdesc": "great", 87 | "customersat": "9" 88 | }, 89 | { 90 | "_id": { 91 | "$oid": "5dbee3d275aaff82a583d41b" 92 | }, 93 | "testimonialid": 6219, 94 | "customername": "Arshdeep", 95 | "occupation": "software developer", 96 | "propertyname": "Aliens villas", 97 | "customerdesc": "Great service!", 98 | "customersat": "8" 99 | }, 100 | { 101 | "_id": { 102 | "$oid": "5dbee3d275aaff82a583d41e" 103 | }, 104 | "testimonialid": 6220, 105 | "customername": "Sandeep", 106 | "occupation": "Doctor", 107 | "propertyname": "Aliens towers", 108 | "customerdesc": "Great service!", 109 | "customersat": "9" 110 | }, 111 | { 112 | "_id": { 113 | "$oid": "5dbee3d275aaff82a583d421" 114 | }, 115 | "testimonialid": 6221, 116 | "customername": "Arjun", 117 | "occupation": "Manager", 118 | "propertyname": "MyHome Villas", 119 | "customerdesc": "Loved the lower rate charged for services", 120 | "customersat": "10" 121 | }, 122 | { 123 | "_id": { 124 | "$oid": "5dbee3d275aaff82a583d424" 125 | }, 126 | "testimonialid": 6222, 127 | "customername": "Siva", 128 | "occupation": "Business", 129 | "propertyname": "MyHome apartments", 130 | "customerdesc": "awesome", 131 | "customersat": "9" 132 | }, 133 | { 134 | "_id": { 135 | "$oid": "5dbee3d275aaff82a583d427" 136 | }, 137 | "testimonialid": 6223, 138 | "customername": "Shashank", 139 | "occupation": "Manager", 140 | "propertyname": "Jains villas", 141 | "customerdesc": "wonderful", 142 | "customersat": "9" 143 | }, 144 | { 145 | "_id": { 146 | "$oid": "5dbee3d275aaff82a583d42a" 147 | }, 148 | "testimonialid": 6234, 149 | "customername": "Srikruth", 150 | "occupation": "Doctor", 151 | "propertyname": "Jewel Towers", 152 | "customerdesc": "very pleased", 153 | "customersat": "10" 154 | }, 155 | { 156 | "_id": { 157 | "$oid": "5dbee42775aaff82a583d43a" 158 | }, 159 | "testimonialid": 6225, 160 | "customername": "Abhishek", 161 | "occupation": "software developer", 162 | "propertyname": "Hill Crest", 163 | "customerdesc": "entire process went smoothly and worry free", 164 | "customersat": "10" 165 | }, 166 | { 167 | "_id": { 168 | "$oid": "5dbee42775aaff82a583d43d" 169 | }, 170 | "testimonialid": 6226, 171 | "customername": "Manas", 172 | "occupation": "Manager", 173 | "propertyname": "Lodha towers", 174 | "customerdesc": "I was very satisfied", 175 | "customersat": "8" 176 | }, 177 | { 178 | "_id": { 179 | "$oid": "5dbee42775aaff82a583d440" 180 | }, 181 | "testimonialid": 6227, 182 | "customername": "Ronald", 183 | "occupation": "Business", 184 | "propertyname": "Breeze appartments", 185 | "customerdesc": "We couldn't have asked for a better agent.", 186 | "customersat": "9" 187 | }, 188 | { 189 | "_id": { 190 | "$oid": "5dbee42775aaff82a583d443" 191 | }, 192 | "testimonialid": 6228, 193 | "customername": "Harry", 194 | "occupation": "Business", 195 | "propertyname": "Brook Meadows", 196 | "customerdesc": "I was incredibly impressed", 197 | "customersat": "8" 198 | }, 199 | { 200 | "_id": { 201 | "$oid": "5dbee42775aaff82a583d446" 202 | }, 203 | "testimonialid": 6229, 204 | "customername": "Dan", 205 | "occupation": "Doctor", 206 | "propertyname": "Aparna villas", 207 | "customerdesc": "We could not be more satisfied", 208 | "customersat": "9" 209 | }, 210 | { 211 | "_id": { 212 | "$oid": "5dbee42775aaff82a583d449" 213 | }, 214 | "testimonialid": 6230, 215 | "customername": "Anand", 216 | "occupation": "Teacher", 217 | "propertyname": "Jains towers", 218 | "customerdesc": "Great service!", 219 | "customersat": "10" 220 | }] 221 | 222 | -------------------------------------------------------------------------------- /records/registration.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "_id": { 3 | "$oid": "5dbed9f075aaff82a583d1e6" 4 | }, 5 | "registrationid": 4211, 6 | "propertyname": "Aparna towers", 7 | "customername": "Asley", 8 | "registrationdate": { 9 | "$date": "2006-11-13T07:32:20.2Z" 10 | }, 11 | "registrationstatus": "completed" 12 | }, 13 | { 14 | "_id": { 15 | "$oid": "5dbed9f075aaff82a583d1e9" 16 | }, 17 | "registrationid": 4212, 18 | "propertyname": "NCC Villas", 19 | "customername": "Koushik", 20 | "registrationdate": { 21 | "$date": "2010-02-05T22:25:20.201Z" 22 | }, 23 | "registrationstatus": "completed" 24 | }, 25 | { 26 | "_id": { 27 | "$oid": "5dbed9f075aaff82a583d1ec" 28 | }, 29 | "registrationid": 4213, 30 | "propertyname": "JP towers", 31 | "customername": "Hemanth", 32 | "registrationdate": { 33 | "$date": "2009-03-11T23:31:20.2Z" 34 | }, 35 | "registrationstatus": "Pending" 36 | }, 37 | { 38 | "_id": { 39 | "$oid": "5dbed9f075aaff82a583d1ef" 40 | }, 41 | "registrationid": 4214, 42 | "propertyname": "NCC appartments", 43 | "customername": "John", 44 | "registrationdate": { 45 | "$date": "2012-10-18T06:37:20.201Z" 46 | }, 47 | "registrationstatus": "completed" 48 | }, 49 | { 50 | "_id": { 51 | "$oid": "5dbed9f075aaff82a583d1f2" 52 | }, 53 | "registrationid": 4215, 54 | "propertyname": "Modern appartments", 55 | "customername": "Chitresh", 56 | "registrationdate": { 57 | "$date": "2015-12-16T08:35:20.201Z" 58 | }, 59 | "registrationstatus": "completed" 60 | }, 61 | { 62 | "_id": { 63 | "$oid": "5dbed9f075aaff82a583d1f5" 64 | }, 65 | "registrationid": 4216, 66 | "propertyname": "Alps", 67 | "customername": "Devang", 68 | "registrationdate": { 69 | "$date": "2003-11-11T07:30:20.2Z" 70 | }, 71 | "registrationstatus": "Pending" 72 | }, 73 | { 74 | "_id": { 75 | "$oid": "5dbed9f075aaff82a583d1f8" 76 | }, 77 | "registrationid": 4217, 78 | "propertyname": "Ashville towers", 79 | "customername": "Yash", 80 | "registrationdate": { 81 | "$date": "2009-11-02T07:21:20.2Z" 82 | }, 83 | "registrationstatus": "completed" 84 | }, 85 | { 86 | "_id": { 87 | "$oid": "5dbed9f075aaff82a583d1fb" 88 | }, 89 | "registrationid": 4218, 90 | "propertyname": "Bayou Oaks", 91 | "customername": "Pranav", 92 | "registrationdate": { 93 | "$date": "2015-12-16T08:35:20.201Z" 94 | }, 95 | "registrationstatus": "completed" 96 | }, 97 | { 98 | "_id": { 99 | "$oid": "5dbed9f075aaff82a583d1fe" 100 | }, 101 | "registrationid": 4219, 102 | "propertyname": "Aliens villas", 103 | "customername": "Arshdeep", 104 | "registrationdate": { 105 | "$date": "2010-10-11T06:30:20.201Z" 106 | }, 107 | "registrationstatus": "completed" 108 | }, 109 | { 110 | "_id": { 111 | "$oid": "5dbed9f075aaff82a583d201" 112 | }, 113 | "registrationid": 4220, 114 | "propertyname": "Aliens towers", 115 | "customername": "Sandeep", 116 | "registrationdate": { 117 | "$date": "2015-12-16T08:35:20.201Z" 118 | }, 119 | "registrationstatus": "completed" 120 | }, 121 | { 122 | "_id": { 123 | "$oid": "5dbed9f075aaff82a583d204" 124 | }, 125 | "registrationid": 4221, 126 | "propertyname": "MyHome Villas", 127 | "customername": "Arjun", 128 | "registrationdate": { 129 | "$date": "2015-12-16T08:35:20.201Z" 130 | }, 131 | "registrationstatus": "Pending" 132 | }, 133 | { 134 | "_id": { 135 | "$oid": "5dbed9f075aaff82a583d207" 136 | }, 137 | "registrationid": 4222, 138 | "propertyname": "MyHome apartments", 139 | "customername": "Siva", 140 | "registrationdate": { 141 | "$date": "2005-02-05T22:25:20.2Z" 142 | }, 143 | "registrationstatus": "completed" 144 | }, 145 | { 146 | "_id": { 147 | "$oid": "5dbed9f075aaff82a583d20a" 148 | }, 149 | "registrationid": 4223, 150 | "propertyname": "Jains villas", 151 | "customername": "Shashank", 152 | "registrationdate": { 153 | "$date": "2012-05-15T01:34:20.201Z" 154 | }, 155 | "registrationstatus": "completed" 156 | }, 157 | { 158 | "_id": { 159 | "$oid": "5dbed9f075aaff82a583d20d" 160 | }, 161 | "registrationid": 4224, 162 | "propertyname": "Jewel Towers", 163 | "customername": "Srikruth", 164 | "registrationdate": { 165 | "$date": "2018-03-19T23:39:20.201Z" 166 | }, 167 | "registrationstatus": "Pending" 168 | }, 169 | { 170 | "_id": { 171 | "$oid": "5dbed9f075aaff82a583d210" 172 | }, 173 | "registrationid": 4225, 174 | "propertyname": "Hill Crest", 175 | "customername": "Abhishek", 176 | "registrationdate": { 177 | "$date": "2014-06-12T02:31:20.201Z" 178 | }, 179 | "registrationstatus": "completed" 180 | }, 181 | { 182 | "_id": { 183 | "$oid": "5dbed9f075aaff82a583d213" 184 | }, 185 | "registrationid": 4226, 186 | "propertyname": "Lodha towers", 187 | "customername": "Manas", 188 | "registrationdate": { 189 | "$date": "2000-09-06T05:25:20.2Z" 190 | }, 191 | "registrationstatus": "completed" 192 | }, 193 | { 194 | "_id": { 195 | "$oid": "5dbed9f075aaff82a583d216" 196 | }, 197 | "registrationid": 4227, 198 | "propertyname": "Breeze appartments", 199 | "customername": "Ronald", 200 | "registrationdate": { 201 | "$date": "2013-01-11T21:31:20.201Z" 202 | }, 203 | "registrationstatus": "completed" 204 | }, 205 | { 206 | "_id": { 207 | "$oid": "5dbed9f075aaff82a583d219" 208 | }, 209 | "registrationid": 4228, 210 | "propertyname": "Brook Meadows", 211 | "customername": "Harry", 212 | "registrationdate": { 213 | "$date": "2012-11-18T07:37:20.201Z" 214 | }, 215 | "registrationstatus": "completed" 216 | }, 217 | { 218 | "_id": { 219 | "$oid": "5dbed9f075aaff82a583d21c" 220 | }, 221 | "registrationid": 4229, 222 | "propertyname": "Aparna villas", 223 | "customername": "Dan", 224 | "registrationdate": { 225 | "$date": "2019-10-11T06:30:20.201Z" 226 | }, 227 | "registrationstatus": "Pending" 228 | }, 229 | { 230 | "_id": { 231 | "$oid": "5dbed9f075aaff82a583d21f" 232 | }, 233 | "registrationid": 4230, 234 | "propertyname": "Jains towers", 235 | "customername": "Anand", 236 | "registrationdate": { 237 | "$date": "2019-02-18T22:38:20.201Z" 238 | }, 239 | "registrationstatus": "Pending" 240 | }, 241 | { 242 | "_id": { 243 | "$oid": "5dc38ea2438a2b2ba0e3031b" 244 | }, 245 | "registrationid": 4112, 246 | "propertyname": "Aparna", 247 | "customername": "sujith", 248 | "registrationdate": "2019-11-20", 249 | "registrationstatus": "completed", 250 | "__v": 0 251 | }] 252 | 253 | -------------------------------------------------------------------------------- /records/property.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "_id": { 3 | "$oid": "5dbe935f75aaff82a583c4aa" 4 | }, 5 | "propertyid": 3210, 6 | "propertyname": "Aparna towers", 7 | "propertystatus": "Ready to occupy", 8 | "propertytype": "Residential Appartments", 9 | "propertybhk": "3bhk", 10 | "area": 1000, 11 | "price": 8000000, 12 | "location": "Hyderabad" 13 | }, 14 | { 15 | "_id": { 16 | "$oid": "5dbe935f75aaff82a583c4ad" 17 | }, 18 | "propertyid": 3211, 19 | "propertyname": "NCC Villas", 20 | "propertystatus": "Under construction", 21 | "propertytype": "Independant house/Villa", 22 | "propertybhk": "5bhk", 23 | "area": 3050, 24 | "price": 20000000, 25 | "location": "Pune" 26 | }, 27 | { 28 | "_id": { 29 | "$oid": "5dbe935f75aaff82a583c4b0" 30 | }, 31 | "propertyid": 3212, 32 | "propertyname": "JP towers", 33 | "propertystatus": "Upcoming", 34 | "propertytype": "Residential Appartments", 35 | "propertybhk": "2bhk", 36 | "area": 850, 37 | "price": 5000000, 38 | "location": "Mumbai" 39 | }, 40 | { 41 | "_id": { 42 | "$oid": "5dbe935f75aaff82a583c4b3" 43 | }, 44 | "propertyid": 3213, 45 | "propertyname": "NCC appartments", 46 | "propertystatus": "Ready to occupy", 47 | "propertytype": "Residential Appartments", 48 | "propertybhk": "3bhk", 49 | "area": 990, 50 | "price": 8000000, 51 | "location": "Banglore" 52 | }, 53 | { 54 | "_id": { 55 | "$oid": "5dbe935f75aaff82a583c4b6" 56 | }, 57 | "propertyid": 3214, 58 | "propertyname": "Modern appartments", 59 | "propertystatus": "Under construction", 60 | "propertytype": "Residential Appartments", 61 | "propertybhk": "3bhk", 62 | "area": 1020, 63 | "price": 9500000, 64 | "location": "Chennai" 65 | }, 66 | { 67 | "_id": { 68 | "$oid": "5dbe935f75aaff82a583c4b9" 69 | }, 70 | "propertyid": 3215, 71 | "propertyname": "Alps", 72 | "propertystatus": "Upcoming", 73 | "propertytype": "Independant house/Villa", 74 | "propertybhk": "4bhk", 75 | "area": 2500, 76 | "price": 8800000, 77 | "location": "Delhi" 78 | }, 79 | { 80 | "_id": { 81 | "$oid": "5dbe935f75aaff82a583c4bc" 82 | }, 83 | "propertyid": 3216, 84 | "propertyname": "Ashville towers", 85 | "propertystatus": "Ready to occupy", 86 | "propertytype": "Residential Appartments", 87 | "propertybhk": "4bhk", 88 | "area": 1900, 89 | "price": 7000000, 90 | "location": "Noida" 91 | }, 92 | { 93 | "_id": { 94 | "$oid": "5dbe935f75aaff82a583c4bf" 95 | }, 96 | "propertyid": 3217, 97 | "propertyname": "Bayou Oaks", 98 | "propertystatus": "Under construction", 99 | "propertytype": "Residential Appartments", 100 | "propertybhk": "2bhk", 101 | "area": 600, 102 | "price": 8000000, 103 | "location": "Haryana" 104 | }, 105 | { 106 | "_id": { 107 | "$oid": "5dbe935f75aaff82a583c4c2" 108 | }, 109 | "propertyid": 3218, 110 | "propertyname": "Aliens villas", 111 | "propertystatus": "Upcoming", 112 | "propertytype": "Independant house/Villa", 113 | "propertybhk": "3bhk", 114 | "area": 990, 115 | "price": 9000000, 116 | "location": "Cochin" 117 | }, 118 | { 119 | "_id": { 120 | "$oid": "5dbe935f75aaff82a583c4c5" 121 | }, 122 | "propertyid": 3219, 123 | "propertyname": "Aliens towers", 124 | "propertystatus": "Ready to occupy", 125 | "propertytype": "Residential Appartments", 126 | "propertybhk": "2bhk", 127 | "area": 660, 128 | "price": 6500000, 129 | "location": "Udaipur" 130 | }, 131 | { 132 | "_id": { 133 | "$oid": "5dbe935f75aaff82a583c4c8" 134 | }, 135 | "propertyid": 3220, 136 | "propertyname": "MyHome Villas", 137 | "propertystatus": "Under construction", 138 | "propertytype": "Independant house/Villa", 139 | "propertybhk": "3bhk", 140 | "area": 890, 141 | "price": 9800000, 142 | "location": "Jaipur" 143 | }, 144 | { 145 | "_id": { 146 | "$oid": "5dbe935f75aaff82a583c4cb" 147 | }, 148 | "propertyid": 3221, 149 | "propertyname": "MyHome apartments", 150 | "propertystatus": "Upcoming", 151 | "propertytype": "Residential Appartments", 152 | "propertybhk": "3bhk", 153 | "area": 1400, 154 | "price": 10000000, 155 | "location": "Hyderabad" 156 | }, 157 | { 158 | "_id": { 159 | "$oid": "5dbe935f75aaff82a583c4ce" 160 | }, 161 | "propertyid": 3222, 162 | "propertyname": "Jains villas", 163 | "propertystatus": "Ready to occupy", 164 | "propertytype": "Independant house/Villa", 165 | "propertybhk": "3bhk", 166 | "area": 1000, 167 | "price": 8000000, 168 | "location": "Mumbai" 169 | }, 170 | { 171 | "_id": { 172 | "$oid": "5dbe935f75aaff82a583c4d1" 173 | }, 174 | "propertyid": 3223, 175 | "propertyname": "Jewel Towers", 176 | "propertystatus": "Under construction", 177 | "propertytype": "Residential Appartments", 178 | "propertybhk": "4bhk", 179 | "area": 1000, 180 | "price": 6800000, 181 | "location": "Chennai" 182 | }, 183 | { 184 | "_id": { 185 | "$oid": "5dbe935f75aaff82a583c4d4" 186 | }, 187 | "propertyid": 3224, 188 | "propertyname": "Hill Crest", 189 | "propertystatus": "Upcoming", 190 | "propertytype": "Independant house/Villa", 191 | "propertybhk": "4bhk", 192 | "area": 2000, 193 | "price": 8000000, 194 | "location": "Jaipur" 195 | }, 196 | { 197 | "_id": { 198 | "$oid": "5dbe935f75aaff82a583c4d7" 199 | }, 200 | "propertyid": 3225, 201 | "propertyname": "Lodha towers", 202 | "propertystatus": "Ready to occupy", 203 | "propertytype": "Residential Apartments", 204 | "propertybhk": "2bhk", 205 | "area": 670, 206 | "price": 4500000, 207 | "location": "Noida" 208 | }, 209 | { 210 | "_id": { 211 | "$oid": "5dbe935f75aaff82a583c4da" 212 | }, 213 | "propertyid": 3226, 214 | "propertyname": "Breeze appartments", 215 | "propertystatus": "Under construction", 216 | "propertytype": "Residential Appartments", 217 | "propertybhk": "2bhk", 218 | "area": 700, 219 | "price": 6000000, 220 | "location": "Hyderabad" 221 | }, 222 | { 223 | "_id": { 224 | "$oid": "5dbe935f75aaff82a583c4dd" 225 | }, 226 | "propertyid": 3227, 227 | "propertyname": "Brook Meadows", 228 | "propertystatus": "Upcoming", 229 | "propertytype": "Independant house/Villa", 230 | "propertybhk": "4bhk", 231 | "area": 1080, 232 | "price": 8000000, 233 | "location": "Haryana" 234 | }, 235 | { 236 | "_id": { 237 | "$oid": "5dbe935f75aaff82a583c4e0" 238 | }, 239 | "propertyid": 3228, 240 | "propertyname": "Aparna villas", 241 | "propertystatus": "Ready to occupy", 242 | "propertytype": "Independant house/Villa", 243 | "propertybhk": "4bhk", 244 | "area": 2550, 245 | "price": 10000000, 246 | "location": "Hyderabad" 247 | }, 248 | { 249 | "_id": { 250 | "$oid": "5dbe935f75aaff82a583c4e3" 251 | }, 252 | "propertyid": 3229, 253 | "propertyname": "Jains towers", 254 | "propertystatus": "Under construction", 255 | "propertytype": "Residential Appartments", 256 | "propertybhk": "2bhk", 257 | "area": 770, 258 | "price": 4000000, 259 | "location": "Ghaziabad" 260 | }] 261 | 262 | -------------------------------------------------------------------------------- /records/customer.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "_id": { 3 | "$oid": "5dbd898e114d9131cbf5e4d5" 4 | }, 5 | "customerid": 1101, 6 | "customerpassword": "asley", 7 | "firstname": "Asley", 8 | "middlename": "Wessley", 9 | "lastname": "Smith", 10 | "dateofbirth": { 11 | "$date": "1997-06-18T00:00:00Z" 12 | }, 13 | "emailid": "wessleysmith@gmail.com", 14 | "phonenumber": "9443915231", 15 | "occupation": "Business", 16 | "annualincome": 600000, 17 | "address": "Wandaloore" 18 | }, 19 | { 20 | "_id": { 21 | "$oid": "5dbd89a7114d9131cbf5e4dd" 22 | }, 23 | "customerid": 1102, 24 | "customerpassword": "john", 25 | "firstname": "John", 26 | "middlename": "foud", 27 | "lastname": "Smith", 28 | "dateofbirth": { 29 | "$date": "1978-06-16T00:00:00Z" 30 | }, 31 | "emailid": "johnsmith@gmail.com", 32 | "phonenumber": 7538572978, 33 | "occupation": "software developer", 34 | "annualincome": 800000, 35 | "address": "Banglore" 36 | }, 37 | { 38 | "_id": { 39 | "$oid": "5dbd89b0114d9131cbf5e4e1" 40 | }, 41 | "customerid": 1103, 42 | "customerpassword": "dan", 43 | "firstname": "Dan", 44 | "middlename": "J", 45 | "lastname": "Renolds", 46 | "dateofbirth": { 47 | "$date": "1974-11-02T00:00:00Z" 48 | }, 49 | "emailid": "wdanrenolds@gmail.com", 50 | "phonenumber": 8674563546, 51 | "occupation": "Doctor", 52 | "annualincome": 200000, 53 | "address": "Pune" 54 | }, 55 | { 56 | "_id": { 57 | "$oid": "5dbd89bc114d9131cbf5e4e5" 58 | }, 59 | "customerid": 1104, 60 | "customerpassword": "harry", 61 | "firstname": "Harry", 62 | "middlename": "James", 63 | "lastname": "Potter", 64 | "dateofbirth": { 65 | "$date": { 66 | "$numberLong": "-9849600000" 67 | } 68 | }, 69 | "emailid": "harrypotter@gmail.com", 70 | "phonenumber": 9673578901, 71 | "occupation": "Business", 72 | "annualincome": 1000000, 73 | "address": "Kammam" 74 | }, 75 | { 76 | "_id": { 77 | "$oid": "5dbd89cb114d9131cbf5e4ef" 78 | }, 79 | "customerid": 1105, 80 | "customerpassword": "ronald", 81 | "firstname": "Ronald", 82 | "middlename": "pattrick", 83 | "lastname": "Weesely", 84 | "dateofbirth": { 85 | "$date": "1971-11-02T00:00:00Z" 86 | }, 87 | "emailid": "ronaldweesely@gmail.com", 88 | "phonenumber": 9400975231, 89 | "occupation": "Business", 90 | "annualincome": 300000, 91 | "address": "Hyderabad" 92 | }, 93 | { 94 | "_id": { 95 | "$oid": "5dbd89dc114d9131cbf5e4f4" 96 | }, 97 | "customerid": 1106, 98 | "customerpassword": "hemanth", 99 | "firstname": "Hemanth", 100 | "middlename": "", 101 | "lastname": "Kollipara", 102 | "dateofbirth": { 103 | "$date": "1981-09-16T00:00:00Z" 104 | }, 105 | "emailid": "hemanthkollipara@gmail.com", 106 | "phonenumber": 9444735231, 107 | "occupation": "Teacher", 108 | "annualincome": 400000, 109 | "address": "Mumbai" 110 | }, 111 | { 112 | "_id": { 113 | "$oid": "5dbd89f7114d9131cbf5e4fa" 114 | }, 115 | "customerid": 1107, 116 | "customerpassword": "koushik", 117 | "firstname": "Koushik", 118 | "middlename": "", 119 | "lastname": "Kalakota", 120 | "dateofbirth": { 121 | "$date": "1975-05-22T00:00:00Z" 122 | }, 123 | "emailid": "koushikkalakota@gmail.com", 124 | "phonenumber": 9874563423, 125 | "occupation": "Business", 126 | "annualincome": 1000000, 127 | "address": "Khamam" 128 | }, 129 | { 130 | "_id": { 131 | "$oid": "5dbd8a03114d9131cbf5e504" 132 | }, 133 | "customerid": 1108, 134 | "customerpassword": "devang", 135 | "firstname": "Devang", 136 | "middlename": "", 137 | "lastname": "Mehrothra", 138 | "dateofbirth": { 139 | "$date": { 140 | "$numberLong": "-127526400000" 141 | } 142 | }, 143 | "emailid": "devangmeh@gmail.com", 144 | "phonenumber": 9436475231, 145 | "occupation": "Business", 146 | "annualincome": 500000, 147 | "address": "Hariyana" 148 | }, 149 | { 150 | "_id": { 151 | "$oid": "5dbd8a0e114d9131cbf5e50a" 152 | }, 153 | "customerid": 1109, 154 | "customerpassword": "pranav", 155 | "firstname": "Pranav", 156 | "middlename": "", 157 | "lastname": "Velluri", 158 | "dateofbirth": { 159 | "$date": { 160 | "$numberLong": "-1814400000" 161 | } 162 | }, 163 | "emailid": "pranavvell@gmail.com", 164 | "phonenumber": 7432757231, 165 | "occupation": "Manager", 166 | "annualincome": 600000, 167 | "address": "Trivandrum" 168 | }, 169 | { 170 | "_id": { 171 | "$oid": "5dbd8a16114d9131cbf5e50e" 172 | }, 173 | "customerid": 1110, 174 | "customerpassword": "yash", 175 | "firstname": "Yash", 176 | "middlename": "", 177 | "lastname": "Naidu", 178 | "dateofbirth": { 179 | "$date": "1975-05-22T00:00:00Z" 180 | }, 181 | "emailid": "yashnaidu@gmail.com", 182 | "phonenumber": 3649234466, 183 | "occupation": "Doctor", 184 | "annualincome": 700000, 185 | "address": "Ghaziabad" 186 | }, 187 | { 188 | "_id": { 189 | "$oid": "5dbd8a26114d9131cbf5e513" 190 | }, 191 | "customerid": 1111, 192 | "customerpassword": "arshdeep", 193 | "firstname": "Arshdeep", 194 | "middlename": "", 195 | "lastname": "Singh", 196 | "dateofbirth": { 197 | "$date": { 198 | "$numberLong": "-177984000000" 199 | } 200 | }, 201 | "emailid": "arshdeepsingh@gmail.com", 202 | "phonenumber": 4752967272, 203 | "occupation": "software developer", 204 | "annualincome": 800000, 205 | "address": "Udaipur" 206 | }, 207 | { 208 | "_id": { 209 | "$oid": "5dbd8a2f114d9131cbf5e517" 210 | }, 211 | "customerid": 1112, 212 | "customerpassword": "chitresh", 213 | "firstname": "Chitresh", 214 | "middlename": "", 215 | "lastname": "Kansal", 216 | "dateofbirth": { 217 | "$date": "1979-03-13T00:00:00Z" 218 | }, 219 | "emailid": "chitreshkansal@gmail.com", 220 | "phonenumber": 9443915233, 221 | "occupation": "Business", 222 | "annualincome": 900000, 223 | "address": "Noida" 224 | }, 225 | { 226 | "_id": { 227 | "$oid": "5dbd8a55114d9131cbf5e523" 228 | }, 229 | "customerid": 1113, 230 | "customerpassword": "arjun", 231 | "firstname": "Arjun", 232 | "middlename": "", 233 | "lastname": "Reddy", 234 | "dateofbirth": { 235 | "$date": "1975-12-12T00:00:00Z" 236 | }, 237 | "emailid": "Arjunreddy@gmail.com", 238 | "phonenumber": 9264522231, 239 | "occupation": "Manager", 240 | "annualincome": 100000, 241 | "address": "Hyderabad" 242 | }, 243 | { 244 | "_id": { 245 | "$oid": "5dbd8a5d114d9131cbf5e526" 246 | }, 247 | "customerid": 1114, 248 | "customerpassword": "sandeep", 249 | "firstname": "Sandeep", 250 | "middlename": "Vanga", 251 | "lastname": "Reddy", 252 | "dateofbirth": { 253 | "$date": "1971-05-12T00:00:00Z" 254 | }, 255 | "emailid": "sandeepreddy@gmail.com", 256 | "phonenumber": 6848324619, 257 | "occupation": "Doctor", 258 | "annualincome": 200000, 259 | "address": "Chennai" 260 | }, 261 | { 262 | "_id": { 263 | "$oid": "5dbd8a83114d9131cbf5e531" 264 | }, 265 | "customerid": 1115, 266 | "customerpassword": "anand", 267 | "firstname": "Anand", 268 | "middlename": "", 269 | "lastname": "Humar", 270 | "dateofbirth": { 271 | "$date": "1980-10-21T00:00:00Z" 272 | }, 273 | "emailid": "kumaranand@gmail.com", 274 | "phonenumber": 9442955231, 275 | "occupation": "Teacher", 276 | "annualincome": 300000, 277 | "address": "Cochin" 278 | }, 279 | { 280 | "_id": { 281 | "$oid": "5dbd8af3114d9131cbf5e546" 282 | }, 283 | "customerid": 1116, 284 | "customerpassword": "siva", 285 | "firstname": "Siva", 286 | "middlename": "Chaitanya", 287 | "lastname": "Bharathwacha", 288 | "dateofbirth": { 289 | "$date": "1981-07-22T00:00:00Z" 290 | }, 291 | "emailid": "sivachaitanya@gmail.com", 292 | "phonenumber": 7893641144, 293 | "occupation": "Business", 294 | "annualincome": 400000, 295 | "address": "Delhi" 296 | }, 297 | { 298 | "_id": { 299 | "$oid": "5dbd8af3114d9131cbf5e549" 300 | }, 301 | "customerid": 1117, 302 | "customerpassword": "shashank", 303 | "firstname": "Shashank", 304 | "middlename": "", 305 | "lastname": "Desai", 306 | "dateofbirth": { 307 | "$date": { 308 | "$numberLong": "-84412800000" 309 | } 310 | }, 311 | "emailid": "shashankdesai@gmail.com", 312 | "phonenumber": 9444328854, 313 | "occupation": "Manager", 314 | "annualincome": 500000, 315 | "address": "Hyderabad" 316 | }, 317 | { 318 | "_id": { 319 | "$oid": "5dbd8af3114d9131cbf5e54c" 320 | }, 321 | "customerid": 11118, 322 | "customerpassword": "srikruth", 323 | "firstname": "Srikruth", 324 | "middlename": "", 325 | "lastname": "Aila", 326 | "dateofbirth": { 327 | "$date": "1971-12-12T00:00:00Z" 328 | }, 329 | "emailid": "srikruthaila@gmail.com", 330 | "phonenumber": 9410020231, 331 | "occupation": "Doctor", 332 | "annualincome": 600000, 333 | "address": "Indore" 334 | }, 335 | { 336 | "_id": { 337 | "$oid": "5dbd8af3114d9131cbf5e54f" 338 | }, 339 | "customerid": 1119, 340 | "customerpassword": "abhishek", 341 | "firstname": "Abhishek", 342 | "middlename": "", 343 | "lastname": "Dharba", 344 | "dateofbirth": { 345 | "$date": "1981-01-01T00:00:00Z" 346 | }, 347 | "emailid": "abidarbs@gmail.com", 348 | "phonenumber": 6633441971, 349 | "occupation": "software developer", 350 | "annualincome": 700000, 351 | "address": "Noida" 352 | }, 353 | { 354 | "_id": { 355 | "$oid": "5dbd8af3114d9131cbf5e552" 356 | }, 357 | "customerid": 1120, 358 | "customerpassword": "Manas", 359 | "firstname": "Manas", 360 | "middlename": "", 361 | "lastname": "Aggarwal", 362 | "dateofbirth": { 363 | "$date": "1987-02-19T00:00:00Z" 364 | }, 365 | "emailid": "Manasaggarwal@gmail.com", 366 | "phonenumber": 3142536431, 367 | "occupation": "Manager", 368 | "annualincome": 800000, 369 | "address": "Vellore" 370 | }] 371 | 372 | -------------------------------------------------------------------------------- /routes/owner.js: -------------------------------------------------------------------------------- 1 | //jshint esversion:6 2 | const express = require('express'); 3 | const router = express.Router(); 4 | router.use(express.static("public")); 5 | 6 | let Owner = require('../models/owner'); 7 | let Customer = require('../models/customer'); 8 | let Property = require('../models/property'); 9 | let Registration = require('../models/registration'); 10 | let Loan = require('../models/loan'); 11 | let Testimonial = require('../models/testimonial'); 12 | let Transaction = require('../models/transaction'); 13 | let Cancellation = require('../models/cancellation'); 14 | 15 | router.get("/login", function(req, res){ 16 | res.sendFile(__dirname +'/ologin.html'); 17 | }); 18 | 19 | router.get("/home", function(req, res){ 20 | res.sendFile(__dirname +'/home.html'); 21 | }); 22 | // router.post("/home", function(req, res){ 23 | // res.sendFile(__dirname +'/home.html'); 24 | // }); 25 | router.get("/owner/home", function(req, res){ 26 | res.sendFile(__dirname +'/home.html'); 27 | }); 28 | 29 | router.get("/home/about", function(req, res){ 30 | res.sendFile(__dirname +'/about.html'); 31 | }); 32 | 33 | router.post("/login", function(req, res){ 34 | //console.log(req.body.ownerid); 35 | //console.log(req.body.password); 36 | let id=req.body.ownerid; 37 | let pass=req.body.password; 38 | Owner.findOne({ownerid:9999},function(err,owner){ 39 | if(err){ 40 | console.log(err); 41 | }else{ 42 | //console.log(owner.ownerpassword); 43 | if(owner.ownerpassword==pass){ 44 | // res.send("Logged in"); 45 | res.redirect("/owner/home"); 46 | } 47 | } 48 | } 49 | ); 50 | }); 51 | 52 | // router.get("/home", function(req, res){ 53 | // res.render("owner/home", {}); 54 | // }); 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | router.get("/home/addcustomer", function(req, res){ 65 | res.render("owner/customer", { 66 | viewTitle: "Add Customer" 67 | }); 68 | }); 69 | 70 | cid=2110; 71 | router.post('/customersub', (req, res) => { 72 | console.log(req.body._id); 73 | if (req.body._id == ''){ 74 | insertcustomerRecord(req, res);} 75 | else{ 76 | updatecustomerRecord(req, res);} 77 | }); 78 | 79 | function insertcustomerRecord(req, res){ 80 | let customer = new Customer(); 81 | cid=cid+1; 82 | console.log(cid); 83 | customer.customerid = cid; 84 | customer.emailid=req.body.emailid; 85 | customer.customerpassword=cid; 86 | customer.firstname=req.body.customername; 87 | customer.firstname=req.body.firstname; 88 | customer.middlename=req.body.middlename; 89 | customer.lastname=req.body.lastname; 90 | customer.dateofbirth=req.body.dateofbirth; 91 | customer.phonenumber=req.body.phonenumber; 92 | customer.occupation=req.body.occupation; 93 | customer.annualincome=req.body.annualincome; 94 | customer.address=req.body.address; 95 | 96 | customer.save(function(err,customer){ 97 | if (!err){ 98 | console.log("Saved property to DB"); 99 | res.redirect("/owner/home/customerlist"); 100 | } 101 | else{ 102 | console.log(err); 103 | if (err.name == 'ValidationError') { 104 | handleValidationError(err, req.body); 105 | res.render("owner/customer", { 106 | viewTitle: "Add Customer", 107 | customer: req.body 108 | }); 109 | } 110 | else 111 | console.log('Error during record insertion : ' + err); 112 | } 113 | 114 | 115 | }); 116 | } 117 | 118 | function updatecustomerRecord(req, res) { 119 | Customer.findOneAndUpdate({ _id: req.body._id }, req.body, { new: true }, (err, doc) => { 120 | if (!err) { res.redirect('home/customerlist'); } 121 | else { 122 | if (err.name == 'ValidationError') { 123 | handleValidationError(err, req.body); 124 | res.render("owner/customer", { 125 | viewTitle: 'Update Customer', 126 | customer: req.body 127 | }); 128 | } 129 | else 130 | console.log('Error during record update : ' + err); 131 | } 132 | }); 133 | } 134 | 135 | router.get('/home/customerlist', (req, res) => { 136 | Customer.find({}) 137 | .lean() 138 | .then(docs=>{ 139 | res.render("owner/customerlist", { 140 | list: docs 141 | }); 142 | }) 143 | .catch(err=>console.log("Error retrieving list.", err)) 144 | }); 145 | 146 | router.get('/home/customerupdate/:id', (req, res) => { 147 | Customer.findById(req.params.id, (err, doc) => { 148 | if (!err) { 149 | res.render("owner/customer", { 150 | viewTitle: "Update Customer", 151 | customer: doc 152 | }); 153 | } 154 | }); 155 | }); 156 | 157 | router.get('/home/customerdelete/:id', (req, res) => { 158 | Customer.findByIdAndRemove(req.params.id, (err, doc) => { 159 | if (!err) { 160 | res.redirect('/owner/home/customerlist'); 161 | } 162 | else { console.log('Error in delete :' + err); } 163 | }); 164 | }); 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | router.get("/home/addproperty", function(req, res){ 187 | res.render("owner/property", { 188 | viewTitle: "Add Property" 189 | }); 190 | }); 191 | let pid=3110; 192 | router.post('/propertysub', (req, res) => { 193 | console.log(req.body._id); 194 | if (req.body._id == ''){ 195 | insertpropertyRecord(req, res);} 196 | else{ 197 | updatepropertyRecord(req, res);} 198 | }); 199 | 200 | function insertpropertyRecord(req, res){ 201 | let property = new Property(); 202 | pid=pid+1; 203 | console.log(pid); 204 | property.propertyid = pid; 205 | property.propertyname = req.body.propertyname; 206 | property.propertystatus= req.body.propertystatus; 207 | property.propertytype = req.body.propertytype; 208 | property.propertybhk = req.body.propertybhk; 209 | property.area = req.body.area; 210 | property.price = req.body.price; 211 | property.location = req.body.location; 212 | property.save(function(err,property){ 213 | if (!err){ 214 | console.log("Saved property to DB"); 215 | res.redirect("/owner/home/propertylist"); 216 | } 217 | else{ 218 | if (err.name == 'ValidationError') { 219 | handleValidationError(err, req.body); 220 | res.render("owner/property", { 221 | viewTitle: "Add Property", 222 | property: req.body 223 | }); 224 | } 225 | else 226 | console.log('Error during record insertion : ' + err); 227 | } 228 | }); 229 | } 230 | 231 | function updatepropertyRecord(req, res) { 232 | Property.findOneAndUpdate({ _id: req.body._id }, req.body, { new: true }, (err, doc) => { 233 | if (!err) { res.redirect('home/propertylist'); } 234 | else { 235 | if (err.name == 'ValidationError') { 236 | handleValidationError(err, req.body); 237 | res.render("owner/property", { 238 | viewTitle: 'Update Property', 239 | property: req.body 240 | }); 241 | } 242 | else 243 | console.log('Error during record update : ' + err); 244 | } 245 | }); 246 | } 247 | 248 | router.get('/home/propertylist', (req, res) => { 249 | Property.find((err, docs) => { 250 | if (!err) { 251 | res.render("owner/propertylist", { 252 | list: docs 253 | }); 254 | } 255 | else { 256 | console.log('Error in retrieving list :' + err); 257 | } 258 | }); 259 | }); 260 | 261 | router.get('/home/propertyupdate/:id', (req, res) => { 262 | Property.findById(req.params.id, (err, doc) => { 263 | if (!err) { 264 | res.render("owner/property", { 265 | viewTitle: "Update Property", 266 | property: doc 267 | }); 268 | } 269 | }); 270 | }); 271 | 272 | router.get('/home/propertydelete/:id', (req, res) => { 273 | Property.findByIdAndRemove(req.params.id, (err, doc) => { 274 | if (!err) { 275 | res.redirect('/owner/home/propertylist'); 276 | } 277 | else { console.log('Error in delete :' + err); } 278 | }); 279 | }); 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | router.get("/home/addregistration", function(req, res){ 301 | res.render("owner/registration", { 302 | viewTitle: "Add Registration" 303 | }); 304 | }); 305 | let rid=4110; 306 | router.post('/registrationsub', (req, res) => { 307 | let registration = new Registration(); 308 | rid=rid+1; 309 | console.log(pid); 310 | registration.registrationid = rid; 311 | registration.propertyname = req.body.propertyname; 312 | registration.customername = req.body.customername; 313 | registration.registrationdate = req.body.registrationdate; 314 | registration.registrationstatus = req.body.registrationstatus; 315 | registration.save(function(err,property){ 316 | if (!err){ 317 | console.log("Saved registration to DB"); 318 | res.redirect("/owner/home/registrationlist"); 319 | } 320 | else{ 321 | if (err.name == 'ValidationError') { 322 | handleValidationError(err, req.body); 323 | res.render("owner/registration", { 324 | viewTitle: "Add Registration", 325 | registration: req.body 326 | }); 327 | } 328 | else 329 | console.log('Error during record insertion : ' + err); 330 | } 331 | }); 332 | 333 | }); 334 | 335 | router.get('/home/registrationlist', (req, res) => { 336 | Registration.find((err, docs) => { 337 | if (!err) { 338 | res.render("owner/registrationlist", { 339 | list: docs 340 | }); 341 | } 342 | else { 343 | console.log('Error in retrieving list :' + err); 344 | } 345 | }); 346 | }); 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | router.get("/home/addloan", function(req, res){ 378 | res.render("owner/loan", { 379 | viewTitle: "Add Loan Provider" 380 | }); 381 | }); 382 | let lid=5110; 383 | router.post('/loansub', (req, res) => { 384 | console.log(req.body._id); 385 | if (req.body._id == ''){ 386 | insertloanRecord(req, res);} 387 | else{ 388 | updateloanRecord(req, res);} 389 | }); 390 | 391 | function insertloanRecord(req, res){ 392 | let loan = new Loan(); 393 | lid=lid+1; 394 | console.log(lid); 395 | loan.loanid = lid; 396 | loan.bankname = req.body.bankname; 397 | loan.rate = req.body.rate; 398 | loan.installments = req.body.installments; 399 | loan.fee = req.body.fee; 400 | loan.tenure = req.body.tenure; 401 | loan.maxamt = req.body.maxamt; 402 | loan.emailid = req.body.emailid; 403 | loan.save(function(err,loan){ 404 | if (!err){ 405 | console.log("Saved loan to DB"); 406 | res.redirect("/owner/home/loanlist"); 407 | } 408 | else{ 409 | if (err.name == 'ValidationError') { 410 | handleValidationError(err, req.body); 411 | res.render("owner/loan", { 412 | viewTitle: "Add Loan Provider", 413 | loan: req.body 414 | }); 415 | } 416 | else 417 | console.log('Error during record insertion : ' + err); 418 | } 419 | }); 420 | } 421 | 422 | function updateloanRecord(req, res) { 423 | Loan.findOneAndUpdate({ _id: req.body._id }, req.body, { new: true }, (err, doc) => { 424 | if (!err) { res.redirect('home/loanlist'); } 425 | else { 426 | if (err.name == 'ValidationError') { 427 | handleValidationError(err, req.body); 428 | res.render("owner/loan", { 429 | viewTitle: 'Update Loan Provider', 430 | loan: req.body 431 | }); 432 | } 433 | else 434 | console.log('Error during record update : ' + err); 435 | } 436 | }); 437 | } 438 | 439 | router.get('/home/loanlist', (req, res) => { 440 | Loan.find((err, docs) => { 441 | if (!err) { 442 | res.render("owner/loanlist", { 443 | list: docs 444 | }); 445 | } 446 | else { 447 | console.log('Error in retrieving list :' + err); 448 | } 449 | }); 450 | }); 451 | 452 | router.get('/home/loanupdate/:id', (req, res) => { 453 | Loan.findById(req.params.id, (err, doc) => { 454 | if (!err) { 455 | res.render("owner/loan", { 456 | viewTitle: "Update Loan Provider", 457 | loan: doc 458 | }); 459 | } 460 | }); 461 | }); 462 | 463 | router.get('/home/loandelete/:id', (req, res) => { 464 | Loan.findByIdAndRemove(req.params.id, (err, doc) => { 465 | if (!err) { 466 | res.redirect('/owner/home/loanlist'); 467 | } 468 | else { console.log('Error in delete :' + err); } 469 | }); 470 | }); 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | router.get("/home/addtestimonial", function(req, res){ 500 | res.render("owner/testimonial", { 501 | viewTitle: "Add Testimonial" 502 | }); 503 | }); 504 | let tid=6110; 505 | router.post('/testimonialsub', (req, res) => { 506 | console.log(req.body._id); 507 | if (req.body._id == ''){ 508 | inserttestimonialRecord(req, res);} 509 | else{ 510 | updatetestimonialRecord(req, res);} 511 | }); 512 | 513 | function inserttestimonialRecord(req, res){ 514 | let testimonial = new Testimonial(); 515 | tid=tid+1; 516 | console.log(tid); 517 | testimonial.testimonialid = tid; 518 | testimonial.customername = req.body.customername; 519 | testimonial.occupation = req.body.occupation; 520 | testimonial.propertyname = req.body.propertyname; 521 | testimonial.customerdesc= req.body.customerdesc; 522 | testimonial.customersat = req.body.customersat; 523 | testimonial.save(function(err,testimonial){ 524 | if (!err){ 525 | console.log("Saved testimonial to DB"); 526 | res.redirect("/owner/home/testimoniallist"); 527 | } 528 | else{ 529 | if (err.name == 'ValidationError') { 530 | handleValidationError(err, req.body); 531 | res.render("owner/testimonial", { 532 | viewTitle: "Add Testimonial", 533 | testimonial: req.body 534 | }); 535 | } 536 | else 537 | console.log('Error during record insertion : ' + err); 538 | } 539 | }); 540 | } 541 | 542 | function updatetestimonialRecord(req, res) { 543 | Testimonial.findOneAndUpdate({ _id: req.body._id }, req.body, { new: true }, (err, doc) => { 544 | if (!err) { res.redirect('home/testimonialist'); } 545 | else { 546 | if (err.name == 'ValidationError') { 547 | handleValidationError(err, req.body); 548 | res.render("owner/testimonial", { 549 | viewTitle: 'Update Testimonial', 550 | testimonial: req.body 551 | }); 552 | } 553 | else 554 | console.log('Error during record update : ' + err); 555 | } 556 | }); 557 | } 558 | 559 | router.get('/home/testimoniallist', (req, res) => { 560 | Testimonial.find((err, docs) => { 561 | if (!err) { 562 | res.render("owner/testimoniallist", { 563 | list: docs 564 | }); 565 | } 566 | else { 567 | console.log('Error in retrieving list :' + err); 568 | } 569 | }); 570 | }); 571 | 572 | router.get('/home/testimonialupdate/:id', (req, res) => { 573 | Testimonial.findById(req.params.id, (err, doc) => { 574 | if (!err) { 575 | res.render("owner/testimonial", { 576 | viewTitle: "Update Testimonial", 577 | testimonial: doc 578 | }); 579 | } 580 | }); 581 | }); 582 | 583 | router.get('/home/testimonialdelete/:id', (req, res) => { 584 | Testimonial.findByIdAndRemove(req.params.id, (err, doc) => { 585 | if (!err) { 586 | res.redirect('/owner/home/testimoniallist'); 587 | } 588 | else { console.log('Error in delete :' + err); } 589 | }); 590 | }); 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | router.get("/home/addtransaction", function(req, res){ 612 | res.render("owner/transaction", { 613 | viewTitle: "Add Transaction" 614 | }); 615 | }); 616 | let trid=7110; 617 | router.post('/transactionsub', (req, res) => { 618 | let transaction = new Transaction(); 619 | trid=trid+1; 620 | console.log(trid); 621 | transaction.transactionid=trid; 622 | transaction.transactiondate = req.body.transactiondate; 623 | transaction.transactionmode = req.body.transactionmode; 624 | transaction.bankname = req.body.bankname; 625 | transaction.amtpaid = req.body.amtpaid; 626 | transaction.transactionstatus = req.body.transactionstatus; 627 | transaction.referencenum = req.body.referencenum; 628 | transaction.save(function(err,transaction){ 629 | if (!err){ 630 | 631 | console.log("Saved transaction to DB"); 632 | res.redirect("/owner/home/transactionlist"); 633 | } 634 | else{ 635 | console.log(err); 636 | if (err.name == 'ValidationError') { 637 | handleValidationError(err, req.body); 638 | res.render("owner/transaction", { 639 | viewTitle: "Add Transaction", 640 | transaction: req.body 641 | }); 642 | } 643 | else 644 | console.log('Error during record insertion : ' + err); 645 | } 646 | }); 647 | 648 | }); 649 | 650 | router.get('/home/transactionlist', (req, res) => { 651 | Transaction.find((err, docs) => { 652 | if (!err) { 653 | res.render("owner/transactionlist", { 654 | list: docs 655 | }); 656 | } 657 | else { 658 | console.log('Error in retrieving list :' + err); 659 | } 660 | }); 661 | }); 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 685 | 686 | 687 | router.get("/home/addcancellation", function(req, res){ 688 | res.render("owner/cancellation", { 689 | viewTitle: "Add Cancellation" 690 | }); 691 | }); 692 | let ctid=7110; 693 | router.post('/cancellationsub', (req, res) => { 694 | let cancellation = new Cancellation(); 695 | ctid=ctid+1; 696 | console.log(ctid); 697 | cancellation.cancellationid = ctid; 698 | cancellation.propertyname = req.body.propertyname; 699 | cancellation.customername = req.body.customername; 700 | cancellation.cancellationdate = req.body.cancellationdate; 701 | cancellation.amtrefund = req.body.amtrefund; 702 | cancellation.referencenum = req.body.referencenum; 703 | cancellation.save(function(err,property){ 704 | if (!err){ 705 | console.log("Saved cancellation to DB"); 706 | res.redirect("/owner/home/cancellationlist"); 707 | } 708 | else{ 709 | console.log(err); 710 | if (err.name == 'ValidationError') { 711 | handleValidationError(err, req.body); 712 | res.render("owner/cancellation", { 713 | viewTitle: "Add cancellation", 714 | cancellation: req.body 715 | }); 716 | } 717 | else 718 | console.log('Error during record insertion : ' + err); 719 | } 720 | }); 721 | 722 | }); 723 | 724 | router.get('/home/cancellationlist', (req, res) => { 725 | Cancellation.find((err, docs) => { 726 | if (!err) { 727 | res.render("owner/cancellationlist", { 728 | list: docs 729 | }); 730 | } 731 | else { 732 | console.log('Error in retrieving list :' + err); 733 | } 734 | }); 735 | }); 736 | 737 | 738 | 739 | 740 | 741 | 742 | 743 | 744 | 745 | 746 | let field; 747 | function handleValidationError(err, body) { 748 | for (field in err.errors) { 749 | switch (err.errors[field].path) { 750 | case 'referencenum': 751 | body.referencenumError= err.errors[field].message; 752 | break; 753 | case 'amtrefund': 754 | body.amtrefundError= err.errors[field].message; 755 | break; 756 | case 'cancellationdate': 757 | body.cancellationdateError= err.errors[field].message; 758 | break; 759 | case 'customername': 760 | body.customernameError= err.errors[field].message; 761 | break; 762 | case 'propertyname': 763 | body.propertynameError= err.errors[field].message; 764 | break; 765 | 766 | 767 | 768 | 769 | case 'referencenum': 770 | body.referencenumError= err.errors[field].message; 771 | break; 772 | case 'transactionstatus': 773 | body.transactionstatusError= err.errors[field].message; 774 | break; 775 | case 'amtpaid': 776 | body.amtpaidError= err.errors[field].message; 777 | break; 778 | case 'bankname': 779 | body.banknameError= err.errors[field].message; 780 | break; 781 | case 'transactionmode': 782 | body.transactionmodeError= err.errors[field].message; 783 | break; 784 | case 'transactiondate': 785 | body.transactiondateError= err.errors[field].message; 786 | break; 787 | 788 | 789 | 790 | 791 | 792 | case 'customersat': 793 | body.customersatError= err.errors[field].message; 794 | break; 795 | case 'propertyname': 796 | body.propertynameError= err.errors[field].message; 797 | break; 798 | case 'customername': 799 | body.customernameError= err.errors[field].message; 800 | break; 801 | 802 | 803 | 804 | 805 | case 'registrationstatus': 806 | body.registrationstatusError= err.errors[field].message; 807 | break; 808 | case 'registrationdate': 809 | body.registrationdateError= err.errors[field].message; 810 | break; 811 | case 'customername': 812 | body.customernameError= err.errors[field].message; 813 | break; 814 | case 'propertyname': 815 | body.propertynameError= err.errors[field].message; 816 | break; 817 | 818 | 819 | 820 | 821 | 822 | case 'emailid': 823 | body.emailidError= err.errors[field].message; 824 | break; 825 | case 'tenure': 826 | body.tenureError= err.errors[field].message; 827 | break; 828 | case 'maxamt': 829 | body.maxamtError= err.errors[field].message; 830 | break; 831 | case 'rate': 832 | body.rateError= err.errors[field].message; 833 | break; 834 | case 'bankname': 835 | body.banknameError= err.errors[field].message; 836 | break; 837 | 838 | 839 | 840 | 841 | 842 | case 'location': 843 | body.locationError= err.errors[field].message; 844 | break; 845 | case 'price': 846 | body.priceError= err.errors[field].message; 847 | break; 848 | case 'area': 849 | body.areaError= err.errors[field].message; 850 | break; 851 | case 'propertybhk': 852 | body.propertybhkError= err.errors[field].message; 853 | break; 854 | case 'propertytype': 855 | body.propertytypeError= err.errors[field].message; 856 | break; 857 | case 'propertystatus': 858 | body.propertystatusError= err.errors[field].message; 859 | break; 860 | case 'propertyname': 861 | body.propertynameError= err.errors[field].message; 862 | break; 863 | 864 | 865 | 866 | 867 | 868 | case 'address': 869 | body.addressError= err.errors[field].message; 870 | break; 871 | case 'annualincome': 872 | body.annualincomeError= err.errors[field].message; 873 | break; 874 | case 'occupation': 875 | body.occupationError= err.errors[field].message; 876 | break; 877 | case 'phonenumber': 878 | body.phonenumberError= err.errors[field].message; 879 | break; 880 | case 'dateofbirth': 881 | body.dateofbirthError= err.errors[field].message; 882 | break; 883 | case 'lastname': 884 | body.lastnameError= err.errors[field].message; 885 | break; 886 | case 'emailid': 887 | body.emailError= err.errors[field].message; 888 | break; 889 | case 'firstname': 890 | body.firstnameError= err.errors[field].message; 891 | break; 892 | 893 | } 894 | } 895 | } 896 | 897 | 898 | module.exports = router; 899 | --------------------------------------------------------------------------------