Files
karim 6290475ea3 Initial: RAPPORT-HOST Iteration 1 (proprietär)
Kommerzielle Hosting-/Abo-Plattform für Rapport-Instanzen.

- React-Frontend (Vite/JSX): Landing, Register, Login, Plans, Dashboard
- Node/Express-Backend: Auth (bcrypt+JWT), Stripe-Billing, Provisioning
- HOST-Postgres-Schema: accounts, subscriptions, instances
- Provisioning-Interface + Modell-A-Adapter (Studio im geteilten Stack)
- MOCK-Modus: voller End-to-End-Flow ohne Stripe/Rapport-Stack testbar
- Idempotentes Fulfillment (Upsert auf stripe_subscription_id)
- docker-compose für lokale host-db; identisch auf Hetzner deploybar

E2E lokal verifiziert: Register -> Checkout(mock) -> Instanz -> Idempotenz.

Lizenz: proprietär (kein AGPL-Code eingebunden, nur Netzwerk-API zur Familie).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-30 15:37:33 +02:00

38 lines
1.8 KiB
SQL

-- RAPPORT-HOST — Initiales Schema (HOST-eigene DB, getrennt von Kundendaten).
create extension if not exists "pgcrypto";
-- HOST-Kundenkonten (die zahlenden Büros, NICHT deren Endnutzer).
create table if not exists accounts (
id uuid primary key default gen_random_uuid(),
email text unique not null,
password_hash text not null,
created_at timestamptz not null default now()
);
-- Abos. Ein Konto kann über die Zeit mehrere haben (Upgrade/Downgrade/Re-Sub).
create table if not exists subscriptions (
id uuid primary key default gen_random_uuid(),
account_id uuid not null references accounts(id) on delete cascade,
plan text not null, -- solo | studio | business
status text not null, -- active | past_due | canceled | ...
stripe_customer_id text,
stripe_subscription_id text unique, -- idempotenz-key fürs Fulfillment
current_period_end timestamptz,
created_at timestamptz not null default now()
);
-- Bereitgestellte Rapport-Instanzen (Modell A: ein Studio im geteilten Stack).
create table if not exists instances (
id uuid primary key default gen_random_uuid(),
account_id uuid not null references accounts(id) on delete cascade,
studio_id uuid, -- studio_id im Rapport-Stack
studio_slug text not null,
instance_url text not null,
status text not null default 'active', -- active | suspended
created_at timestamptz not null default now()
);
create index if not exists idx_subscriptions_account on subscriptions(account_id);
create index if not exists idx_instances_account on instances(account_id);