π BECHDE - E-commerce project made with React ,Express ,Node ,Mongo
- register himself on the app
- provide various details like profile link, email, phone number, username
- upload details of a product to be sold online (to be verified by admin)
- can view all products from all sellers
- edit the products he has uploaded
- edit privacy settings
- change his password
- search for various products and contact the concerned student by live chatting
- delete a product when it is sold
- can give feedback
- view and edit the products user has uploaded
- approve a product (if admin flags as appropriate then only, all users will be able to see that product online. This is to ensure that no fake or obscene images are uploaded as well as no vulgar language is used )
- view the feedback section of different user
- view the information of all users
- view the status of orders i.e order pending, order rejected, order success
- upload details of his own product to be sold online
- You can try logging in as an admin by entering the following credentials:
- Email: Pranjal112@gmail.com
- Passward: Pranjal112
2.You can also register yourself as a student and then login to view the options available to a student or use the following credentials:
- Email: pranjaldas5003@gmail.com
- Passward: pranjaldas5003
Hosted at: https://bechdenits.herokuapp.com/
- MongoDB - Document database - to store data as JSON
- Express.js - Back-end web application framework running on top of Node.js
- React - Front-end web app framework used
- Node.js - JavaScript runtime environment
- Mongoose
- JWT authentication
- Install npm packages required for backend side :
npm init
npm i -D nodemon
- Modify the package.json by adding the following scripts to it :
"start": "node server.js",
"server": "nodemon server.js",
- Create an account on MongoDB cloud Atlas, thereafter, creating a database on it and get your MongoURI
- Modify server.js to get connected to the database, using the MongoURI and also add the following lines at the end of server.js :
const port = process.env.PORT || 5000;
app.listen(port, ()=> console.log(`Server started running on port ${port}`));
- Type the following command to get your server running on your localhost and ensure hot-reloading, when the server-side code is modified :
npm run server
- Add JWT token based authentication and 'cors' module and use them in server.js.
- Make Schemas for various collections to be stored in database and export them from a folder models and the REST APIs for various routes in the folder routes.
- Install npm packages required for frontend side :
npm init
- Add proxy in frontend package.json
"proxy": http://localhost:5000
- Add the following lines to server.js :
// Serve static assets if in production
if (process.env.NODE_ENV === 'production') {
// Set static folder
app.use(express.static('client/build'));
app.get('*', (req, res) => {
res.sendFile(path.resolve(__dirname, 'client', 'build', 'index.html'));
});
}
2.Add the following script to the package.json of server
"heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client"
- Install Heroku CLI and make sure you have intialised a git repository in the project directory. Enter the following commands in the terminal :
heroku login
heroku create
git add .
git commit -am "Deployed to Heroku"
git push heroku master
4.Open your heroku account and click on Open App option in the dashboard.
/user
Routes