NodeJS Store System – Store Website

To be able to use the data from the database in a meaningful way, I chose to simulate a store website which populated its pages using the MongoDB Data.

To achieve this in a meaningful way, using JavaScript, I wrote a code that looped through all documents in the database to display every category of merchandise. From there, I wrote another script that created a new data set from the old one, this time with only one of each department, and one of each category in each data array. At that point, another script running the forEach function would then loop through each of the keys in the new category list, and display on the page every item in the department organized by category. For instance, it would return an assortment of apples in a section titled apples, before starting to return different banana types in the banana section.

Each item in the assortment then builds out a new form on the page. If you wish to add the item to your order, you simply type in how much you’d like, and hit “add to cart”. The page also renders different wording if your item is sold by the pound or individually.

The site also adds easy navigation between categories within the department you’re in, as well as an easy way to jump to another department. It is also fully responsive and works across all devices.

View more project posts in the JavaScript category.