Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Self-host-supabase #143

Merged
merged 67 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
670ee34
ci: remove semantic-release and add mkdocs build
AtticusZeller Nov 6, 2024
97f1ffe
chore(git): pre-commit upgrade to ruff
AtticusZeller Nov 6, 2024
f2fc1a3
refactor: move src/app to top level of dir as app/
AtticusZeller Nov 6, 2024
d676a13
docs: add docs dir for mkdocs
AtticusZeller Nov 6, 2024
0054c9a
chore: add scripts for test and lint etc.
AtticusZeller Nov 6, 2024
9f6ca19
fix: lint error
AtticusZeller Nov 6, 2024
7c351cc
chore(deps): upgrade pyproject.toml
AtticusZeller Nov 6, 2024
4950289
docs: update README.md for install supabase locally
AtticusZeller Nov 6, 2024
3eb164e
🎨 [pre-commit.ci] Auto format from pre-commit.com hooks
pre-commit-ci[bot] Nov 6, 2024
a2ba1d9
chore: move app to src/app and add 'pythonpath=src' to pytest config
AtticusZeller Nov 6, 2024
dbeba3a
ci: add github release
AtticusZeller Nov 6, 2024
71d6ed5
fix: lint dir
AtticusZeller Nov 6, 2024
340199d
chore: format
AtticusZeller Nov 6, 2024
db0bad5
fix: update supabase env with local url
AtticusZeller Nov 6, 2024
fa38960
chore: vscode python import
AtticusZeller Nov 6, 2024
0a14327
chore: update python import vscode plugin
AtticusZeller Nov 8, 2024
356547d
style: add tests/ into format
AtticusZeller Nov 8, 2024
7f7480a
refactor: update fastapi config with db and etc. and move partial set…
AtticusZeller Nov 8, 2024
6a12be0
test: add basic lifespan test
AtticusZeller Nov 8, 2024
3f80417
fix: add superuser into config
AtticusZeller Nov 8, 2024
3e113f2
refactor: treat super_client as Depends
AtticusZeller Nov 8, 2024
cfbbbaa
refactor: move src/app,supabase into backend/
AtticusZeller Nov 9, 2024
8559a4e
chore: add deps
AtticusZeller Nov 9, 2024
a5543ea
chore(git): remove .vscode
AtticusZeller Nov 9, 2024
fbe18bf
feat: add timestamp logging
AtticusZeller Nov 9, 2024
5fae71b
chore: move scripts closer to backend/app
AtticusZeller Nov 9, 2024
d68aff5
feat: add test_pre_start.py for testing connection of db
AtticusZeller Nov 9, 2024
c0a9a56
chore: update lockfile
AtticusZeller Nov 9, 2024
1958232
refactor: move major deps of pyproject.toml into backend/
AtticusZeller Nov 10, 2024
cd25562
fix: super client options
AtticusZeller Nov 10, 2024
92dd75d
feat: add pre-start.py to init first user
AtticusZeller Nov 10, 2024
e0fbf96
chore: move tests to backend/
AtticusZeller Nov 10, 2024
53300af
chore: move supabase to root
AtticusZeller Nov 10, 2024
7e027c4
feat: add timestamp_log
AtticusZeller Nov 10, 2024
666119b
chore: remove pre_start.py as init_data.py
AtticusZeller Nov 10, 2024
11f4042
fix: format path
AtticusZeller Nov 10, 2024
04cc4d4
chore(deps): add psycopg2
AtticusZeller Nov 10, 2024
e802a05
feat: alembic integration
AtticusZeller Nov 10, 2024
375d597
chore(deps): update anyio
AtticusZeller Nov 11, 2024
43e204b
feat: curd items
AtticusZeller Nov 11, 2024
fc27eec
chore(db): update migration
AtticusZeller Nov 11, 2024
0eededf
ci: mkdocs ci run bash
AtticusZeller Nov 16, 2024
994f8e8
chore(deps): update deps and add Dockerile
AtticusZeller Jan 19, 2025
9500f41
chore: update email
AtticusZeller Jan 19, 2025
83402a2
style: pre-commit format
AtticusZeller Jan 19, 2025
e51c83e
docs: update README.md
AtticusZeller Jan 19, 2025
31269f8
fix: test client and db fixture
AtticusZeller Jan 29, 2025
61351fa
chore: update pre-commit and ruff
AtticusZeller Jan 29, 2025
baa811c
test: 100% coverage test crud
AtticusZeller Jan 29, 2025
949937e
test: add fastapi debug config
AtticusZeller Jan 29, 2025
fe535bd
refactor: using sync db orm
AtticusZeller Jan 30, 2025
63432b3
refactor: using sync crud
AtticusZeller Jan 30, 2025
6ddcfdd
chore: remove asyncio debug in pytest
AtticusZeller Jan 30, 2025
e822040
test: refactor fixture and add global clean_up fixture
AtticusZeller Jan 30, 2025
1e5be41
test: use sync fastapi client and api
AtticusZeller Jan 30, 2025
54c00b4
chore: clean up app/
AtticusZeller Jan 30, 2025
caa157c
fix: name
AtticusZeller Jan 30, 2025
917a5c1
chore: clean up image
AtticusZeller Jan 30, 2025
099f089
test: add health checker router
AtticusZeller Jan 30, 2025
aec3929
fix: pg deps in Dockerimage
AtticusZeller Jan 30, 2025
efc00ed
chore: clean up
AtticusZeller Jan 30, 2025
14ff915
chore: add update-env.sh
AtticusZeller Jan 30, 2025
122867c
docs: update README.md
AtticusZeller Jan 30, 2025
62ef84e
ci: add tests
AtticusZeller Jan 30, 2025
3d2e84c
ci: update ci
AtticusZeller Jan 30, 2025
3536cbd
Merge branch 'main' into self-host-supabase
AtticusZeller Jan 30, 2025
a428566
🎨 [pre-commit.ci] Auto format from pre-commit.com hooks
pre-commit-ci[bot] Jan 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .coveragerc

