To start the application:
-
Ensure you have Python 3.10 installed. Check your Python version using:
python --version
-
Install the required libraries for this project:
pip install -r requirements
-
Set up your database migrations by installing Alembic, a database migration tool:
pip install alembic
Then, initialize your project for Alembic:
alembic init alembic
Edit your
alembic.ini
file to add your database URL:sqlalchemy.url = postgresql+psycopg2:https://user:pass@localhost/dbname
Replace
driver:https://user:pass@localhost/dbname
with your actual SQLAlchemy URL.In
alembic/env.py
, update thetarget_metadata
variable:from models import Base target_metadata = Base.metadata
Make sure
myBase
is your SQLAlchemyBase
object used to declare your model classes.Then, generate your Alembic migration:
alembic revision --autogenerate -m "Created tables" alembic upgrade head # Apply the migration
-
Start the FastAPI application with Uvicorn:
uvicorn main:app --reload
Please feel free to modify or remove any instructions according to your application's requirements.