Bevor es losgeht: Trage hier deine Supabase-Zugangsdaten ein. Diese werden lokal in deinem Browser gespeichert und sind nötig, damit die App mit der Datenbank kommunizieren kann.
Auf supabase.com kostenlos registrieren und ein neues Projekt erstellen.
Im SQL-Editor folgenden Code ausführen:
create table transactions (
id uuid primary key default gen_random_uuid(),
user_id uuid references auth.users not null,
buchungsdatum date not null,
valutadatum date,
betrag numeric(12,2) not null,
waehrung text default 'EUR',
empfaenger text,
verwendungszweck text,
iban text,
responsible text default 'Simon' check (responsible in ('Simon','Sascha')),
beleg_status text default 'pending' check (beleg_status in ('pending','in_datev','no_receipt_needed')),
in_datev boolean generated always as (beleg_status = 'in_datev') stored,
notes text,
source_file text,
transaction_ref text,
created_at timestamptz default now(),
updated_at timestamptz default now()
);
create table recurring_rules (
id uuid primary key default gen_random_uuid(),
user_id uuid references auth.users not null,
name text not null,
match_field text not null check (match_field in ('empfaenger','verwendungszweck','any')),
match_pattern text not null,
match_type text default 'contains' check (match_type in ('contains','exact','regex')),
set_responsible text check (set_responsible in ('Simon','Sascha')),
set_beleg_status text check (set_beleg_status in ('pending','in_datev','no_receipt_needed')),
set_notes text,
active boolean default true,
created_at timestamptz default now()
);
alter table transactions enable row level security;
alter table recurring_rules enable row level security;
create index on transactions(user_id, buchungsdatum desc);
create index on transactions(beleg_status);
create index on transactions(transaction_ref);
create unique index on transactions(user_id, transaction_ref) where transaction_ref is not null;
-- Migration falls bereits Daten existieren:
-- alter table transactions add column if not exists beleg_status text default 'pending';
-- update transactions set beleg_status = case when in_datev then 'in_datev' else 'pending' end;
-- alter table transactions drop column in_datev;
-- alter table transactions add column in_datev boolean generated always as (beleg_status = 'in_datev') stored;
In Supabase unter Settings → API: Project URL + anon/public Key kopieren und oben einfügen.
Unter Authentication → Providers ist Email standardmäßig an. Optional: "Confirm email" abschalten für schnellere Logins im Testbetrieb.
| Datum ↓ | Empfänger / Beschreibung | Betrag | Verantwortlich | Beleg-Status |
|---|