Toacin / PizzaByte

1 stars 0 forks source link

PizzaByte - README

Table of Contents

Overview

PizzaByte is a full-stack, mobile-responsive web application built to manage menus and ingredients inventory for pizza restaurants, providing an easy to use platform for both owners and chefs.

PizzaByte Website Landing Page

PizzaByte allows owners to log in to their owner accounts and choose what toppings are available in their restuarant by adding new toppings and updating/removing existing toppings. Duplicate toppings are not allowed. These toppings are used to create "Classics" - customized pizzas that have a specific set of toppings. Chefs can log in using their chef accounts and create their own Classic, or update/remove existing Classic. Classic names must be unique, and no two Classics can have the same set of toppings. Users can log in to their user accounts, however, there is no functionality yet for users. That being said, the platform is set up to eventually allow users to order pizzas.

Return to Top

Technology

Here are the technologies used to develop this application:

Frontend

Return to Top

NOTE: Although Tailwind CSS is used for styling, all frontend designs are my own. The logo was also of my own design using Canva. All images used are royalty free.

Backend

Return to Top

Deployment

This application is deployed via Heroku, and both production database and test database are hosted by JAWS DB. Visit the deployed site here.

Return to Top

Automated Testing

This application uses the Jest testing framework for both the frontend and backend due to its wide usage in Javascript ecosystems, ease of use, and feature-rich set of tools. Testing is automated with Github through Github Actions, where tests are ran on all pull requests into the main branch. Instructions for running tests locally below.

Return to Top

Running and Testing Locally

Prerequisites

Return to Top

Installing Dependencies

On your terminal, clone the repository or a forked repository, and cd to said repository. Next, install all dependencies.

npm install

This will install both frontend and backend dependencies.

Return to Top

Environment Variables

Only the backend for this application requires environment variables. A template is provided to help and also included below:

# Database
DB_USER =
DB_PASSWORD =
DB_DATABASE =
DB_HOST =
DB_PORT =

# JWT
JWT_SECRET =

# Server
PORT =

JWT_Secret and PORT can be anything of your choice (among accepted values for server ports)

NOTE: If you plan to make contributions or pull requests to a forked repository, be aware that Github Secrets environment variables must be added. Here is a guide on how to do this. The following secrets are required:

JAWSDB_URL
GH_SECRET_USER
GH_SECRET_HOST
GH_SECRET_DATABASE
GH_SECRET_PASSWORD
GH_SECRET_PORT
JWT_SECRET

Return to Top

Testing

To run tests locally, run the following commands from the root level of the application:

npm run test

This will initiate testing for the backend first, and then the frontend.

IMPORTANT: Backend testing initiated migrations and seeding to the configured test database. Ensure that the test database has the same name as the development database followed by "_test".

Alternatively, the same commaned can be ran while within either the frontend or backend directories to run their respective tests indpendently. Test coverage data is displayed and subsequently logged in a coverage directory found in both frontend and backend directories.

Return to Top

Code Management

This codebase uses eslint and prettier to keep code uniform. To format new code, run the following command at the root level of the application:

npm run format

Run the following command to check all formatting:

npm run lint

NOTE: Pull requests must pass the formatting check, enforced via github actions.

Return to Top

Running Application/Migrating and Seeding Databases

Run the following command to run the application locally in a development environment:

npm run dev

NOTE: Running this command will first initiate database migrations, and subsequently database seeding. Feel free to remove that from the script if this is not a desired behavior.

If the application doesn't open in the browser right away, visit http://localhost:3000 on the browser to view the application.

The following command can be ran from the backend directory to migrate or seed the database without starting the application.

npm run migrate
npm run migrateTestDb // for test database
npm run seed
npm run seedTestDb // for test database

Return to Top

Future Development and Improvements

As stated earlier, this application is set up to eventually take orders from regular users. While not implemented since out of scope, the project is open to future contributions. Here is the working project board for this application with issues outline ways to improve and progress the development of PizzaByte.

Return to Top

Credits

Logo designed by myself on Canva. Images are royalty free from Pexels.

Return to Top