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
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.
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
- Add some basic info related to each location
- Get few static pages
- Login Page
- Signup Page
- About
- Contact us
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).
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;
To install the required technologies for the project check the following documentation - Installation steps