supabase-python

Implements FastAPI backends with Supabase auth and SQLModel database access.

Updated Jan 16, 2026
One-click install
npx skills add https://github.com/dudqks0319-cpu/antigravity-skills --skill supabase-python-dudqks0319-cpu
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: supabase-python
Source: https://github.com/dudqks0319-cpu/antigravity-skills/tree/main/supabase-python
Command: npx skills add https://github.com/dudqks0319-cpu/antigravity-skills --skill supabase-python-dudqks0319-cpu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires fastapi, uvicorn, supabase, python-dotenv, sqlmodel, asyncpg, alembic, pydantic-settings.

What problem does it solve? Building a Python backend that combines Supabase authentication with type-safe database queries requires wiring together FastAPI, SQLAlchemy/SQLModel, async sessions, JWT validation, and migrations, which is error-prone without a proven structure. ## Core Features & Use Cases - FastAPI + Supabase Auth Integration: Provides ready-made dependency injection patterns for validating Supabase JWTs and protecting routes. - SQLModel/SQLAlchemy Database Layer: Shows async engine setup, typed models, CRUD routes, and Alembic migrations against the Supabase Postgres database. - Storage, Realtime, and Testing Patterns: Includes file upload to Supabase Storage, realtime channel subscriptions, and pytest fixtures with dependency overrides. - Use Case: Scaffold a posts API where users sign up via Supabase Auth, create posts stored through SQLModel, and run Alembic migrations against a local Supabase instance. ## Quick Start Use the supabase-python skill to scaffold a FastAPI project with Supabase authentication and SQLModel models for a posts API.

Frequently Asked Questions about supabase-python

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

FAQPage Schema
How do I use Supabase Auth with FastAPI in Python?▼

Validate the user's JWT by passing the bearer token to supabase.auth.get_user inside a FastAPI dependency. The skill provides a get_current_user dependency using HTTPBearer that returns the authenticated user or raises a 401 error.

Should I use the Supabase Python client or SQLAlchemy for database queries?▼

Use SQLAlchemy or SQLModel for database queries and reserve the Supabase client for auth, storage, and realtime. This gives type-safe models, async support via asyncpg, and proper migration management through Alembic.

How do I run Alembic migrations with async SQLModel?▼

Configure alembic/env.py to use an async engine created from your database URL and set target_metadata to SQLModel.metadata. Then run alembic revision --autogenerate and alembic upgrade head to create and apply migrations.

Can I upload files to Supabase Storage from FastAPI?▼

Yes, read the UploadFile content and call supabase.storage.from_(bucket).upload with the file bytes and content type. You can then retrieve a public URL using get_public_url on the same bucket.

Why should database calls be async in a FastAPI Supabase app?▼

Synchronous database calls block the event loop and degrade FastAPI performance under concurrency. The skill uses asyncpg with AsyncSession and context managers so sessions are non-blocking and always closed properly.