fastapi-sqlmodel-arq-backend

Build asynchronous FastAPI backends with SQLModel, Arq, and JWT authentication.

Updated Feb 24, 2026
One-click install
npx skills add https://github.com/SaintFore/OpenCodeSettings --skill fastapi-sqlmodel-arq-backend
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fastapi-sqlmodel-arq-backend
Source: https://github.com/SaintFore/OpenCodeSettings/tree/main/skills/fastapi-sqlmodel-arq-backend
Command: npx skills add https://github.com/SaintFore/OpenCodeSettings --skill fastapi-sqlmodel-arq-backend

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a clear, production-oriented blueprint to build or refactor asynchronous backends using FastAPI together with SQLModel and Arq, removing common pitfalls around async database access, background task orchestration, authentication, and migrations.

Core Features & Use Cases

  • Asynchronous Persistence Layer: Patterns for SQLModel entities, AsyncEngine/AsyncSession usage, relationships, and typed schemas.
  • Background Processing: Integration patterns for Arq workers and Redis-backed task queues to offload long-running operations.
  • Authentication & Security: OAuth2 password flow with JWT issuance, Argon2 password hashing, token validation, and current-user dependency examples.
  • Operational Guidance: loguru logging conventions, pydantic-settings configuration from environment, and Alembic migration hints plus uv command suggestions.
  • Use Case: Ideal for adding async endpoints to an existing monolith or creating a new microservice that requires reliable background tasks, secure auth, and database migrations.

Quick Start

Create an async FastAPI module with SQLModel models and async sessions, implement OAuth2 password flow with JWT and Argon2 hashing, wire an Arq worker backed by Redis for background tasks, adopt loguru for logging, and include Alembic migration hints and uv commands.

Frequently Asked Questions about fastapi-sqlmodel-arq-backend

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

FAQPage Schema
How do I set up an async FastAPI backend with SQLModel and Redis task queues?

Build an async FastAPI backend by using SQLModel with AsyncEngine and AsyncSession for database operations, and wire Arq workers to a Redis queue for background processing. This combination handles asynchronous RESTful API development.

What is the best way to implement JWT OAuth2 authentication in an async FastAPI application?

Implement JWT OAuth2 authentication in async FastAPI using the OAuth2 password flow with Argon2 password hashing. This handles token issuance, token validation, and current-user dependency injection securely.

Does this async FastAPI stack support Alembic database migrations and environment configuration?

Yes, the async FastAPI stack supports Alembic database migrations and environment configuration. It provides Alembic migration guidance and uses pydantic-settings to load configuration from environment variables, alongside loguru logging and uv commands.

When do I need Arq background workers in a FastAPI SQLModel application?

You need Arq background workers in a FastAPI SQLModel application when offloading long-running operations from request cycles. Using a Redis-backed Arq task queue prevents blocking the async event loop during heavy background processing tasks.

Can I use this approach to refactor an existing monolith into an async microservice?

Yes, you can use this approach to refactor an existing monolith into an async microservice. It is designed for adding async endpoints to existing monoliths or creating new microservices requiring background tasks, secure auth, and database migrations.