Async configuration for FastAPI and SQLModel

This is a project template which uses FastAPI, Alembic and async SQLModel as ORM. It shows a complete async CRUD template using authentication.

Set environment variables

Create .env file on root folder and copy the content from .env.example and chage it according to your own configuration.

Run project using Docker compose

$ docker-compose up -d --build

Run Alembic migrations

$ docker-compose exec fastapi_server alembic revision --autogenerate
$ docker-compose exec fastapi_server alembic upgrade head

Setup database with initial data

This creates a sample user on databasse with username: [email protected] and pass: admin

docker-compose exec fastapi_server python app/initial_data.py

Documentation: http://localhost:8000/docs

Preview

Inspiration

License

License

  • This project is licensed under the terms of the MIT license

GitHub

View Github