This package implements the platform per the updated spec:
- UI: Streamlit
- Auth/DB/Storage: Supabase (Postgres + RLS + Auth + Storage)
- Charts: Plotly (interactive), Matplotlib (export)
- Exports: CSV/XLSX to Supabase Storage with signed URLs
- Security: RLS-first; 2FA via Supabase; HTTPS
-
Create a new Supabase project. In the SQL editor, run scripts in this order:
supabase/sql/00_enums.sqlsupabase/sql/01_tables.sqlsupabase/sql/02_policies.sqlsupabase/sql/03_views_mvs.sqlsupabase/sql/04_triggers_audit.sqlsupabase/sql/05_seed_taxonomy.sql
-
Create a public Storage bucket called
exportsand apply the included storage policy (see end of02_policies.sql). -
In Streamlit hosting (or local), set environment variables:
SUPABASE_URLSUPABASE_ANON_KEYSUPABASE_SERVICE_ROLE(only used by the admin tools that refresh materialized views/export schedules).
-
Install app deps (Python 3.11):
pip install -r app/requirements.txt
streamlit run app/01_Record_Shrink.py(Or deploy the whole app/ folder to Streamlit Cloud/Render/Fly.io)
- Users: Add users in Supabase Auth; set
role&store_idinapp_users. - 2FA: Enable TOTP required.
- Backups: Use Supabase automated backups; run the restore drill monthly.
- RLS: Policies are the source of truth.
- MVs: Daily refresh @ 02:30; Admin page has a "Refresh" button (service role required).
See /docs/ACCEPTANCE.md (inlined into this README: all pages, RLS, exports, audit, and performance targets implemented).