r/FastAPIShare • • Jun 12 '26

Open source tool for SEO gap analysis

2 Upvotes

I built a tool for SEO gap analysis - it pulls down GSC data, enriches with SerpAPI and OpenAI calls, and presents the results in a local webserver.

It has a nice fastapi integration where the fastapi and cli commands are kept in-sync by a common pattern.

https://github.com/bayinfosys/reheat


r/FastAPIShare • • Mar 09 '26

Best auth solution for custom business application.

2 Upvotes

Context:
If I wanted to create a Python AI agent system for recruiters of a specific business, I would want to create a solution that only allows the specific organisation access.

The auth solution should also be role-based:
Admin - monitors usage and manages costs, and adds specific employees as recruiters.
Recruiters - employees who can use the system.

My stack is FastAPI + Tanstack Start.

I'm thinking of Kinde or WorkOS.


r/FastAPIShare • • Dec 07 '25

Built a FastAPI WhatsApp AI Chatbot Starter Kit – Production Ready & Open Source

Thumbnail reddit.com
2 Upvotes

r/FastAPIShare • • Jul 21 '26

Monolithic designed auth solution

3 Upvotes

I am trying to learn modular monoliths and I want to use this auth solutions for repetitive use for my applications.

If I asked you to convert the repo linked, into monolithic patterns, how would you do it for app/.

Repo: https://github.com/auth0-blog/auth0-rbac-fga-fastapi

fastapi-openfga-project/
├── app/
│ ├── main.py # FastAPI application entry point
│ ├── config.py # Configuration settings
│ ├── database.py # SQLAlchemy database setup and models
│ ├── models/
│ │ ├── organization.py # Organization Pydantic models
│ │ └── resource.py # Resource Pydantic models
│ ├── routes/
│ │ ├── organization_routes.py # Organization management endpoints
│ │ └── resource_routes.py # Resource management endpoints
│ ├── services/
│ │ └── authorization_service.py # OpenFGA integration
│ ├── utils/
│ │ └── auth0_fga_client.py # OpenFGA client wrapper
│ └── openfga/
│ └── model.fga.yaml # OpenFGA model definition
├── app.db # SQLite database file (auto-created)
├── requirements.txt
└── README.md


r/FastAPIShare • • Jan 24 '26

Python API Framework Benchmark: FastAPI vs Litestar vs DRF vs Django Ninja vs Django Bolt - Real Database Queries

3 Upvotes

Hey everyone,

I benchmarked the major Python frameworks with real PostgreSQL workloads: complex queries, nested relationships, and properly optimized eager loading for each framework (select_related/prefetch_related for Django, selectinload for SQLAlchemy). Each framework tested with multiple servers (Uvicorn, Granian, Gunicorn) in isolated Docker containers with strict resource limits.

All database queries are optimized using each framework's best practices - this is a fair comparison of properly-written production code, not naive implementations.

Key finding: performance differences collapse from 20x (JSON) to 1.3x (complex DB queries). Database I/O is the great equalizer - framework choice barely matters for database-heavy apps.

Frameworks & Servers Tested

  • Django Bolt (runbolt server)

  • FastAPI (fastapi-uvicorn, fastapi-granian)

  • Litestar (litestar-uvicorn, litestar-granian)

  • Django REST Framework (drf-uvicorn, drf-granian, drf-gunicorn)

  • Django Ninja (ninja-uvicorn, ninja-granian)

Each framework tested with multiple production servers: Uvicorn (ASGI), Granian (Rust-based ASGI/WSGI), and Gunicorn+gevent (async workers).

Test Setup

  • Hardware: MacBook M2 Pro, 32GB RAM

  • Database: PostgreSQL with realistic data (500 articles, 2000 comments, 100 tags, 50 authors)

  • Docker Isolation: Each framework runs in its own container with strict resource limits:

    • 750MB RAM limit (--memory=750m)

    • 1 CPU core limit (--cpus=1)

    • Sequential execution (start → benchmark → stop → next framework)

  • Load: 100 concurrent connections, 10s duration, 3 runs (best taken)

This setup ensures completely fair comparison - no resource contention between frameworks, each gets identical isolated environment.

Endpoints Tested

  1. /json-1k - Simple 1KB JSON serialization

  2. /json-10k - Large 10KB JSON serialization

  3. /db - 10 simple database reads

  4. /articles?page=1&page_size=20 - Paginated articles with nested authors + tags

  5. /articles/1 - Single article with author, tags, and all comments

Key Results

Simple JSON (/json-1k) - RPS

  • litestar-uvicorn: 31,745

  • litestar-granian: 22,523

  • bolt: 22,289

  • fastapi-uvicorn: 12,838

  • drf-gunicorn: 4,271

  • drf-uvicorn: 1,582

20x performance difference between fastest and slowest.

Real Database - Paginated Articles (/articles?page=1&page_size=20) - RPS

  • litestar-uvicorn: 253

  • litestar-granian: 238

  • bolt: 237

  • fastapi-uvicorn: 225

  • drf-granian: 221

