197 lines
25 KiB
Markdown
197 lines
25 KiB
Markdown
# Boilerplate-Abgleich — Gesamt-Übersicht (alle HiveGrid-Module)
|
||
|
||
> Konsolidierung aller 38 Modul-Verdicts + Detail-Reports gegen die Boilerplate
|
||
> (`/Users/raffaelsheikh/Documents/GitHub/boilerplate`). Stand: 2026-06-04.
|
||
> Grundlage: `docs/boilerplate-mapping/M*.md` + `docs/boilerplate-inventory/*.md`.
|
||
> Wichtig: Das HiveGrid-Cloud-Repo enthält aktuell **nur Spec-/Docs-Artefakte** (kein `apps/`, `packages/`).
|
||
> Die Boilerplate ist die zu übernehmende Code-Basis — sie muss als Pre-Flight zuerst eingezogen werden.
|
||
|
||
---
|
||
|
||
## Executive Summary
|
||
|
||
**Grobe Gesamt-Abdeckung: ca. 35–45 % der HiveGrid-Planung ist durch die Boilerplate substanziell vorbereitet** — aber sehr ungleich verteilt:
|
||
|
||
- **Querschnitt/Fundament (M00): ~80–90 % fertig.** Audit (Hash-Kette), Permissions (404-statt-403, Tenant-Scope, Owner-Check), i18n (ICU/Plurale + CI-Gate), Feature-Flags (Engine v2), Idempotenz, Notifications, Outbox, View-Models, Adapter-Registry, DSGVO-FK-Map, CI-Gates — alles real, getestet, code-verifiziert. HiveGrid füllt überwiegend Inhalte ein (Error-Texte, Flags, i18n-Keys, Sidebar-Einträge). Dies ist das Fundament, auf dem **alle** Fachmodule stehen.
|
||
- **Plattform-/Infrastruktur-Module: hoch.** Auth/Multi-Tenancy (M27), Subscriptions/Billing (M28), Automation-Engine (M17), KI-Layer (M18), i18n (M30), Feature-Flags-Admin (M32) sind **high** — nahezu vollständige Architektur-Skelette vorhanden, HiveGrid baut Inhalte + gezielte Lücken.
|
||
- **Kommunikations-/Mid-Tier-Module: medium.** CRM (M01), Lead-Inbox (M02), Form-Builder (M05), Email (M09/M10), Telefonie (M12), HR-Hub (M14)*, Notifications (M22), Files (M23), Suche (M24), Tasks (M26)*, Apps-Engine (M33a), Public-API (M34), DSGVO (M35), Mobile (M36), Plattform-Admin (M37), Help-Center (M38), Help-Desk (M39), KWP (M19): **starkes Querschnitt-Fundament + Vorlagen, aber Domänen-Kern neu.**
|
||
- **Fachliche Greenfield-Module: low.** Sales-Pipeline (M03), Auftrags-/Projektpipeline (M04), Booking (M06), Angebot/Signatur (M07), Team-Chat (M13), Customer-Portal (M15), Calendar-Sync (M25): **kein Domänen-Modell in der Boilerplate** — nur Querschnitt + Bau-Vorlagen, der fachliche Kern (Daten + Logik + UI) ist Neubau.
|
||
|
||
**Die zentrale Erkenntnis:** Die Boilerplate bietet ein **erstklassiges Plattform-Fundament** (Auth, Billing, Automation, KI, Audit, i18n, Flags, Notifications, Files-Storage, Apps-Engine-Schema) — aber **fast keine HiveGrid-Fachdomäne** (kein typisiertes CRM-Modell, kein Deal/Pipeline/Project, kein Calendar, kein Booking, kein Chat). Boilerplate-Eigen-CRM ist Entity-Builder-basiert (Entity+Row+RowValue) und **architektonisch inkompatibel** mit den geforderten First-Class-Tabellen → muss entfernt, nicht angepasst werden.
|
||
|
||
### Vier wiederkehrende Quer-Befunde (für alle Module relevant)
|
||
|
||
1. **Naming-Drift (Blocker, kein Code-Gap):** HiveGrid-Doku referenziert durchgängig `@hivegrid/*`, `packages/ui-hivegrid`, `sidebar.config.ts`. Real existiert `@toolctrl/*`, `packages/ui-app` (Stub), Sidebar in `apps/web/app/application/sidebar/`. **Rebranding/Rename muss vor M018ff erfolgen**, sonst greifen alle DoD-Pfade ins Leere.
|
||
2. **Zwei falsche AGENTS.md-Pfadbehauptungen:** `packages/db/src/search/indexed-entities.ts` existiert nicht (Search liegt in `packages/search/`); durchgängiges `ui-hivegrid/sidebar.config.ts` entspricht nicht der Realität.
|
||
3. **Fehlende HiveGrid-Querschnittsdienste:** `logActivity()` / `@hivegrid/activity` (M045) und `Mass-Action-Schutz` (Bulk-Vorschau/Bestätigung) existieren **nirgends** in der Boilerplate — distinkt vom Audit-Log, Neubau.
|
||
4. **Falsche PLAN.md-Dependency-Annahmen (verifiziert):** `signature_pad` (M069), `browser-image-compression` (M052), `react-grid-layout` (M147), `react-beautiful-dnd` (M061→ist `@dnd-kit`), `kbar` (M058), `next-themes` (M030) sind **NICHT** in den Boilerplate-Deps. Vor Bau korrigieren.
|
||
|
||
### Subframe-Adapter (M15) — Querschnitt-Lücke für *alle* UI-Module
|
||
|
||
`packages/ui-subframe` ist ein **bewusst leerer Platzhalter** (nur README, leere Registry). Der Type-Bridge-Adapter (Subframe-Props ↔ HiveGrid-VM) existiert als Code nicht. Da User-Memory **jede Route via Subframe** verlangt, ist dieser Adapter-Layer eine harte Vorbedingung für jedes Fachmodul mit UI. Hoch priorisieren.
|
||
|
||
---
|
||
|
||
## Master-Tabelle
|
||
|
||
| Modul | Reuse | Wichtigste übernehmbare Assets | Größte Lücken | Milestones |
|
||
|---|---|---|---|---|
|
||
| **M00** Querschnitt-Hülle | 🟢 high | foundation (audit/permissions/errors/flags/idempotency/adapters/notifications/outbound-http), view-models, DB-Layer (Hash-Chain), CI-Gates (verify:i18n/ui-visual/hot-swap/tenant-isolation) | `logActivity`, indexed-entities-Registry, Subframe-Adapter-Code, Mass-Action-Schutz; Naming-Drift | M001–M017 |
|
||
| **M17** Automation-Engine | 🟢 high | komplette graph-Workflow-Engine (xyflow+dagre), Outbox-Trigger-Fanout, Block-Registry, Conditions, Resume, Credential-Crypto, Promptfoo-Gate | ~45 Domänen-Trigger + ~40 Actions, 24h-Undo, Anomalie/Loop-Guard, KI-NL-Erstellung, Dry-Run-Schwelle, Metering, Layer-Umbau | M075–M082 |
|
||
| **M18** KI-Layer / LLM-Gateway | 🟢 high | EU-Provider-Stack (Mistral/Scaleway/Aleph), 30-Min-Fallback, RAG+pgvector(HNSW), Promptfoo-OWASP-Suite, Pay-as-you-go-Overage-Engine | Whisper-EU-Transkription, Runtime-Input-Sanitizer, deterministischer Output-Cache, Sprach-zu-Automation, gesamtes UI | M083–M088 |
|
||
| **M27** Auth / Multi-Tenancy / RBAC | 🟢 high | Identity/Tenancy/RBAC-Modelle, TOTP+Recovery, HIBP-Policy, Magic-Link, Slug-Service, Settings-UI, ApiKey gehasht | Postgres-Sessions (BP=Cookie!), Postgres-RLS (fehlt!), Tenant-Lifecycle-Status-Enum, SHK-Rollen-Template, Reassign-Workflow | M018–M027 |
|
||
| **M28** Subscriptions / Billing | 🟢 high | Subscription-Datenmodell (13 Modelle), Stripe-Wrapper (~40 fn), Entitlements-Engine, Pricing-Admin, AI-Overage-Pipeline | Lifecycle-State-Machine, Seat-Modell (Büro/Monteur), Read-Only-Middleware (402), Frozen/Dunning, Apple-Compliance (LP-8!) | M153–M156 |
|
||
| **M30** i18n / Mehrsprachigkeit | 🟢 high | @toolctrl/i18n (ICU/Plurale/RTL), Server-Wiring (No-Flash), verify:i18n-Gate, Locale-Switcher | `Tenant.default_language`, `User.timezone/date_format`, TR/PL-Locales, Resolution-Order-Schritt, Empfänger-Auflösung | M028, M029 |
|
||
| **M01** CRM-Kern | 🟡 medium | Querschnitt komplett, Search+Fallback, Export/DSGVO, Import/Dedupe, Form-Capture, ~707 shadcn-Komponenten | Contact/Company/Lead/Activity/Tag/CustomField als **typisierte Tabellen** (BP-CRM=Entity-Builder, inkompatibel!), Merge, Promotion | M042–M046 |
|
||
| **M02** Lead-Inbox | 🟡 medium | Marketing-Lead-Inbox als Strukturmuster, Honeypot, Rate-Limiter, Realtime, Outbox, Retention-Cron, Apps-Engine-Schema | tenant-scoped Lead-Modell (BP-Lead operator-scoped!), Status-State-Machine, Routing-DSL, Anomalie-Detection, Statistik | M047–M051 |
|
||
| **M05** Form-Builder | 🟡 medium | Form-Widget (Builder+Drag&Drop, Zod, Origin-Allowlist, Honeypot, Captcha, Outbox-Routing), Submit-Endpoint | 9/17 Feldtypen, normalisiertes Datenmodell, 7/11 Submission-Aktionen, Conditional-Display, SHK-Vorlagen, hCaptcha statt Turnstile | M121–M125 |
|
||
| **M09** Email-Inbox + Sync | 🟡 medium | Mail-Stack (MailerSend EU), Adapter-Pattern (marketing-outbound), Bounce-Webhook-Vorlage, Storage, appsEngine (OAuth-DataConnection) | Gmail/Outlook-Mailbox-OAuth, Push-Sync (Pub/Sub/Graph), DKIM/SPF/DMARC, Auto-Match, gesamtes Inbox-Modell | M096–M099 |
|
||
| **M10** Email-Marketing | 🟡 medium | Campaign/OutboundEmail-Modelle, Kampagnen-CRUD+Editor, Sender-Mgmt, Tracking-Pixel/Unsubscribe-Token, Bounce-Webhook | Unsubscribe/Suppression/Segment/Template-Modelle, Daily-Cap/Frequenz/Spam-Score, BullMQ-Worker, EU-Provider-Tausch | M100–M104 |
|
||
| **M12** Telefonie (AirCall/HalloPetra) | 🟡 medium | Adapter-Registry-Pattern, OAuth-Flow-Template, AES-Crypto, HMAC-Webhook, Push/Notify-Pipeline, Workflow-Trigger | beide Provider-Adapter, Auto-Match (CRM-abhängig), E.164 (libphonenumber fehlt), gesamtes UI/Datenmodell | M105–M109 |
|
||
| **M14** HR-Hub | 🟡 medium | AES-Crypto, Storage+Signed-URLs, Audit, Notify, Exports/DSGVO, Imports, Form-Widget, Apps-Engine | alle 21 HR-Modelle, Per-Tenant-KMS/DEK, Leave-Approval-Engine, DE-Feiertage, Calendar-Modell, gesamtes UI | M133–M140 |
|
||
| **M19** KWP-Integration | 🟡 medium | Apps-Engine-Schema (DataConnection/AppSyncRun), gehashte API-Keys, Idempotenz, Storage, Worker-Cron, Webhook-Pattern | echtes Adapter-Interface (=M33a!), KWP-Modelle, Sync-/Konflikt-/Drift-Logik, gesamtes UI; **API-Variante vereinfacht stark** | M089–M095 |
|
||
| **M20** Dashboard / Reporting | 🟡 medium | Tenant-Dashboard-Route, dashboard-registry (Gating), Stat-DTO (Drill-Down), Export-Infra (PDF/CSV), Realtime/SSE, Recharts | Widget-/Layout-Engine, WidgetCatalog, Drag&Drop-Grid (react-grid-layout fehlt!), Aggregat-Cache, 7 Rollen-Layouts | M147–M150 |
|
||
| **M21** Audit-Log (Anzeige) | 🟡 medium | AuditEvent (Hash-Chain) ~70%, Write-Path, verifyAuditChain, Export-Pipeline (audit-pdf/csv), Retention-Cron | Diff-Felder (before/after), summary_text, AuditRetentionPolicy+Legal-Hold, Saved-Views, gesamte Anzeige-UI, Prisma-Middleware | M151, M152 |
|
||
| **M22** Notifications (3-Kanal) | 🟡 medium | In-App-Slice (DB→SSE→Center), Push-Pipeline (FCM/APNs/WebPush), DeviceToken, BullMQ-Queue, Mail-Stack | reiches Notification-Aggregat, Bundle/QuietHours-Modelle, PUSH-Enum, Bundle-/Quiet-Hours-Logik, fast alle UI | M115–M117 |
|
||
| **M23** Files / Dokumentenablage | 🟡 medium | packages/storage (S3/Scaleway, SigV4, Tenant-Isolation, ClamAV-Pipeline, Magic-Bytes) — sehr reif | File/Version/EntityLink-Modelle, Chunked-Upload+Resume, Preview/Thumbnail (keine Libs!), OCR/Suche, gesamtes UI | M052–M055 |
|
||
| **M24** Globale Suche (Cmd+K) | 🟡 medium | packages/search (Index/Outbox/Fallback), EU-Embeddings (Scaleway 1024d), pgvector tenant-scoped, RAG-Indexer, CommandPalette | FTS-Pfad (BP=Meilisearch!), Hybrid-RRF-Fusion, SearchIndexEntry-Modell, Permission-Query-Filter, Domain-Adapter | M056–M058 |
|
||
| **M26** Tasks / Aufgaben | 🟡 medium* | Querschnitt reif (Notify+Push/Email, Outbox, RBAC+Groups, Cron), shadcn-Tabellen, appsEngine (ERP-Sync) | Task-Modell (RowTask ist Falle!), TaskWatcher, Reminder-Anti-Spam, Listen/Detail/Archiv-Logik, ERP-Sync | M071–M074 |
|
||
| **M33a** Apps-Engine / Adapter | 🟡 medium | appsEngine.prisma (5 Modelle, App/DataConnection/AppSyncRun), AES-Crypto, Queue, HMAC-Webhook, Probe-Scheduler-Pattern | Adapter-Interface, 5-Status-State-Machine, Setup-Wizard, Probe-Scheduler, Webhook-Sturm-Schutz, Schema-Drift | M008–M010 |
|
||
| **M34** Public-API & Webhooks | 🟡 medium | dediziertes apps/api (Hono, OpenAPI, API-Key/Scope-Auth, Error-Envelope, ApiKeyLog), signierte Webhook-Delivery+Backoff | typisierte Read-Endpoints, Cursor-Pagination, 5 Webhook-Modelle, X-RateLimit-Header, Swagger-UI, Event-Katalog | M161–M163 |
|
||
| **M35** DSGVO-Export / Löschung | 🟡 medium | User-Level-DSGVO komplett (Export/Delete/Grace/Pseudonymize), USER_FK_MAP, Streaming-Export-Framework, Privacy-Hub | gesamte Tenant-Ebene, ZIP-mit-Binär-Bundling, AVV-PDF+Subprozessoren, Tenant-Lifecycle, Tenant-Hard-Delete-Cron | M164–M166 |
|
||
| **M36** Mobile-App (Capacitor) | 🟡 medium | Capacitor-7-Wrapper komplett, Push-Pipeline serverseitig, Session-Persist, Sentry, Permission-Strings | Offline-Modus (IndexedDB/Queue), Biometrie/Face-ID, Camera/Network-Plugins, Apple/Google-Compliance, Force-Update | M167–M171 |
|
||
| **M37** Plattform-Admin | 🟡 medium | Admin-Subdomain-Routing, AdminSidebar, MFA-Step-up, ImpersonationAudit+Banner, RBAC, KPIs, Stripe-Stack, Lead-Inbox | **getrennte AdminUser-Identität (Spec verlangt, BP verletzt!)**, AdminSession (IP-Bind), AdminDeal/Pipeline, ui-hivegrid | M034–M041 |
|
||
| **M38** Help-Center (öffentlich) | 🟡 medium | komplettes KB-System (Routes/Suche/SEO/Feedback/Markdown-Render/RAG) — als Vorlage | file-/build-basierter Daten-Layer (BP=DB-getrieben!), Build-Index+Sitemap, Frontmatter-Validierung | M172, M173 |
|
||
| **M39** Help-Desk / Support | 🟢 high | Feedback+SupportTicket-Modelle, Service/DB-Layer, In-App-Widget, PII-Redaction, Admin-Bereich, Sliding-Rate-Limiter | Detail-View, Status/Assignee/Notes/Attachments, reichere Liste, Browser-Info/Screenshot, Permission-Keys | M174, M175 |
|
||
| **M31** Branding / Theme | 🟡 medium | Light/Dark-Basis (binär), Capacitor-Status-Bar/Splash, Tenant.themeConfig+Parser, ~20 Themes, settings/theme-Route | 3-Wert-Theme (system), prefers-color-scheme, matchMedia-Listener, TenantBranding-Tabelle (Phase 2) | M030 |
|
||
| **M03** Sales-Pipeline | 🔴 low | Querschnitt 1:1, @dnd-kit (vorhanden!), SSE (kein WS), EntityView-board-Pattern, Row.folio-Sequenz, BullMQ-Cron | Deal/Pipeline/Stage/Forecast komplett neu, Stage-Engine, Won-Handoff, Field-Level-Volumen-Redaction, Stuck-Detection | M059–M064 |
|
||
| **M04** Auftrags-/Projektpipeline | 🔴 low | DB-Layer, RBAC+Groups, Notify+Push-Worker, appsEngine (KWP), @react-pdf, @dnd-kit, App-Shell | alle 8 Kern-Modelle neu, **Plantafel-Grid (kein Lib!)**, signature_pad (fehlt!), Abnahme-State-Machine, Konflikt-Detektor | M065–M070 |
|
||
| **M06** Booking (Calendly) | 🔴 low | Querschnitt, handlebars (Template-Engine!), Redis-Cache, Form-Widget, Lead, Site (booking), shadcn-Calendar | gesamtes Booking-Modell, Slot-Engine, EXCLUDE-gist-Doppelbuchungsschutz, Public-Flow, .ics, Calendar-Sync (M25 fehlt!) | M126–M129 |
|
||
| **M07** Angebot + e-Signatur | 🔴 low | defineAdapter, SSRF-outbound-http, Stripe/MailerSend-Webhook als Blaupause, appsEngine (OAuth), Storage, Outbox | PandaDoc/DocuSign-Adapter, 5 Signatur-Modelle, **hängt an M3-Deal-Modell**, Inbound-Webhook-Routen, 5-Schritt-Wizard | M130–M132 |
|
||
| **M13** Team-Chat (intern) | 🔴 low | Querschnitt (Notify/Permissions/Audit/Storage+AV), RowComment-Muster, realtime-Client (Reconnect), hocuspocus-Blueprint | 7 TeamChat-Modelle, **generischer WebSocket-Room-Layer (realtime=SSE!)**, Mention-Resolver, Link-Previews, gesamtes UI | M110–M114 |
|
||
| **M15** Customer-Portal | 🔴 low | Querschnitt (Auth-Primitiven, Storage+ClamAV, Mail, DSGVO, Rate-Limit), TenantUser-Auth als Referenz | gesamte CustomerPortal-Datenebene, **kein Session-Modell!**, getrennte PortalUser-Auth, alle Endkunden-Views | M141–M146 |
|
||
| **M25** Calendar-Sync (Google/MS) | 🔴 low | Querschnitt, AES-Crypto, SSRF-http, Outbox+Cron, HMAC-Webhook-Pattern, defineAdapter, appsEngine (Feld-Vorlage) | 5 Calendar-Modelle, CalendarAdapter, Google/MS-Adapter (kein googleapis/Graph!), OAuth2-Flow, Sync, Verfügbarkeit | M118–M120 |
|
||
|
||
*M14/M26 sind grenzwertig low→medium (starker Querschnitt, Domäne neu); M37 medium mit blockierender Architektur-Entscheidung.
|
||
|
||
---
|
||
|
||
## Gruppierung nach Reuse-Level (Quick-Wins zuerst)
|
||
|
||
### 🟢 HIGH — Quick-Wins (Fundament aktivieren + Inhalte füllen)
|
||
- **M00 Querschnitt-Foundation** — Pre-Flight für *alles*; ~80–90 % fertig. Vier echte Neubauten (`logActivity`, indexed-entities, Subframe-Adapter, Mass-Action) + Naming-Drift-Fix.
|
||
- **M30 i18n** — Mechanik komplett; 3 DB-Felder + TR/PL + 2 Resolver-Schritte.
|
||
- **M27 Auth/Tenancy/RBAC** — fast vollständig; 3 echte Architektur-Neubauten (Postgres-Sessions, RLS, Lifecycle-Status).
|
||
- **M28 Billing** — Datenmodell+Stripe+Pricing+Overage fertig; Lifecycle/Seat/Read-Only neu. **Achtung Apple-Compliance LP-8.**
|
||
- **M17 Automation-Engine** — Engine 1:1; Domänen-Trigger/Actions + USP-Mechaniken + Layer-Umbau.
|
||
- **M18 KI-Layer** — EU-Stack+RAG+Promptfoo+Overage fertig; Whisper + Sanitizer + Sprach-zu-Automation + UI.
|
||
- **M39 Help-Desk** — fast komplettes Phase-1-Modul; Anpass-/Erweiterungsaufgabe.
|
||
|
||
### 🟡 MEDIUM — solides Fundament + Vorlagen, Domänen-Kern neu
|
||
M01 CRM, M02 Lead-Inbox, M05 Form-Builder, M09 Email-Inbox, M10 Email-Marketing, M12 Telefonie, M14 HR-Hub, M19 KWP, M20 Dashboard, M21 Audit-Anzeige, M22 Notifications, M23 Files, M24 Suche, M26 Tasks, M31 Branding, M33a Apps-Engine, M34 Public-API, M35 DSGVO, M36 Mobile, M37 Plattform-Admin, M38 Help-Center.
|
||
|
||
### 🔴 LOW — Greenfield-Fachdomäne (Querschnitt + Bau-Vorlagen, Kern neu)
|
||
M03 Sales-Pipeline, M04 Auftrags-/Projektpipeline, M06 Booking, M07 Angebot/Signatur, M13 Team-Chat, M15 Customer-Portal, M25 Calendar-Sync.
|
||
|
||
> **Es gibt kein „none".** Selbst die low-Module profitieren erheblich vom Querschnitt + konkreten Bau-Vorlagen.
|
||
|
||
---
|
||
|
||
## Querschnitt-Foundation (M00) — Status separat
|
||
|
||
**Reuse-Level: HIGH, code-verifiziert (nicht nur Inventur).** Fast die gesamte Querschnitt-Hülle existiert als lauffähige, getestete Patterns + CI-Gates:
|
||
|
||
| Baustein | Status | Quelle |
|
||
|---|---|---|
|
||
| M001 Audit (Hash-Chain pro Tenant) | ✅ 1:1 | `foundation/src/audit.ts` + `db/src/audit-events.server.ts` |
|
||
| M002 Klartext-Diagnostik (CatalogError) | ✅ Engine fertig, `catalogRegistry` **leer** (HiveGrid füllt) | `foundation/src/errors.ts` |
|
||
| M003 i18n-Pflicht | ✅ 1:1 + CI-Gate | `packages/i18n` + `verify:i18n` |
|
||
| M004/M005 Tenant-Scope/Owner-Check/404-statt-403/SSRF | ✅ 1:1 | `foundation/src/permissions.ts` + `outbound-http.ts` |
|
||
| M006 Feature-Flag-Engine | ✅ 1:1 (v2: Targeting/Cache/Hooks) | `packages/feature-flags` |
|
||
| M007 Idempotenz-Wrapper | ✅ 1:1 | `foundation/src/idempotency.ts` |
|
||
| M008–M010 Apps-Engine-Adapter + State-Machine | ⚠️ Registry+Status-Enum da, **Interface+State-Machine neu** (=M33a) | `foundation/src/adapters.ts` + `appsEngine.prisma` |
|
||
| M011 Notification-Service | ✅ 1:1 | `foundation/src/notifications.ts` |
|
||
| M012–M014 Workspace/View-Model/Action-Contract | ✅ 1:1 | `packages/view-models` |
|
||
| M015 Subframe-Adapter | ❌ **nur leere Boundary, Adapter-Code fehlt** | `packages/ui-subframe` |
|
||
| M016/M017 Visual-Regression + Hot-Swap-Drill | ✅ 1:1 + CI-Gates | `packages/ui-mock` + `ci.yml` |
|
||
|
||
**Vier echte M00-Neubauten:** (1) `logActivity()`/Activity-Stream (distinkt vom Audit), (2) Search-indexed-entities-Registry (falscher AGENTS-Pfad), (3) Subframe-Adapter-Code, (4) Mass-Action-Schutz. **Plus durchgängiger Naming-Drift** (`ui-hivegrid`/`@hivegrid/*` vs. Realität) — Phase-0-Pflicht.
|
||
|
||
---
|
||
|
||
## KWP (M19) — API-Anbindungs-Auswirkung (hervorgehoben)
|
||
|
||
**Stand 2026-06-04: Mit der NEUEN offiziellen KWP-API kippt die Architektur von 3 auf 2 Komponenten** — aus `Cloud ↔ kwpsync.exe ↔ MSSQL` wird `Cloud ↔ KWP-API`. Das verändert den Milestone-Schnitt erheblich:
|
||
|
||
| Milestone | Auswirkung der KWP-API |
|
||
|---|---|
|
||
| M089 (Sync-Programm / kwpsync.exe) | **ENTFÄLLT** (kein Windows-Client, kein MSSQL-Treiber, kein NSSM/DPAPI/Auto-Update mehr) |
|
||
| M090 (Heartbeat + Recovery) | **stark vereinfacht** → generischer M33a-Health-Probe |
|
||
| M091 (Warteschlange + Replay) | **vereinfacht** — lokale SQLite-Queue entfällt, nur Cloud-Outbox bleibt |
|
||
| M092 (Schema-Drift-Sentinel) | **vereinfacht bis ENTFÄLLT** → API-Versions-/Contract-Check (zod-Response-Validierung) |
|
||
| M093 (Konflikt „KWP gewinnt") | **BLEIBT unverändert** — transport-unabhängige Domain-Regel |
|
||
| M094 (Plantafel-Sync) | **vereinfacht** via API-Endpoints/Webhooks |
|
||
| M095 (Dokumenten-Archiv-Sync) | **vereinfacht** via API-Endpoints/Webhooks |
|
||
|
||
**Netto:** Aufwand sinkt deutlich. Bei API-Variante passt `DataConnection.type='rest-api'/'oauth2'` **nahtlos** ins generische Apps-Engine-Muster (statt `windows_client`-Sonderweg) — das **hebt das faktische Reuse-Level Richtung medium-high**. **Empfehlung:** M089–M095 vor Umsetzung gegen die API **neu schneiden**. Harte Vorbedingung bleibt **M008–M010 (M33a Adapter-Interface)**.
|
||
|
||
---
|
||
|
||
## Empfohlene Übernahme-Reihenfolge (gemäß Cluster-Reihenfolge der Planung)
|
||
|
||
### Phase 0 — Pre-Flight (blockierend, vor jedem Fachmodul)
|
||
1. **Boilerplate als Code-Basis einziehen** (HiveGrid-Repo ist heute Docs-only). AGENTS Pre-Flight-Check schlägt sonst fehl.
|
||
2. **Naming-Drift beheben:** `@toolctrl/*` → `@hivegrid/*`, `ui-app`-Stub → `ui-hivegrid`, Sidebar-Konvention, AGENTS-Pfade (`indexed-entities.ts`, `sidebar.config.ts`) korrigieren.
|
||
3. **EU-Sterilisation:** OAuth-GitHub/Google-Login-Reste entfernen (M27), Anthropic/OpenAI-Embedding-Stubs deaktiviert lassen (M18, DSGVO-Hard-Constraint).
|
||
4. **M00 aktivieren:** foundation/view-models/i18n/feature-flags 1:1 + CI-Gates verdrahten. Die 4 echten Neubauten (`logActivity`, indexed-entities-Registry, **Subframe-Adapter** [Quer-Voraussetzung für alle UI], Mass-Action-Schutz) anlegen.
|
||
|
||
### Phase 1 — Plattform-Fundament (high reuse, ermöglicht alles Weitere)
|
||
5. **M27 Auth/Tenancy/RBAC** — inkl. 3 Architektur-Neubauten (Postgres-Sessions, **RLS**, Lifecycle-Status). Vorbedingung für *alle* tenant-scoped Module.
|
||
6. **M30 i18n** + **M31 Branding** (Quick-Wins, klein).
|
||
7. **M28 Billing** (Lifecycle/Seat/Read-Only; Apple-LP-8 beachten).
|
||
8. **M32 Feature-Flags-Admin**, **M33a Apps-Engine** (Adapter-Interface — Vorbedingung für M07/M09/M12/M19/M25), **M34 Public-API**.
|
||
|
||
### Phase 2 — Daten-Kern (Cluster „CRM-Fundament")
|
||
9. **M01 CRM-Kern** — Contact/Company/Lead als typisierte Tabellen; **Boilerplate-Entity-Builder-CRM entfernen**. Vorbedingung für M02/M03/M07/M09/M12.
|
||
10. **M23 Files**, **M24 Suche** (FTS-Architektur-Entscheid), **M26 Tasks**, **M22 Notifications**, **M21 Audit-Anzeige**.
|
||
|
||
### Phase 3 — Vertriebs-/Auftrags-Kette (Cluster „Sales→Projekt")
|
||
11. **M02 Lead-Inbox** → **M03 Sales-Pipeline** (low, Greenfield) → **M04 Auftrags-/Projektpipeline** (low, Plantafel-Neubau) → **M07 Angebot/Signatur** (hängt an M3-Deal).
|
||
|
||
### Phase 4 — Kommunikation & Termine
|
||
12. **M05 Form-Builder**, **M06 Booking**, **M25 Calendar-Sync** (low; M25 ist harte Vorbedingung für M06-Verfügbarkeit), **M09/M10 Email**, **M12 Telefonie**, **M13 Team-Chat** (WebSocket-Layer neu).
|
||
|
||
### Phase 5 — USP & Integration
|
||
13. **M17 Automation-Engine** (high; nach Domänen-Events der Vormodule), **M18 KI-Layer** (high), **M19 KWP** (gegen API neu schneiden).
|
||
|
||
### Phase 6 — Endkunden & Plattform-Betrieb
|
||
14. **M14 HR-Hub**, **M15 Customer-Portal** (low), **M20 Dashboard** (nach Domänen-Modulen), **M29 Onboarding**, **M35 DSGVO** (Tenant-Ebene), **M36 Mobile**, **M37 Plattform-Admin**, **M38 Help-Center**, **M39 Help-Desk**.
|
||
|
||
---
|
||
|
||
## Risiken / Offene Fragen
|
||
|
||
### Architektur-Risiken (blockierend)
|
||
- **R1 — Naming-Drift:** Ohne Rename greifen *alle* DoD-Pfade ins Leere. Höchste Priorität (Phase 0).
|
||
- **R2 — Postgres-RLS fehlt (M27/A.4):** Boilerplate macht nur App-Level-Scoping. RLS-Migration + `SET LOCAL app.tenant_id` + App-Role ohne BYPASSRLS + Worker-Job-Context komplett neu — Sicherheits-Fundament.
|
||
- **R3 — Kein Session-Prisma-Modell (M27/M15):** Weder TenantUser noch PortalUser haben server-side Postgres-Sessions (BP=Cookie-only). Betrifft M021 + das gesamte Customer-Portal.
|
||
- **R4 — AdminUser-Identität (M37):** Spec 37.1 verlangt vollständig getrennte AdminUser/AdminSession/AdminRole/AdminAuditLog; BP nutzt User-Extension + dasselbe RBAC + Authentik-OIDC. **Blockierende Entscheidung vor M034:** spec-treu neu bauen vs. Change-Request.
|
||
- **R5 — CRM-Architektur-Konflikt (M01):** BP-CRM ist Entity-Builder (Entity+Row+RowValue), Spec verlangt typisierte First-Class-Tabellen. **BP-CRM entfernen, nicht anpassen** — sonst sickert fremde Architektur ein.
|
||
- **R6 — Operator-scoped Lead (M02/M06/M37):** `marketingLeads.Lead` ist operator-scoped (globales `@@unique([email])`, Funnel-Status). Der tenant-scoped HiveGrid-CRM-Lead gehört fachlich zu M01 und muss neu — NICHT mitbenutzen.
|
||
|
||
### Technische Risiken
|
||
- **R7 — Subframe-Adapter fehlt (M15-Querschnitt):** Pflicht für jede UI-Route (User-Memory), aber nur leere Boundary. Quer-Voraussetzung.
|
||
- **R8 — realtime = SSE, kein WebSocket:** Präjudiziert M03 (Live-Kanban) und blockiert M13 (Team-Chat braucht generischen WS-Room-Layer). hocuspocus ist CRDT, kein Chat-Broadcast.
|
||
- **R9 — Fehlende Dependencies (PLAN.md falsch):** `signature_pad`, `browser-image-compression`, `react-grid-layout`, `kbar`, `next-themes`, `libphonenumber`, `googleapis`/`@microsoft/microsoft-graph`, `ics/ical-generator`, `EXCLUDE USING gist/btree_gist` — alle NICHT vorhanden. Vor Bau ergänzen.
|
||
- **R10 — Apple-Compliance (M28/M36, LP-8):** Fertige BP-Pricing/Upgrade-UI darf NICHT in die Mobile-App. Größtes Anti-Risiko bei Billing.
|
||
- **R11 — Suche-Architektur (M24):** BP=Meilisearch+SQL-ILIKE, Spec=Postgres-FTS+pgvector-RRF-Fusion. Phase-0-Entscheid nötig (FTS-Pfad + Fusion komplett neu).
|
||
- **R12 — Per-Tenant-KMS fehlt (M14/M25):** CryptoApi ist Single-Env-Key. Spec verlangt Per-Tenant-DEK/KMS (Password-Safe, OAuth-Tokens).
|
||
|
||
### Offene fachliche Fragen (für User/Noah)
|
||
- **F1:** EU-SMTP-Provider final wählen (M10/M22) — MailerSend ist nicht-EU (LP-13-Konflikt); Scaleway TEM evaluieren.
|
||
- **F2:** Captcha-Provider — BP=Cloudflare Turnstile, Spec=hCaptcha (EU). Tausch nötig (M05/M125).
|
||
- **F3:** KWP-API-Verfügbarkeit/Vertrag bestätigen → M089–M095 neu schneiden.
|
||
- **F4:** SHK-Custom-Field-/Tag-Defaults + 7-10 SHK-Rollen-Template finalisieren (M01/M27/M29 — deklaratives Seeding).
|
||
- **F5:** Idempotenz-Strategie Stripe-Webhook (M28): StripeWebhookLog-Tabelle (Spec) vs. Outbox-dispatchKey (BP) — Konflikt klären.
|
||
- **F6:** Saved-Searches Phase 1 vs. 2 (M24); `url/email` als eigene field_type vs. Validierung (M01); Activity-Tabelle vs. Audit-Wiederverwendung (M01/M45).
|