★
siden 2026-06-15Trial · alt inkluderet · by Pilar
Pilot-kunde · 0 kr/md · alle moduler aktive · ingen platform-fee
● mock-mode
Tabeller
18
18 ialt · 15 RLS
Rækker
1.690
~1053 KB total
RLS-aktive
16 / 18
multi-tenant isolation
Migrations
2 / 4
ready/planned
!
Kører i mock-mode
Al UI-data kommer fra in-memory mock i lib/*.ts. Schema er klar. Skift til Supabase ved at sætte PRAXIS_DB=supabase-local efter du har kørt Supabase CLI.
1. Lokal Supabase
npx supabase init npx supabase start # docker-compose op npx supabase db reset # kører migrations
2. Skift mode
# .env.local PRAXIS_DB=supabase-local SUPABASE_URL=http://127.0.0.1:54321 SUPABASE_ANON_KEY=eyJ...
Migrations
supabase/migrations/*.sql0001initial_schemaTabeller, RLS, hash-chain audit, pgvector● ready
0002seed_demo_dataSeed bypilar + nordlys + 5 klienter● ready
0003agent_ledgerAgent-aktivitets-log + LLM-call-metrics● planned
0004scan_meshesObject storage refs for 3D-fod-meshes● planned
Tabeller
| Tabel | Rækker | Størrelse | RLS |
|---|---|---|---|
| tenants | 2 | 4 KB | ● enabled · tenant_isolated |
| users | 6 | 5 KB | ○ shared |
| memberships | 7 | 2 KB | ○ shared |
| services | 9 | 8 KB | ● enabled · tenant_isolated |
| clients | 5 | 12 KB | ● enabled · tenant_isolated |
| bookings | 14 | 24 KB | ● enabled · tenant_isolated |
| journals | 12 | 18 KB | ● enabled · tenant_isolated |
| journal_entries | 47 | 142 KB | ● enabled · tenant_isolated |
| scans | 31 | 286 KB | ● enabled · tenant_isolated |
| payments | 12 | 18 KB | ● enabled · tenant_isolated |
| vouchers | 4 | 6 KB | ● enabled · tenant_isolated |
| subsidy_schemes | 11 | 4 KB | ● enabled · tenant_isolated |
| reports | 7 | 12 KB | ● enabled · tenant_isolated |
| events | 247 | 89 KB | ● enabled · tenant_isolated |
| audit_log | 1.247 | 412 KB | ● enabled · tenant_isolated |
| module_activations | 22 | 6 KB | ● enabled · tenant_isolated |
| api_keys | 5 | 3 KB | ● enabled · tenant_isolated |
| webhook_subscriptions | 2 | 2 KB | ● enabled · tenant_isolated |
Row-Level Security · multi-tenant garanti
Hver tabel har en policy der binder rækker til den session-satte tenant. Cross-tenant leak er strukturelt umuligt.
Session-context (sat før hver query)
SET LOCAL app.tenant_id = 'a3f7-...-91c'; SET LOCAL app.role = 'practitioner'; -- Alle queries herefter ser KUN denne tenants data
RLS-policy (samme på alle tabeller)
CREATE POLICY bookings_tenant_isolated
ON bookings FOR ALL
USING (tenant_id =
current_setting('app.tenant_id')::uuid
);3 connection-modes
mock
● aktivin-memory · lib/*.ts
Regionlokal
RLS—
Pool0-0
pgvector—
supabase-local
http://127.0.0.1:54321
Regionlokal (docker)
RLS✓
Pool2-10
pgvector✓
supabase-eu
https://jajdtvduzkitjzcazcng.supabase.co
Regioneu-west-1 · Ireland
RLS✓
Pool5-50
pgvector✓
Hvad sker der nu
Schema-filen supabase/migrations/0001_initial_schema.sql indeholder hele datamodellen. For at gå live: (1) supabase init + supabase start i projektet for at få lokal stack, (2) supabase db reset kører migrations, (3) sæt PRAXIS_DB=supabase-local i .env.local, (4) restart dev-serveren. Når det virker lokalt, supabase link + supabase db push → produktion i Frankfurt.