This is a IIT Bazaar portal where you can sell second hand products.
https://campusbid.herokuapp.com/
- A NodeJs background with express middleware
- Uses passport-local of Passport.js for authentication
- Uses ejs for templating on the frontend.
- Uses Mongodb Atlas for database
- bcryptjs: For encrypting password to store in database
- connect-flash, express-session: Flash messages are stored in a session and can be displayed to the user in some other in some other page.
- Registration - For new users and
- Login - For existing users
- User Dashboard: User can delete the products uploaded by him
- Admin Dashboard: If you are logged in as admin you can delete any product in the dashboard
- Search bar & category links - They can be used to easily search the product, I also used metaphone function for better and more accurate search Example You can search for Electrodinamics, Elictrodinamics, Elictrodinamiks and they all give the result that contained Electrodynamics. Currently the search is perfect for single word search because for multiword search it searches in order which is not very good.
- Sell - Link to sell your products. However, if you are not logged in you will be redirected to login page
- Comments You can comment on any product if you are logged in
There is a file name hiddenFromGit_ImpInfo.js in local machine that is not uploaded to git File format is
module.exports = {
username: "",
password: "",
encryptionKey: ""
}
This file is not uploaded on git due to security reasons
To deploy
$ Install Node
$ git clone 'https://github.com/tmibvishal/campusBid''
$ npm install
$ npm start
email, password
[email protected], admin
[email protected], vishal123
[email protected], piyush123
user_1, pass_1
Note: admin can remove any product, a normal user can only remove the product he has created
Product Schema
Key | Value |
---|---|
productName | {type: String, required: true, max: 180} |
author | {type: Schema.Types.ObjectId } |
metaphoneName | {type: String, required: true, max: 180} |
price | {type: Number, required: true} |
sellerEmail | {type: String} |
sellerPhone | {type: String, default: "Not Given by the User" , max: 10} |
imageLink | {type: String, required: true} |
description | {type: String, required: true} |
category | {type: String} |
technicalDetailsKey | [{type: String}] |
technicalDetailsValue | [{type: String}] |
commentsUser | [{type: String}] |
commentsMessage | [{type: String}] |
dateAdded | { type: Date, default: Date.now } |
User Schema
Key | Value |
---|---|
name | {type: String, required: true} |
{type: String, required: true} |
|
userPhone | {type: String, default: "Not Given by the User" , max: 10} |
password | {type: String, required: true} |
date | {type: Date, default: Date.now} |
Home Page
Single Product Page
Searching
- You can use the search bar to search products by name, description, category
- You can filter using category bar given in the left side
- They can be used to easily search the product, I also used metaphone function for better and more accurate search
- Example You can search for Electrodinamics, Elictrodinamics, Elictrodinamiks and they all give the result that contained Electrodynamics. Currently the search is perfect for single word search because for multiword search it searches in order which is not very good.
Registration Page
Login Page
User Profile Page
- Your profile page also shows items you have uploaded and you can delete the items you have uploaded
- If you have logged in as admin, then you can delete any product of any user
Sell a product page
- To sell a product, you need to be logged in
- Fill the details form
- After uploading the product you will be redirected to the product page with a message that "successfully created the product"