FarmaciaSenovillaSancho.com

How Dependency Injection makes your FastAPI Code Better Testable

Most Python web frameworks make you choose between testability and convenience. You either have clean code with complex test setup, or you use global state and hope your tests don’t interfere with each other. FastAPI’s Depends() solves this elegantly. Here is an example how you would use it in your API: What’s happening here: Type-safe –… Continue reading How Dependency Injection makes your FastAPI Code Better Testable

From Backend to Frontend: Connecting FastAPI and Streamlit

In my previous Pybites article, I showed how I built and deployed a book tracking API using FastAPI, Docker, and Fly.io. That project taught me a lot about backend development, containers, and deploying modern APIs. But a backend alone isn’t enough—users need an interface. And FastAPI’s Swagger UI, while useful for testing, just isn’t user-friendly… Continue reading From Backend to Frontend: Connecting FastAPI and Streamlit