xtablo-source/backend
Arthur Belleville 50ba9b340b
Modify backend
2025-03-15 08:46:51 +01:00
..
.github Modify backend 2025-03-15 08:46:51 +01:00
backend Modify backend 2025-03-15 08:46:51 +01:00
scripts Modify backend 2025-03-15 08:46:51 +01:00
supabase Modify backend 2025-03-15 08:46:51 +01:00
.env Modify backend 2025-03-15 08:46:51 +01:00
.gitignore Modify backend 2025-03-15 08:46:51 +01:00
.pre-commit-config.yaml Modify backend 2025-03-15 08:46:51 +01:00
.python-version Modify backend 2025-03-15 08:46:51 +01:00
CHANGELOG.md Modify backend 2025-03-15 08:46:51 +01:00
LICENSE Modify backend 2025-03-15 08:46:51 +01:00
pyproject.toml Modify backend 2025-03-15 08:46:51 +01:00
README.md Modify backend 2025-03-15 08:46:51 +01:00
uv.lock Modify backend 2025-03-15 08:46:51 +01:00

FastAPI Supbase Template

Environment

Python

uv is an extremely fast Python package and project manager, written in Rust.

cd backend
uv sync --all-groups --dev

Supabase

install supabase-cli

# brew in linux https://brew.sh/
brew install supabase/tap/supabase

launch supabase docker containers

# under repo root
supabase start

Note

# Update `.env`
bash scripts/update-env.sh

modify the .env from the output of supabase start or run supabase status manually.

Test

cd backend
# test connection of db and migration
scripts/pre-start.sh
# unit test
scripts/test.sh
# test connection of db and test code
scripts/tests-start.sh

Docker

Note

atticux/fastapi_supabase_template is your image tag name, remember replace it with yours

build

cd backend
docker build -t atticux/fastapi_supabase_template .

test

bash scripts/update-env.sh
supabase start
cd backend
docker run --network host \
  --env-file ../.env \
  -it atticux/fastapi_supabase_template:latest \
  bash -c "sh scripts/pre-start.sh && sh scripts/tests-start.sh"