This file was deleted.

75 changes: 0 additions & 75 deletions .dockerignore

This file was deleted.

34 changes: 30 additions & 4 deletions .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,30 @@
SUPABASE_URL=https://vtqsboqphlisizfwhrtg.supabase.co
SUPABASE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InZ0cXNib3FwaGxpc2l6ZndocnRnIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MDQ1MzY4NzIsImV4cCI6MjAyMDExMjg3Mn0.OgApaTXDr7llopKTplpXCsUzDubjbiQFXlaaFf6wlbY
[email protected]
SUPERUSER_PASSWORD=Zz030327#
# Domain
# This would be set to the production domain with an env var on deployment
DOMAIN=localhost

# FRONTEND_HOST=http://localhost:5173

# Environment: local, staging, production
ENVIRONMENT=local

PROJECT_NAME="FastAPI Supabase Template"

# Backend
BACKEND_CORS_ORIGINS="http://localhost"
SECRET_KEY=local_dev
[email protected]
FIRST_SUPERUSER_PASSWORD=admin12345

# run `supabase status`
# API URL
SUPABASE_URL=http://127.0.0.1:54321
# service_role key
SUPABASE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImV4cCI6MTk4MzgxMjk5Nn0.EGIM96RAZx35lJzdJsyH-qQwv8Hdp7fsn3W0YpN81IU

# Postgres
# DB URL: postgresql://postgres:postgres@localhost:54322/postgres
POSTGRES_SERVER=localhost
POSTGRES_PORT=54322
POSTGRES_DB=postgres
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
1 change: 0 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ jobs:
uv sync --python ${{ matrix.python-version }} --all-extras --dev
uv run bash scripts/pre-start.sh
uv run bash scripts/tests-start.sh


release:
name: Bump Version and Release
Expand Down
104 changes: 95 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
Expand All @@ -20,8 +25,18 @@ share/python-wheels/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
Expand All @@ -35,47 +50,118 @@ coverage.xml
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot
__pypackages__/
.Trashes
.metadata_never_index
.fseventsd/
boot_out.txt
*.manifest
*.spec

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# UV
.ruff_cache/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py
.env

# Environments
# .env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/
/.idea

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
.idea/

# VSCode
.vscode/PythonImportHelper-v2-Completion.json
.vscode/settings.json
Loading
Loading