A simple backend for fetching pizza delivery details. Made for learning FASTAPI and PostgreSQL.
-
Clone the Pizza Delivery App repository from GitHub using the following command:
git clone https://github.com/Sumit70421/pizzaDeliveryApp.git
-
Create a virtual environment using Pipenv or virtualenv and activate it.
-
Install the necessary requirements for the app using the following command:
pip install -r requirements.txt
-
Set up your PostgreSQL database and obtain the URI needed to connect to it. You can use a service such as ElephantSQL to set up a free instance of a PostgreSQL database.
-
In the file "database.py," update the engine variable with the PostgreSQL URI in the following format:
engine=create_engine('postgresql://postgres:<username>:<password>@localhost/<db_name>', echo=True )
-
Initialize the database by running the following command:
python init_db.py
-
Run the API by using the following command:
uvicorn main:app