Skip to content

tndus604/express_mart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CS340 Database Portfolio Project - Express Mart

The project involves the development of a web-based user interface (UI) designed to facilitate Create-Read-Update-Delete (CRUD) functionalities. The UI is built using Node.js and Handlebars, serving content over the web. The backend is powered by an SQL-driven database.

Authors

Table of Contents

  1. Overview
  2. Database Outline
  3. Schema
  4. Navigation
  5. Installation
  6. Citation

Overview

ExpressMart is a grocery store with an annual revenue of $1.5 million and employing a staff of 50 individuals. In order to operate the business efficiently, they need a website with a robust database backend for the purpose of recording sales orders for products to customers. This system will facilitate the tracking of more than 100,000 sales transactions each year, helping to analyze sales patterns, customer preferences, and identification of potential product additions, ultimately leading to improved customer service and continued growth in their highly competitive market.

Database Outline

  • Homepage - navigates users to other pages to interact with database.
  • Products - documents the inventary data for products.
  • Categories - relational entity to Products, documents products category.
  • Customers - stores customers' data including names, emails and customer types.
  • Employees - stores employees' data including names, emails and positions.
  • Transactions - documents ExpressMart's transaction data including customer email, employee email, transaction date and total amount.
  • Transaction Detail - records details for each transaction including items, quantity and amount.

Schema

Navigation

  • Homepage walkthrough - visually presents the six functional pages that users can interact with our ExpressMart database.

  • Products page walkthrough - users are able to conduct CRUD (create, read, update and delete) operations with this page. All data are altered in Maria Database simultaneously.

  • Categories page walkthrough - users are able to conduct CRUD (create, read, update and delete) operations with the categories table. All data are altered in Maria Database simultaneously.

  • Customers page walkthrough - users are able to conduct CRUD (create, read, update and delete) operations with the customers table. For customer type attribute, the users are able to choose among three types in which promopt messages are showing to assist the user input. All data are altered in Maria Database simultaneously.

  • Employees page walkthrough - users are able to conduct CRUD (create, read, update and delete) operations with the employees table. Users will leave a blank if the employee is not a customer. All data are altered in Maria Database simultaneously.

  • Transactions page walkthrough - users are able to conduct CRUD (create, read, update and delete) operations with the transactions table. Users are able to create a transaction by fetching customer emails and employee emails. All data are altered in Maria Database simultaneously. On our UI, no foreign keys are requested from the user.

  • Transaction Details page walkthrough - users are able to conduct CRUD (create, read, update and delete) operations with the transaction details table. Users are able to target a transaction by fetching customer emails and transaction date. All data are altered in Maria Database simultaneously. On our UI, no foreign key are requested from the user.

  • Maria Database walkthrough - This database was designed and normalized on the first sprint using mysql on Maria Database through a server. All pages' CRUDs interact with this databse through our server code in app.js, frontend implementations in handlebar files as well as backend js files.

Installation

Prerequisites

  • Node.js (version 12 or higher)
  • MariaDB or MySQL

Steps

  1. Clone the Repository:
    git clone https://github.com/your-repo/express-mart.git
    cd express-mart
  2. Install Dependencies:
    npm install
  3. Set Up Environment Variables: Create a .env file in the root directory of the project and add the following environment variables:
    DB_HOST=localhost
    DB_USER=your_username
    DB_PASSWORD=your_password
    DB_DATABASE=express_mart
  4. Set Up the Database:
  • Ensure your MariaDB or MySQL server is running.
  • Import the database schema and data:
    mysql -u your_username -p express_mart < path/to/DDL.sql
    mysql -u your_username -p express_mart < path/to/DML.sql
  1. Start the Application:
    npm start

Citation

  • The code structure is derived from the Node.js Starter Guide provided by CS340 at Oregon State University. Code and comments have been adapted from this repository.

  • The conversion of date to string format "yyyy-mm-dd" is based on a solution found on Stack Overflow by user user3364059 and edited by user NXT. The original answer can be found here.

  • All walkthroughs are created by https://gifcap.dev/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published