Python Pizza Planet

python-badge

This is an example software for a pizzeria that takes customizable orders.

Table of Contents

Getting started

You will need the following general tools:

Running the backend project

  • Clone the repo
git clone https://github.com/ioet/python-pizza-planet.git
  • Create a virtual environment in the root folder of the project
python3 -m venv venv
  • Activate the virtual environment (In vscode if you select the virtual env for your project it will activate once you open a new console window)

For linux/MacOS users:

source venv/bin/activate 

For windows users:

\path\to\env\Scripts\activate
  • Install all necessary dependencies:
pip3 install -r requirements.txt
  • Start the database (Only needed for the first run):
python3 manage.py db init
python3 manage.py db migrate
python3 manage.py db upgrade
  • If you want to use the hot reload feature set FLASK_ENV before running the project:

For linux/MacOS users:

export FLASK_ENV=development 

For windows users:

set FLASK_ENV=development
  • Run the project with:
python3 manage.py run

Running the frontend

  • Clone git UI submodule
git submodule update --init
  • Install Live Server extension if you don't have it from here on VSCode Quick Open (Ctrl + P)
ext install ritwickdey.LiveServer
  • To run the frontend, start ui/index.html file with Live Server (Right click Open with Live Server)

  • Important Note You have to open vscode in the root folder of the project.

  • To avoid CORS errors start the backend before the frontend, some browsers have CORS issues otherwise

Testing the backend

  • Make sure that you have pytest installed

  • Run the test command

python3 manage.py test