python-fastapi-development

Guides phased development of FastAPI backends with SQLAlchemy, Pydantic, JWT auth, and pytest.

Updated Jul 29, 2026
One-click install
npx skills add https://github.com/MaiconGambini/opencode-harness-guide --skill python-fastapi-development-maicongambini
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-fastapi-development
Source: https://github.com/MaiconGambini/opencode-harness-guide/tree/main/skills/python-fastapi-development
Command: npx skills add https://github.com/MaiconGambini/opencode-harness-guide --skill python-fastapi-development-maicongambini

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building a production FastAPI backend involves many decisions across scaffolding, database design, authentication, testing, and deployment. This Skill organizes that work into eight structured phases with concrete actions and quality gates, so nothing critical is skipped. ## Core Features & Use Cases - Phased Workflow: Eight phases covering project setup, database design, API routes, authentication, error handling, testing, documentation, and deployment. - Technology Stack Guidance: Opinionated defaults for FastAPI, SQLAlchemy 2.0, Pydantic v2, PostgreSQL, Alembic, JWT/OAuth2, and pytest. - Quality Gates: Checklists for test coverage, type checking with mypy, linting with ruff and black, and security scanning. - Use Case: When starting a new microservice, follow the phases to scaffold the project, design the PostgreSQL schema, implement JWT-protected CRUD endpoints, and containerize the app with Docker. ## Quick Start Ask the AI to scaffold a new FastAPI project with SQLAlchemy models, JWT authentication, and pytest tests following this workflow.

Frequently Asked Questions about python-fastapi-development

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a FastAPI project for production?

Follow a phased approach: scaffold the project with uv or poetry, configure the FastAPI app and logging, then add routers, SQLAlchemy models, and Alembic migrations. Finish with pytest tests, OpenAPI documentation, and a Dockerfile for deployment.

How to implement JWT authentication in FastAPI?

Implement user registration and login endpoints, hash passwords, and issue JWT tokens on login. Add auth middleware or dependencies that validate tokens on protected routes, following OAuth2 conventions supported natively by FastAPI.

SQLAlchemy vs Prisma for FastAPI database access?

SQLAlchemy 2.0 with Alembic migrations is the standard choice for Python backends, offering async support and deep FastAPI integration. Prisma is listed as an alternative but is less common in Python stacks.

Does FastAPI support async database queries with SQLAlchemy?

Yes, SQLAlchemy 2.0 provides an async engine and session that work with FastAPI's async route handlers. Configure an async session factory and inject it into endpoints via dependencies.

What test coverage is recommended for FastAPI APIs?

The workflow targets over 80 percent coverage using pytest with fixtures and a dedicated test database. Combine unit tests for logic with integration tests that exercise the API endpoints through FastAPI's TestClient.