scaffolding-fastapi-dapr

Scaffold FastAPI backends with SQLModel, Dapr pub/sub, and JWT authentication.

9|2|Updated Jan 31, 2026
One-click install
npx skills add https://github.com/AbdullahMalik17/Hacathan_5 --skill scaffolding-fastapi-dapr-abdullahmalik17
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: scaffolding-fastapi-dapr
Source: https://github.com/AbdullahMalik17/Hacathan_5/tree/main/.claude/skills/scaffolding-fastapi-dapr
Command: npx skills add https://github.com/AbdullahMalik17/Hacathan_5 --skill scaffolding-fastapi-dapr-abdullahmalik17

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Building production-grade FastAPI microservices requires wiring together async database access, event-driven messaging, JWT verification, structured logging, and testing—each with subtle pitfalls like CloudEvent unwrapping and MissingGreenlet errors. This Skill provides proven patterns and reference implementations so you avoid these traps. ## Core Features & Use Cases - FastAPI + SQLModel Patterns: Async CRUD endpoints, model hierarchies (Base/Table/Create/Update/Read), Neon PostgreSQL connections, and Alembic migrations. - Dapr Integration: Pub/sub subscriptions with CloudEvent handling, event publishing, and scheduled jobs via the Dapr Jobs API, including Kubernetes component configuration. - JWT/JWKS Authentication: Token verification against a JWKS endpoint with key caching and Swagger UI authorization support. - Production Hardening: Structured logging with structlog, repository/service layering, async pytest fixtures, and API versioning. - Use Case: You need to build an event-driven task management API on Kubernetes with Neon PostgreSQL, Dapr Redis pub/sub, and Better Auth JWT verification—this Skill gives you the complete working patterns. ## Quick Start Ask the AI to scaffold a FastAPI backend with SQLModel models, Dapr pub/sub subscriptions, and JWT authentication for your microservice.

Frequently Asked Questions about scaffolding-fastapi-dapr

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

FAQPage Schema
How do I build a FastAPI backend with SQLModel and async PostgreSQL?▼

Define SQLModel classes with a Base/Table/Create/Read hierarchy, create an async engine with create_async_engine using a postgresql+asyncpg URL, and yield AsyncSession via a FastAPI dependency. Use await session.exec() for queries and session.get() for lookups by ID.

How do I handle Dapr pub/sub messages in FastAPI?▼

Expose a GET /dapr/subscribe endpoint returning your topic subscriptions, then create POST handlers for each topic route. Always unwrap the CloudEvent envelope by reading the data field from the raw JSON payload before processing your event.

Why does Dapr not call my scheduled job endpoint?▼

Dapr Jobs API v1.0-alpha1 always calls back to POST /job/{job_name}, not a custom route. Register a handler at exactly that path pattern and unwrap the job payload from the request body to process reminders or scheduled tasks.

How do I verify JWT tokens against a JWKS endpoint in FastAPI?▼

Fetch the JWKS from your auth server, cache it with a TTL, match the token's kid header to a key, and decode with python-jose using RS256. Use FastAPI's HTTPBearer security scheme so Swagger UI shows an Authorize button.

Why do I get MissingGreenlet errors after session.commit() in async SQLAlchemy?▼

After commit, ORM objects become detached and attribute access triggers lazy loading that fails in async contexts. Extract primitive values like IDs right after flush, pass primitives to services, and commit once at the end of the endpoint.

When should I not use this FastAPI Dapr scaffolding approach?▼

Avoid it for simple scripts or non-microservice architectures where Dapr sidecars and pub/sub add unnecessary operational overhead. It is designed for event-driven services on Kubernetes, not single-process applications.