Skip to content

Latest commit

 

History

231 Commits

Folders and files

Repository files navigation

FUEL DELIVERY WEB APPLICATION

---

Members

  • Michael Moorman
  • Abraar Patel  
  • Dosbol Aliev  
  • Rishi Chitturi  

Description

A fuel delivery web application created that calculates the price of fuel based on the amount of fuel requested, the client's location, history and the company's profit margin.

Technology Stack

Requirements

  1. Clone this repository: git clone https://github.com/Software-DesignX/COSC4353_Group7.git

  2. Install Git, Visual Studio Code, NodeJS

  3. Install MySQL to your liking, and execute the script backend/db/schema.sql to initialize the database using the MySQL Workbench or command line tools as below:

In Windows, install MySQL using the installer and setup a password for the root user, and then perform the following on the machine hosting the database:

cd backend\db
mysql -h <HOSTNAME> -u root -p <PASSWORD> < schema.sql

Here HOSTNAME represents the machine hostname that the MySQL server is running on.

In macOS or Linux, install from your favorite package manager or using the community installer for your appropriate macOS and then perform the following on the machine hosting the database:

cd backend/db
mysql -h <HOSTNAME> -u root -p <PASSWORD> < schema.sql
  1. Configure the backend to connect to your database by modifying the backend/.env file:
MYSQL_HOST=127.0.0.1
MYSQL_PORT=3306
MYSQL_USER=app
MYSQL_PASSWORD=test_password
MYSQL_DB=cosc4353app

By default, the script will install to the database cosc4353app and create a user app with test_password. Replace MYSQL_HOST and MYSQL_PORT appropriately for your MySQL install

  1. Install the NPM package dependencies for the frontend and backend:
cd frontend
npm i
cd ../backend
npm i
  1. Installation of nodemon: required for running the backend Node.js daemon
npm install -g nodemon

Running in Testing/Development modes

Now we can test the frontend and backend separately, or run them in development mode together. Make sure that the MySQL database is running and accepting connections before starting the backend in development or production.

Testing mode:

  1. Start backend or frontend in testing mode:
cd frontend
npm test

We can generate code coverage reports using IstanbulJS and jest:

npm test -- --coverage

An HTML version of the code coverage report will be generated at ./coverage/lcov-report/index.html.

Development mode:

  1. Start backend, it will automatically begin listening on localhost:3001:
cd backend
npm start
  1. In a separate terminal, start frontend, it will automatically begin listening on localhost:3000 and open a browser tab:
cd frontend
npm start

Releases

Packages

Used by

Contributors

Languages