This is a web application that allows users to browse and purchase products from the WikiShop online store. The application is built using a client-server architecture, with the client implemented as a series of HTML pages and the server implemented using Node.js and the Express framework.
You can Visit the live site here: https://wikishop-0n4s.onrender.com (needs apx. 1 minute to load)
The web application supports the following features:
- Product category navigation: Users can browse through different product categories and view the products within each category.
- Product filtering by sub-category: Users can filter products based on the sub-category they belong to.
- Adding products to the cart: Users can add products to their shopping cart. Successful identification (login) is required before adding products.
- Viewing the shopping cart: Users can view the contents of their shopping cart, including product details and total cost.
To run the WikiShop web application, follow these steps:
-
Clone the repository:
bashCopy code git clone https://github.com/eliaskalan/webdev-assignment-2.git -
Install dependencies:
bashCopy code cd webdev-assignment-2 npm install -
Start the server:
bashCopy code npm start -
Open your web browser and visit
http://localhost:3000to access the web application.
The server provides the following API endpoints:
GET /categories: Get a list of product categories.GET /categories/:id/subcategories: Get a list of subcategories for a given category ID.GET /categories/:id/products: Get a list of products for a given category ID.
The WikiShop web application uses the following libraries and frameworks:
- Handlebars: For HTML templating and generating dynamic content.
- Node.js: For server-side implementation.
- Express: Web framework for Node.js.
- uuid: For generating unique identifiers for user sessions.
The codebase is organized as follows:
public: Contains static files (HTML, CSS, client-side JavaScript).src: Contains server-side code.controllers: Implements the API endpoints and business logic.data: Contains Data Access Objects (DAOs) for managing user and cart data.routes: Defines the routes for different API endpoints.views: Contains Handlebars templates for generating HTML content.
Integration with a real database can be implemented to store user and cart data persistently. If a real database is integrated, an appropriate implementation of the DAO objects will be required.
This web application is developed by @giannistolou, @eliaskalan.
This project is licensed under the MIT License.