Skip to content

Shaily-62/HomiGo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

HomiGo

A full-stack web application for listing and managing property rentals. This project is built with Node.js, Express, and MongoDB, featuring a dynamic EJS templating system for server-side rendering.

Features

  • Browse Listings: View all available property listings with images, descriptions, and pricing
  • Create Listings: Add new property listings with title, description, image, price, location, and country
  • View Details: Click on listings to see detailed information
  • Edit Listings: Modify existing listing information
  • Delete Listings: Remove listings from the database
  • MongoDB Integration: Persistent data storage with MongoDB
  • Responsive Design: EJS-based templating for dynamic content rendering

Tech Stack

  • Backend: Node.js & Express.js
  • Database: MongoDB
  • Templating: EJS (Embedded JavaScript)
  • Form Handling: Method Override for PUT/DELETE requests
  • Environment: dotenv for configuration management

Prerequisites

Before running this project, ensure you have installed:

  • Node.js (v14 or higher)
  • npm (Node Package Manager)
  • MongoDB (running locally or connection string available)

Installation

  1. Clone the repository:
git clone <repository-url>
cd airbnb
  1. Navigate to the backend directory:
cd backend
  1. Install dependencies:
npm install
  1. Create a .env file in the backend directory (if needed for configuration)

Running the Application

  1. Ensure MongoDB is running on your local machine at mongodb://127.0.0.1:27017

  2. Start the server:

node app.js
  1. Open your browser and navigate to:
http://localhost:3000

Project Structure

backend/
├── app.js                 # Main Express application
├── package.json          # Project dependencies
├── db/
│   └── db.js            # Database configuration
├── init/
│   ├── index.js         # Initialization script
│   └── data.js          # Sample data for seeding
├── models/
│   └── listing.js       # Mongoose schema for listings
└── views/
    ├── index.ejs        # Listings list view
    ├── show.ejs         # Single listing detail view
    ├── new.ejs          # New listing form
    └── edit.ejs         # Edit listing form

Database Schema

Listing Model

{
  title: String (required),
  description: String (required),
  image: String (default: unsplash image),
  price: Number (required),
  location: String (required),
  country: String (required)
}

API Routes

Method Route Description
GET / Root endpoint
GET /listings Get all listings
GET /listings/new Show form to create new listing
POST /listings Create a new listing
GET /listings/:id Get listing details
GET /listings/:id/edit Show form to edit listing
PUT /listings/:id Update a listing
DELETE /listings/:id Delete a listing

Dependencies

  • express - Web application framework
  • mongoose - MongoDB object modeling
  • ejs - Templating engine
  • method-override - Middleware for HTTP method override
  • dotenv - Environment variable management

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors