You are on page 1of 8

Project Documentation

Introduction
The purpose of this report is to describe the functionalities of an e-commerce website built
using MySQL, Node.js, Express, JavaScript, CSS, and HTML. The website allows users to register,
login, view product pages, and view product details pages.

Functionality:
1. Registration: The registration functionality allows users to create an account on the
website by providing their name, email address, and password. The website uses
Node.js and Express to handle the registration process. When a user submits their
registration data, the website checks if the email address is already in use. If the email
address is not already in use, the website stores the user's data in a MySQL database. To
ensure password security, the website uses bcrypt to hash the user's password before
storing it in the database.
2. Login: Once registered, users can login to the website by providing their email address
and password. The website uses Node.js and Express to handle the login process. When
a user submits their login data, the website checks if the email address and password
match the data stored in the database. If the email address and password match, the
website generates a session ID for the user, which is stored in a cookie in the user's
browser. The session ID is used to authenticate the user and grant access to protected
pages on the website.
3. Product Page: The product page displays a list of products that are available for
purchase. The website uses Node.js and Express to query the product data from the
MySQL database and display it on the page. Each product is displayed with its name,
description, image, and price. The product page also includes a search bar and filtering
options to help users find the products they are looking for.
4. Product Details Page: The product details page displays information about a specific
product. This includes the product's name, description, image, price, and other details.
The website uses Node.js and Express to query the product data from the MySQL
database and display it on the page. The product details page also includes a button to
add the product to the user's cart.

5. Cart: The cart functionality allows users to view and manage the products they have
added to their cart. The website uses Node.js and Express to store the cart data in a
session object. When a user adds a product to their cart, the website stores the product
ID and quantity in the session object. The cart page displays a list of the products in the
user's cart, along with the quantity and total price of each product. The cart page also
includes buttons to update the quantity or remove products from the cart.

6. Checkout: The checkout functionality allows users to enter their shipping and billing
information and complete their purchase. The website uses Node.js and Express to
handle the checkout process. When a user submits their checkout data, the website
generates an order confirmation page and updates the MySQL database with the order
information. The user's cart data is also cleared from the session object.
Database Design:
Database Design:

7. Users table: The users table stores information about registered users on the website.
This includes fields such as user ID, name, email address, password (hashed using
bcrypt), and account creation date.
8. Products table: The products table stores information about the products available for
purchase on the website. This includes fields such as product ID, name, description,
image URL, price, and inventory quantity.
9. Orders table: The orders table stores information about orders placed on the website.
This includes fields such as order ID, user ID, order date, shipping address, billing
address, and total price.
10. Order items table: The order items table stores information about the products ordered
in each order. This includes fields such as order item ID, order ID, product ID, quantity,
and price.
11. Sessions table: The sessions table stores information about user sessions on the
website. This includes fields such as session ID, user ID (if logged in), and session
expiration time.
12. Categories table: The categories table stores information about the different product
categories available on the website. This includes fields such as category ID and category
name.
13. Product categories table: The product categories table stores information about which
categories each product belongs to. This includes fields such as product ID and category
ID.

Conclusion:
In conclusion, this e-commerce website provides a range of functionalities that allow users to
register, login, view product pages, view product details pages, add products to their cart, and
checkout. The website is built using MySQL, Node.js, Express, JavaScript, CSS, and HTML. The
website stores user data and product data in a MySQL database, and uses bcrypt to ensure
password security. The website also provides users with the ability to view and manage their
cart, and complete their purchase through a secure checkout process. Overall, this website
provides a simple and easy-to-use platform for users to purchase products online.

You might also like