arun-esh / travelx

The project we started as the part of courseware at University of Windsor.

Home Page:https://travelx-main.onrender.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

image-20220812010623419

Travelx

Web Development Project

The project is the part of the University of Windsor courseware (COMP-3340) which relates to basics of the web development. As the part of course, we learn HTML, CSS, javascript, Server Side PHP, NodeJs, Databases, etc.

Click on the link to check the Requirements

About Travelx

Issues Forks Repo Size Contributors

The website TRAVELX is vacation stay booking website which has locations all over the world. Travelx customer can book their stay as per their choice of Amenities, price and location.

Technology used to develop the website

HTML css javascript bootstrapNode saas php

markdown express mongoDB heroku

How it started

To have a proper database was one of the requirements of the project. While learning mongoDB, Arunesh came across the open databases from mongoDB university. Here is his Proof of Completion.

MongoDB has open-source dataset sample_airbnb which provides vacation home listings and their reviews. This dataset has around 5000 entries and each entry has minimum of 30 fields. We needed a dataset which has decent content and also can easily be combined with frontend.

Initial Idea

  • Get a front page with all the locations
    • Add some basic info related to each location
      • location name
      • price
      • summary or description
      • number of bathrooms
      • number of bedrooms
      • image of the location
      • link to detailed information about the location
  • Get few static pages
    • Login Page
    • Signup Page
    • About
    • Contact us

Backend

Datasource

For this project we use the data shared by MongoDB. The data provided by MongoDB is a sample data from AirBnB's open source data (link).

Database

We used mongoDB as database for this project which is a non-relational database. Here is the schema for user collection. Used mostly type: string, but there are other types as well. Check out the schema for products which has variety of types for its fields. If there is aRequired field that means we have to add this info, otherwise we will see the appropriate error notification.

Example: In case, name: is not provided, then it will alert the user to provide the name with message: Please tell us your name!

const userSchema = new mongoose.Schema({
	name: {
		type: String,
		required: [true, "Please tell us your name!"],
	},
	email: {
		type: String,
		required: [true, "Please provide your email"],
		unique: true,
		lowercase: true,
		validate: [validator.isEmail, "Please provide a valid email"],
	},
	photo: String,
	role: {
		type: String,
		enum: ["user", "guide", "lead-guide", "admin"],
		default: "user",
	},
	password: {
		type: String,
		required: [true, "Please provide a password"],
		minlength: 8,
		select: false,
	},
	passwordConfirm: {
		type: String,
		required: [true, "Please confirm your password"],
		validate: {
			// This only works on CREATE and SAVE!!!
			validator: function (el) {
				return el === this.password;
			},
			message: "Passwords are not the same!",
		},
	},
});

const User = mongoose.model("User", userSchema);

module.exports = User;

Setup Instructions

To install the required technologies for the project check the following documentation - Installation steps

About

The project we started as the part of courseware at University of Windsor.

https://travelx-main.onrender.com


Languages

Language:JavaScript 91.2%Language:Pug 6.2%Language:CSS 2.6%