MCPcopy Index your code
hub / github.com/AtticusZeller/fastapi_supabase_template

github.com/AtticusZeller/fastapi_supabase_template @v0.4.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.4.1 ↗ · + Follow
69 symbols 302 edges 30 files 9 documented · 13%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Logo

License: MIT codecov CI GitHub release Python Made with Supabase

⚡SupaFast⚡


supabase & fastapi crud template

supafast.drawio.png

Features 🚀


FastAPI&supabase

  1. works of authorization all handled by supabase-py and fastapi dependency without any extra code
  2. supabase-py crud integration with pydantic model validation

Pytest

  1. pytest integration with pytest-cov
  2. pytest fixtures for fastapi client and supabase client
  3. pytest fixtures for access_token and refresh_token
  4. test for CRUD operations
  5. test for api operations

CI/CD

  1. codecov for coverage report
  2. poetry for dependency management and pytest integration
  3. pre-commit for code quality
  4. latest_changes.yml for auto update README.md
  5. Semantic Release for auto release and changelog
  6. docker for deployment

How to use it


  1. create your github repo and config it
  2. allow ci to access your repo img.png
  3. config ci_tokens
    1. CODECOV_TOKEN for codecov in .github/workflows/ci.yml ,semantic-release is optional for auto release
    2. ATTICUS_PATshould replace with your GitHub token for latest_changes.yml in .github/workflows/latest_changes.yml
    3. DOCKER_USERNAME and DOCKER_PASSWORD for docker-image.yml in .github/workflows/docker-image.yml
    4. replace tags: atticuszhou/supafast:latest with your docker repo in .github/workflows/docker-image.yml
  4. config fastapi setting in your_project\src\app\core\config.py
  5. config pyproject.toml with your project name and description,etc

  6. cd your repo and install dependencies with uv, which is an extremely fast Python package and project manager, written in Rust.

uv sync --all-extras --dev
  1. set your supabase env
export SUPABASE_URL=your_supabase_url
export SUPABASE_KEY=your_supabase_key
export SUPERUSER_EMAIL=your_superuser_email
export SUPERUSER_PASSWORD=your_superuser_password
  1. config fastapi settings
# src/app/core/config.py
class Settings(BaseSettings):
    API_V1_STR: str = "/api/v1"
    SUPABASE_URL: str = Field(default_factory=lambda: os.getenv("SUPABASE_URL"))
    SUPABASE_KEY: str = Field(default_factory=lambda: os.getenv("SUPABASE_KEY"))
    SUPERUSER_EMAIL: str = Field(default_factory=lambda: os.getenv("SUPERUSER_EMAIL"))
    SUPERUSER_PASSWORD: str = Field(default=lambda: os.getenv("SUPERUSER_PASSWORD"))
    # SERVER_NAME: str
    SERVER_HOST: AnyHttpUrl = "https://localhost"
    SERVER_PORT: int = 8000
    BACKEND_CORS_ORIGINS: list[AnyHttpUrl] = []
    PROJECT_NAME: str = "fastapi supabase template"
    Config: ClassVar[ConfigDict] = ConfigDict(arbitrary_types_allowed=True)
  1. run server
uv run uvicorn src.app.main:app --reload

Roadmap 🫶


  • [x] FastAPI backend
    • [x] standard structure for FastAPI project text ── src │ └── app │ ├── api │ │ ├── api_v1 │ │ │ ├── endpoints │ │ │ │ ├── __init__.py │ │ │ │ └── items.py │ │ │ ├── __init__.py │ │ │ └── api.py │ │ ├── __init__.py │ │ └── deps.py │ ├── core │ │ ├── __init__.py │ │ ├── config.py │ │ └── events.py │ ├── crud │ │ ├── __init__.py │ │ ├── base.py │ │ └── crud_item.py │ ├── schemas │ │ ├── __init__.py │ │ ├── auth.py │ │ ├── base.py │ │ ├── item.py │ │ └── msg.py │ ├── services │ │ └── __init__.py │ ├── utils │ │ └── __init__.py │ ├── __init__.py │ └── main.py ...
    • [x] auto-auth by fastapi dependency with supabase-auth
    • [x] CRUD operations pytest
    • [x] api requests pytest
  • [ ] Supabase integration
    • [x] crud supabase-postgresql
    • [ ] websocket with supabase-realtime
    • [ ] curd supabase-storage
    • [ ] supafunc integration
  • [x] deployment
    • [x] Full Docker integration (Docker based).
  • [ ] clone
    • [ ] cookiecutter

Release Notes 🥸


Latest Changes

License

This project is licensed under the terms of the MIT license.

Core symbols most depended-on inside this repo

get
called by 12
src/app/crud/base.py
get_auth_header
called by 7
tests/utils.py
create
called by 5
src/app/crud/base.py
run_cmd
called by 3
scripts.py
delete
called by 3
src/app/crud/base.py
update
called by 2
src/app/crud/base.py
run_tests
called by 1
scripts.py
create_app
called by 1
src/app/main.py

Shape

Function 31
Class 19
Method 13
Route 6

Languages

Python100%

Modules by API surface

src/app/api/api_v1/endpoints/items.py12 symbols
src/app/crud/base.py8 symbols
tests/conftest.py7 symbols
src/app/schemas/auth.py7 symbols
src/app/crud/crud_item.py7 symbols
tests/api/api_v1/test_items.py6 symbols
tests/crud/test_item.py4 symbols
src/app/schemas/item.py4 symbols
src/app/schemas/base.py4 symbols
src/app/api/deps.py3 symbols
scripts.py2 symbols
tests/utils.py1 symbols

For agents

$ claude mcp add fastapi_supabase_template \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page