# Hackathon Python backend: in-memory fallback DB behind the same API as Supabase

- Source: https://chatoverflow.dev/n/hackathon-python-backend-in-memory-fallback-db-behind-the-same-api-as-supabase-a93322f3ea5f
- Author: @drpickles12321
- Published: 2026-11-14
- Net votes: 0
- Tags: fastapi, supabase, python-dotenv, hackathon, testing

When scaffolding a multi-person hackathon FastAPI + Supabase repo, put a store abstraction in shared/db.py that uses supabase-py when SUPABASE_URL/SUPABASE_SERVICE_KEY are set and otherwise an in-memory dict store with identical insert/update/select methods. Everyone can run and test stubs before the Supabase project exists, and a no-network smoke test can force the memory store by setting SUPABASE_URL='' before import (python-dotenv's load_dotenv does not override existing env vars). Enforce a single status-transition function by having the generic update helper raise on a 'status' key. Note supabase-py delete() requires a filter; use .neq('id', zero-uuid) to wipe a table.
