Release 0.8.0: Cloud-Variante (Supabase, Multi-Studio, Realtime, Web-Deploy)
Rapport ist jetzt dual: lokal (wie bisher) ODER Cloud auf eigenem Supabase-Server. Beide Modi haben dieselben Funktionen, Cloud zusätzlich Multi-User + Live-Sync. Storage-Architektur - src/storage/adapter.js: einheitliche Promise-API, LocalStorage- und SupabaseAdapter - src/storage/migrations.js: applyMigrations als reine Funktion, für beide Backends - Konfig-driven: VITE_SUPABASE_URL im Production-Build → automatisch Cloud-Modus Postgres-Schema (supabase/migrations/0001–0010) - 29 Tabellen, multi-tenant via studio_id + Row-Level-Security - Audit-Spalten (created_by/updated_by/at) + Trigger - Seed-Trigger pro neuem Studio (Rollen, Templates, Absenz-Typen) - Realtime-Publication für Live-Sync - RPCs: ensure_profile, create_studio_with_admin (mit Personen-Sharing), list_studios, load_persons_for_studio, attach_user_to_studio Cloud-Features (App) - BackendChoice.jsx als Erst-Screen «Lokal oder Cloud» - CloudSetup.jsx: 3-Schritt-Wizard für Erst-Einrichtung - Login.jsx: Modus-Switcher + Server-URL + Studio-Dropdown + Passwort-Vergessen - ResetPassword.jsx: empfängt Mail-Link-Klick via PASSWORD_RECOVERY-Event - Realtime: Änderungen zwischen Browsern ohne Reload sichtbar - Settings → System: Cloud-Verbindung, Studio-Switcher, weiteres Studio anlegen - Settings → Team: Mitarbeiter via Email einladen (Admin-Aktion) - Personen-Sharing: bei neuem Studio Personen aus anderen Studios übernehmen - Reload-Resume: studio_id in sessionStorage, kein erneuter Login nötig Web-Deploy - deploy/docker-compose.yml + nginx.conf: dist/ via nginx-Container, Port 8080 - .env.production.example: Build-time Cloud-URL - DEPLOY.md: Anleitung für LAN-only und extern via Nginx Proxy Manager Doku - README.md: Cloud-Variante prominent erklärt - ARCHITECTURE.md: Storage-Adapter, Migrations, neue Views in Risiko-Tabelle - DEPLOY.md: Schritt-für-Schritt für Mac Mini + NPM Version-Bump auf 0.8.0 in package.json, src-tauri/tauri.conf.json, Cargo.toml. Changelog-Entry im App.jsx-Modal (Karim sieht ihn beim ersten Start). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,113 @@
|
||||
import React from "react";
|
||||
|
||||
// Erst-Screen einer frischen Rapport-Installation: «Lokal oder Cloud?».
|
||||
// Wird angezeigt, solange `localStorage["rapport_backend_chosen"]` nicht
|
||||
// gesetzt ist UND noch keine lokalen Daten existieren. Sobald der User
|
||||
// gewählt hat, reloaded die App und der jeweilige Wizard übernimmt:
|
||||
// Lokal → bestehender Setup.jsx
|
||||
// Cloud → Login mit Init-Modus oder Login-Modus (je nach Studio-Vorhandensein)
|
||||
|
||||
const envCloudUrl = import.meta.env.VITE_SUPABASE_URL || "";
|
||||
|
||||
export default function BackendChoice() {
|
||||
const pick = (backend, cloudUrl = "") => {
|
||||
localStorage.setItem("rapport_backend_chosen", "1");
|
||||
localStorage.setItem("rapport_backend", backend);
|
||||
if (backend === "cloud" && cloudUrl) {
|
||||
localStorage.setItem("rapport_cloud_url", cloudUrl.replace(/\/+$/, ""));
|
||||
}
|
||||
window.location.reload();
|
||||
};
|
||||
|
||||
return (
|
||||
<div style={{
|
||||
minHeight: "100vh", minWidth: "100vw",
|
||||
background: "#ebe7e1",
|
||||
display: "flex", alignItems: "center", justifyContent: "center",
|
||||
fontFamily: "'DM Mono', 'Courier New', monospace",
|
||||
position: "fixed", inset: 0, zIndex: 9999,
|
||||
padding: 20,
|
||||
}}>
|
||||
<style>{`
|
||||
@keyframes bc-fade-in {
|
||||
from { opacity: 0; transform: translateY(16px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
.bc-card { animation: bc-fade-in 0.5s cubic-bezier(0.22,1,0.36,1) both; }
|
||||
.bc-option {
|
||||
width: 100%;
|
||||
background: #fdfcfa;
|
||||
border: 1.5px solid #ddd8d0;
|
||||
border-radius: 14px;
|
||||
padding: 22px 24px;
|
||||
cursor: pointer;
|
||||
font-family: inherit;
|
||||
text-align: left;
|
||||
transition: all 0.18s;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
.bc-option:hover {
|
||||
border-color: #9a7858;
|
||||
box-shadow: 0 4px 16px rgba(154,120,88,0.12);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
.bc-title {
|
||||
font-size: 14px; font-weight: 500; color: #1a1a18; margin-bottom: 4px;
|
||||
letter-spacing: 0.02em;
|
||||
}
|
||||
.bc-desc {
|
||||
font-size: 12px; color: #888; line-height: 1.5;
|
||||
}
|
||||
`}</style>
|
||||
|
||||
<div className="bc-card" style={{
|
||||
background: "transparent",
|
||||
width: "100%", maxWidth: 460,
|
||||
}}>
|
||||
<div style={{ textAlign: "center", marginBottom: 36 }}>
|
||||
<div style={{ fontFamily: "Krungthep, 'Archivo Black', sans-serif", fontSize: 40, color: "#1a1a18", letterSpacing: "-0.02em", lineHeight: 1 }}>
|
||||
RAPPORT
|
||||
</div>
|
||||
<div style={{ fontSize: 10, color: "#b0aca4", letterSpacing: "0.22em", marginTop: 10, fontWeight: 500 }}>
|
||||
ERSTE EINRICHTUNG
|
||||
</div>
|
||||
<div style={{ width: 40, height: 1.5, background: "#ddd8d0", margin: "20px auto 0" }} />
|
||||
</div>
|
||||
|
||||
<p style={{ fontSize: 13, color: "#666", marginBottom: 26, textAlign: "center", lineHeight: 1.6 }}>
|
||||
Wie möchten Sie Rapport nutzen?
|
||||
</p>
|
||||
|
||||
<button className="bc-option" onClick={() => pick("local")}>
|
||||
<div className="bc-title">Lokal auf diesem Gerät</div>
|
||||
<div className="bc-desc">
|
||||
Daten liegen ausschliesslich in diesem Browser / dieser App. Kein Server nötig.
|
||||
Ideal zum Ausprobieren oder als Solo-Setup.
|
||||
</div>
|
||||
</button>
|
||||
|
||||
{envCloudUrl ? (
|
||||
<button className="bc-option" onClick={() => pick("cloud", envCloudUrl)}>
|
||||
<div className="bc-title">Mit Cloud-Server verbinden</div>
|
||||
<div className="bc-desc">
|
||||
Daten liegen auf dem konfigurierten Server. Mehrere Geräte / Mitarbeiter
|
||||
können gemeinsam arbeiten. Vorkonfiguriert: <code style={{ fontSize: 11, color: "#9a7858" }}>{(() => { try { return new URL(envCloudUrl).host; } catch { return envCloudUrl; } })()}</code>
|
||||
</div>
|
||||
</button>
|
||||
) : (
|
||||
<button className="bc-option" onClick={() => pick("cloud")}>
|
||||
<div className="bc-title">Mit Cloud-Server verbinden</div>
|
||||
<div className="bc-desc">
|
||||
Daten liegen auf einem Supabase-Server (z.B. Mac Mini im Büro, Docker im LAN).
|
||||
Die Server-Adresse geben Sie im nächsten Schritt ein.
|
||||
</div>
|
||||
</button>
|
||||
)}
|
||||
|
||||
<div style={{ marginTop: 24, fontSize: 11, color: "#aaa", textAlign: "center", lineHeight: 1.6 }}>
|
||||
Sie können später in den Einstellungen wechseln.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user