Environment Variables in FastAPI — Managing Secrets the Right Way

Posted on Tue 28 September 2027 in Tutorial • Tagged with FastAPI, Python, environment-variables, security, pydantic-settings, deployment

Why This Matters

Almost every FastAPI app eventually needs something it shouldn't have hardcoded in the source code: a database URL, an LLM API key, a JWT secret, a third-party service token. When you're building GenAI apps, this shows up on day one, because you can't call an LLM API …


Continue reading

Why FastAPI Auto-Generates API Docs (And How to Customize Them)

Posted on Mon 27 September 2027 in Tutorial • Tagged with FastAPI, Python, API-docs, Swagger, OpenAPI

Why This Matters

If you've built even a basic FastAPI app, you've probably stumbled onto /docs and been pleasantly surprised — a fully interactive API documentation page, complete with every endpoint, request schema, and a "Try it out" button, without writing a single line of documentation yourself. This isn't a small …


Continue reading

Dependency Injection in FastAPI — A Beginner's Breakdown

Posted on Sat 03 October 2026 in Tutorial • Tagged with FastAPI, Python, dependency-injection, beginner

Why This Confused Me at First

The first time I saw Depends() scattered through FastAPI route functions, it looked like unnecessary complexity for something simple. Why not just call a function directly inside the route? It took actually building a few endpoints that needed shared logic — authentication, database connections, settings …


Continue reading

Building a Chatbot API with FastAPI + OpenAI/Claude — Step by Step

Posted on Wed 30 September 2026 in Tutorial • Tagged with FastAPI, Python, chatbot, OpenAI, Claude, GenAI, LLM

Why This Matters

Every GenAI journey eventually hits the same milestone: building your first real chatbot API, not just calling a model from a script. This is the project that ties together everything else — API keys, request/response models, calling an LLM provider, and returning a clean response your frontend …


Continue reading

Async vs Sync in FastAPI — When It Actually Matters

Posted on Tue 29 September 2026 in Tutorial • Tagged with FastAPI, Python, async, performance, beginner

Why This Confuses Beginners

One of the first things that trips people up in FastAPI is seeing both def and async def used for routes, sometimes in the same codebase, and not knowing which one to use or why it matters. Some tutorials use async def everywhere out of habit …


Continue reading

Streaming AI Responses in FastAPI Using Server-Sent Events (SSE)

Posted on Sat 26 September 2026 in Tutorial • Tagged with FastAPI, Python, SSE, streaming, GenAI, LLM

Why This Matters

If you've used ChatGPT or Claude, you've seen the response appear word by word instead of showing up all at once after a long wait. That's not just a visual nicety — it makes the app feel dramatically faster, even though the total time to finish the response …


Continue reading

Why Port Numbers Under 2000 Are Not Recommended in FastAPI

Posted on Tue 01 September 2026 in Tutorial • Tagged with FastAPI, Python, networking, uvicorn, backend, deployment

Why This Matters

When you're setting up a FastAPI app for the first time, it's tempting to just run uvicorn main:app --port 80 and call it a day — no need to remember a weird port number, just hit the domain directly. But if you've tried this, you've probably already …


Continue reading