HomeHeavens is a web application designed to manage and showcase property listings. It leverages MongoDB, Express, Node.js, and various other technologies to provide a seamless user experience for property owners and potential buyers. The application follows the MVC architecture and includes robust authentication, image storage, map features, and validation mechanisms.
- Model 1- Listing
- title
- description
- image
- price
- location
- country
- reviews
- owner
- geometry
-
Listing-Review => One to Many Relation, reviews refer to Review add one more key in listing for reviews, which store ObjectId of its all reviews.
-
Listing-User => One to One Relation, owner refers to User
-
Model 2- Review
- comment
- rating
- createdAt
- author
- Review-User => One to One Relation, author refers to User
Model-3- User
- username
- password we just define schema with email. username and password will be added by passport-local-mongoose
- init data is stored in data.js
- run index.js to initialize/re-initialize database
- layouts have boilerplate for common includes
- listing have all pages related to listings
- all static files are stored in public folder
- extra utility files like error handler ect are stored in util folder
- for client side validation, we set required in input field and applied bootstrap class 'needs-validation', the logic of 'needs-validation' is written in "public/js/script.js"
- we used "joi" tool for server side schema validation in schema.js
- all routes are stored in respective route files
- passport: Passport is Express-compatible authentication middleware for Node.js.
- passport-local: Passport strategy for authenticating with a username and password.
- passport-local-mongoose: Passport-Local Mongoose is a Mongoose plugin that simplifies building username and password login with Passport.
- callback functions used for routes are defined in controller
- implemented MVC model
- router.route used to combine routes of common path
- starability module used to style rating
- images stored on cloudinary using multer-storage-cloudinary and cloudinary
- map feature using mapbox api
- geocoding for getting coordinates of location
- coordinates are stored in database using GeoJSON