Skip to content

ezeparziale/fastapi-sqlmodel

Repository files navigation

API with Fastapi + SQLModel

API using fastapi and sqlmodel

Features:

  • Fastapi
  • SQLModel
  • Postgres
  • Alembic

💾 Installation

python -m venv env
. env/scripts/activate
python -m pip install --upgrade pip
pip install -r requirements.txt

🔧 Config

Create .env file. Check the example .env.example

🚧 Before first run:

Run docker-compose 🐳 to start the database server

docker compose -f "docker-compose.yml" up -d --build adminer db

and init the database with alembic:

alembic upgrade head

🏃 Run

docker compose -f "docker-compose.yml" up -d --build adminer db

and

uvicorn app.main:app --reload --port 8000

or using docker-compose 🐳 for run all services

docker compose -f "docker-compose.yml" up -d --build