- Project fully async
- SqlAlchemy async session
- docker-compose and Dockerfiles
-
RabbitConnection
class. Path:src/config/rabbit_connection_py
- Base logging configuration
- FastAPI Cors base configuration
- FastAPI lifespan feature
- Poetry package manager
- Used hypercorn
- Configurated default BaseSettings instance
- PostgreSQL database and asyncpg driver used
python = "^3.11"
fastapi = "^0.95.0"
hypercorn = "^0.14.3"
aio-pika = "^9.0.5"
sqlalchemy = "^2.0.8"
asyncpg = "^0.27.0"
- Install Docker if not installed
- Rename
.env.dev-example
to.env.dev
- Run
docker compose up -d --build
command - Open
https://localhost:8000/docs
in your browser
- Logs you can find by path
src/logs
- Also you can run command
docker compose logs
to check logs - You can disable logging to the files by removing/commenting this code in the
consumer.py
andmain.py
:
import logging
logging.basicConfig(
level=logging.DEBUG,
format='%(asctime)s %(levelname)s %(message)s',
handlers=[
logging.FileHandler("logs/fastapi.log"),
logging.StreamHandler()
]
)