Companies nowadays are now turning their businesses online to provide their customers a better experience. One of the most popular e-commerce website we hear often is Ebay – an American multinational company running on Node.js . A lot of folks are suggesting that Node.js might be the future of web development. Node.js is a single-threaded event-driven system that runs fast even when handling lots of requests at once, it is also simple compared to traditional multi-threaded frameworks. Node.js is well suited for real-time applications: online games, collaboration tools, chat rooms, or anything where what one user (or robot?) does with the application needs to be seen by other users immediately, without a page refresh. Using a technique known as “long-polling”, you can write an application that sends updates to the user in real time.
This simple e-commerce application demonstrates CRUD operations using mongoDB and a simple implementation of a session based user authentication using Passport.js. It also utilizes real time update front-end products using socket.io. This web app is 100% free to use, you can customize it to build a more sophisticated e-commerce web application. Feel free to submit an issue on GitHub if you found any bug or even better – submit a pull request.
This web application is currently hosted on Heroku, click here to view the demo. The Heroku testing environment does not support file uploads as their filesystem is readonly. Although you can still test the image upload functionality but all images will be automatically deleted after 30 minutes.
- Products Dashboard
- Add Product
- Edit Product
- Single Product View
- Products View
- Checkout system
- Cart Page
- Wish List
- Ratings and Reviews
How do I get setup?
- Download the zip file.
- Go to MongoDB installation directory and under the bin folder run this command: mongod This will start the MongoDB server. Leave this CLI instance open and start another CLI instance.
- In the new CLI, navigate to where you extracted the project, ex. C:/nodejs-mongodb-default-template then type-in: npm install then wait till it finishes installing all the modules required to run our Node.js Web Application.
- Once the installation is completed, type in the following command to run our Web Application: npm start Make sure to keep the CLI opened.
- Now go to http://127.0.0.1:3100/ using your favorite browser.