Skip to content

luisprgr/python-pizza-planet

 
 

Repository files navigation

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/luisprgr/python-pizza-planet.git
  • Create a virtual environment in the root folder of the project
make create-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:
make install-requirements
  • Start the database (Only needed for the first run):
make start-database
  • Seed the database (Only needed for the first run):
make seed-database
  • Run the project with:
make start-server
  • Run the project with hot reload:
make start-hot-reload

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

  • Run the test command
make run-tests
  • Run the test command with coverage report
make test-coverage-report

Check backend for linting errors

  • Run the linters command
make run-linters
  • if you want to reformat the code using black run:
make format-code

Other commands

  • In case that you need to delete the database:
make delete-database

Deploy in local:

  • you will need to have:

    • python 3.9.13 installed
    • your aws credentials configured
    • docker installed with rootless mode
  • install sam cli:

pip install aws-sam-cli
  • build the lambda function:
sam build
  • (to test the lambda function locally) run the lambda function:
sam local start-api
  • deploy the lambda function:
sam deploy --guided

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 97.6%
  • Makefile 2.4%