Performance gap shrinks to just 1.7x when hitting the database. Query optimization becomes the bottleneck.

Real Database - Article Detail (/articles/1) - RPS

Single article with all nested data (author + tags + comments):

  • fastapi-uvicorn: 550

  • litestar-granian: 543

  • litestar-uvicorn: 519

  • bolt: 487

  • fastapi-granian: 480

Gap narrows to 1.3x - frameworks perform nearly identically on complex database queries.

Resource Usage Insights

Memory:

  • Most frameworks: 170-220MB

  • DRF-Granian: 640-670MB (WSGI interface vs ASGI for others - Granian's WSGI mode uses more memory)

CPU:

  • Most frameworks saturate the 1 CPU limit (100%+) under load

  • Granian variants consistently max out CPU across all frameworks

Server Performance

  • Uvicorn surprisingly won for Litestar (31,745 RPS), beating Granian

  • Granian delivered consistent high performance for FastAPI and other frameworks

  • Gunicorn + gevent showed good performance for DRF on simple queries, but struggled with database workloads

Key Takeaways

  1. Performance gap collapse: 20x difference in JSON serialization → 1.7x in paginated queries → 1.3x in complex queries

  2. Litestar-Uvicorn dominates simple workloads (31,745 RPS), but FastAPI-Uvicorn wins on complex database queries (550 RPS)

  3. Database I/O is the equalizer: Once you hit the database, framework overhead becomes negligible. Query optimization matters infinitely more than framework choice.

  4. WSGI uses more memory: Granian's WSGI mode (DRF-Granian) uses 640MB vs ~200MB for ASGI variants - just a difference in protocol handling, not a performance issue.

Bottom line: If you're building a database-heavy API (which most are), spend your time optimizing queries, not choosing between frameworks. They all perform nearly identically when properly optimized.

Full results, code, and reproducible Docker setup: https://github.com/huynguyengl99/python-api-frameworks-benchmark

Inspired by python-api-frameworks-benchmark


r/FastAPIShare • • Jul 01 '26

Hi wanna connect and grow together?

3 Upvotes

I am currently learning backend, particularly Django, FastAPI, etc.. Are you into programming, web development and things like that? Are you a learner too? If so, let's connect. I would love to help and be helped, motivate each other in the process, and help when we get stuck here and then.

And of you are thinking about building projects, let's connect too. I would love to collaborate and help, just for experience and nothing more 🙌.


r/FastAPIShare • • Apr 10 '26

Best production frameworks and when to use them for developing agents?

2 Upvotes

Here’s the framework I plan to use (these are the best for production I have heard from other threads):

\- pure Python

\- Pydrantic

\- LangGraph

Currently I just always use Pydrantic for my fast api projects cuz I love it

But when do I use LangGraph over Pydrantic?

When do I use both?

When do I use neither and just pure Python?

Does anyone use Pydrantic graph? How useful is it over LangGraph for agent development?


r/FastAPIShare • • Mar 01 '26

A New Open Source FastAPI-powered API to Manage Dokku Server

2 Upvotes

Hey everyone! 👋

I would like to share my new project: Dokku-API. This is a RESTful API built with FastAPI for managing a Dokku server — and it just reached the version 1.3.0 — published on PyPI!! 🚀🚀

I have been working on it for over a year of work, and I’m still actively improving it. I’m hoping for contributions from the community! So if you find a bug or want to add a feature, feel free to open a PR! 😊

The code is on my GitHub --> JeanExtreme002/Dokku-API. I’d also appreciate it if you could leave a ⭐️ on the repo page if you like the project and want to see more updates!

Thanks, everyone — really appreciate it!


r/FastAPIShare • • Mar 12 '26

Introducing FastGear CLI

3 Upvotes

After starting several FastAPI projects, I realized that I was always repeating the same configuration: project structure, basic configuration, Docker, CI/CD, and the usual module structure. So, I decided to automate this process.

FastGear CLI helps to initialize a FastAPI project with a clean and structured base, already including integration with FastGear (a library I've been developing), optional Docker support, CI/CD templates, and structure for common layers such as entities, services, repositories, and controllers.

The idea is:
less boilerplate code, faster setup, and a more organized starting point for APIs.

If you try out this CLI, I'd love to hear your feedback.


r/FastAPIShare • • Mar 31 '26

I built a CLI tool to scaffold FastAPI projects instantly — like create-vite but for Python Spoiler

Thumbnail
gallery
1 Upvotes

**What it does:**

Scaffolds a production-ready FastAPI project structure

instantly from the command line.

**Why I built it:**

Setting up FastAPI boilerplate every time is tedious.

This tool automates it — like create-vite but for Python.

**Tech stack:**

Python, Click, PyPI

**GitHub:**

https://github.com/BackendDeveloperHub/bdh-fastapi-new