fastapi
Enables several FastAPI and Python-related commands and context.
Open source Open in the app JSON README (API)
About
Enables several FastAPI and Python-related commands and context.
Details
- Kind
- Plugins
- Topic
- No topic detected
- Publisher
- sanjarbek17
- Origin
- gemini
- Category
- ferramentas
- Version
- 0.1.0
- Last push
- 2026-04-23T11:46:17Z
- Repository state
- ativo
- Added
- 2026-08-30 14:13:39
- Updated
- 2026-08-30 14:13:39
- Origin id
sanjarbek17/gemini-fastapi-extension
README
# Gemini FastAPI Extension A comprehensive extension for Google Gemini (Antigravity) that provides expert-level FastAPI development rules, commands, and project structures. This extension is designed to help you build high-performance, maintainable, and modern APIs with FastAPI, Python, and SQLModel. ## ๐ Features - **Standardized Project Structures**: Automatically initialize simple (component-based) or modular (feature-based) FastAPI project layouts. - **Migration Helper**: Reconstruct an existing project structure into a modular one automatically. - **AI Expert Rules**: Pre-configured guidelines for dependency injection, type hinting, pydantic 2.0, and async/await best practices. - **Smart Commands**: - `init-structure`: Bootstrap a new FastAPI project structure. - `init-modules-structure`: Bootstrap or migrate a FastAPI project into a modular (feature-based) structure. - `create-model`: Generate SQLModel database models quickly. - `create-schema`: Generate Pydantic request/response schemas. - `add-endpoint`: Quickly add new API endpoints with routers. - `add-to-main`: Helper to register routers in the main application. - `create-crud`: Generate a full module (models, schemas, service, router) with CRUD operations. ## ๐ฆ Installation To use this extension, copy this directory into your Gemini extensions folder or point your Gemini configuration to this directory. ```bash # Clone the repository git clone git@github.com:Sanjarbek17/gemini-fastapi-extension.git ``` ## ๐ Usage Once the extension is active, you can use the commands directly in your Gemini chat. Example command: > "Use the fastapi extension to initialize a new project structure." ## ๐ Project Structure This extension suggests and automates the following structure: ```text . โโโ app/ โ โโโ api/ โ โ โโโ v1/ โ โ โโโ api.py # Main router including all routers โ โ โโโ endpoints/ # Individual feature routers โ โโโ core/ โ โ โโโ config.py # Settings (Pydantic Settings) โ โ โโโ security.py # Auth utilities โ โโโ db/ โ โ โโโ session.py # Engine and session creation โ โ โโโ base.py # Base class for models โ โโโ models/ # DB models (SQLModel/SQLAlchemy) โ โโโ schemas/ # Pydantic schemas (Request/Response) โ โโโ crud/ # CRUD utility functions โ โโโ main.py # FastAPI app initialization โโโ tests/ # Pytest directory โโโ .env # Environment variables โโโ alembic/ # DB migrations โโโ pyproject.toml # Dependencies (Poetry/Pip/Ruff config) ``` ## ๐ FastAPI Best Practices Included - **Type Hints**: Mandatory for Pydantic validation and auto-docs. - **SQLModel**: Combined ORM and Pydantic models to reduce duplication. - **Dependency Injection**: Heavy use of `Depends()` for cleaner logic. - **Modern Libraries**: Recommends `sqlmodel`, `pydantic-settings`, and `httpx`. --- Developed by [Sanjarbek17](https://github.com/Sanjarbek17).