**Ziel-Branch:** `int` **Feature-Branch:** `feat/saas-multi-tenant-mandates` **Stand:** Januar 2026 --- ## Übersicht | Metrik | Wert | |--------|------| | **Anzahl Commits** | 73 | | **Geänderte Dateien** | 455 | | **Zeilen hinzugefügt** | ~78'604 | | **Zeilen gelöscht** | ~15'070 | --- ## Wichtigste inhaltliche Änderungen ### 1. SaaS Multi-Mandate & Mandatsverwaltung - Mandaten-Navigation und Mandatenwechsel im UI - Mandats-Einladungen und Benachrichtigungssystem - Mandats-Rollen und -Berechtigungen (RBAC) - Zugriff auf Seiten und Features mandatenbasiert - UID-/ID-Mapping und Referenzen für Multi-Mandate angepasst ### 2. Admin-Bereich - Admin-Seiten: Mandate, RBAC-Rollen, RBAC-Regeln, Team-Mitglieder - Feature-Zugriff, Benutzer-Zugriff, Mandats-Rollen-Berechtigungen - Einladungsverwaltung, Benutzer-Mandate, Benutzerübersicht - RBAC-Export/Import ### 3. Trustee (Treuhand)-Feature - Trustee-Views: Dashboard, Positionen, Dokumente, Verträge, Rollen, Organisationen, Access - Expense-Import-View, Positions-Dokumente - Trustee-API und Hooks (`useTrustee`, `useTrusteeOptions`) ### 4. Workflows & Automation - Workflow-Playground mit zentralem State, Log-Polling, Lifecycle-Hooks - Automations-Seite und Workflows-Seite - Workflow-Statistiken, verbesserte Log-Darstellung - Chatbot-Integration (Messages, Dateien, Lifecycle) ### 5. PEK (Projekte & Stammdaten) - Isoliert in Folder ### 6. Authentifizierung & Nutzerverwaltung - Magic-Link-Login - Passwort-Reset (Request & Reset-Seiten) - Registrierung und Login überarbeitet - Erweiterter Auth-Hook und CSRF-Utilities ### 7. GDPR & Rechtliches - GDPR-konforme Seite/Flows - PowerOn Home, Datenschutz, AGB als statische HTML-Seiten ### 8. UI/UX & Architektur - Neues Page-Management (`core/PageManager`) mit datengetriebenen Seiten - FormGenerator: Aufteilung in Form, List, Table, Controls, Action-Buttons - Server-seitige Filter/Sort für generische Tabellen, Scroll-Lock für Header - Sidebar überarbeitet, Mandaten-Navigation, Tree-Navigation, UserSection - Notification-Bell, Access-Rules-Editor - Layouts: `MainLayout`, `FeatureLayout`; Seiten: `FeatureView`, `Dashboard`, `Settings` - Diverse UI-Komponenten (Log, Messages, MapView, Tabs, Toast, ViewForm, WorkflowStatus, etc.) ### 9. Konfiguration & Deployment - Konfiguration in `config/` (env, serverConfig, universalConfig) - Scripts nach `scripts/` (server, deploy-server) - GitHub-Workflows angepasst, Node-Version 20 ### 10. Weitere Features & Fixes - Speech-Integration (Prototyp), Speech-Seiten & -Transkripte - Real-Estate/Privilege-Checker isoliert in Folder - Althaus-Seite, PEK-Tabs umbenannt (Projects, Data Management) - Einstellungen-Seite, Basedata-Seiten (Connections, Files, Prompts) - Privilege-Caching und -Checker konsolidiert - Diverse Build- und TypeScript-Fixes, Hotfixes --- ## Geänderte Dateien (nach Bereichen) ### Konfiguration & Projekt - `.cursorignore`, `.gitignore`, `.github/workflows/*.yml` - `README.md`, `index.html`, `package.json`, `package-lock.json` - `vite.config.ts` - `config/*` (neu), `.env.*` → `config/.env.*` - `scripts/server.js`, `scripts/deploy-server.js` - `public/`: Favicon, Logos, `poweron-home.html`, `poweron-privacy.html`, `poweron-terms.html` ### API-Schicht - `src/api.ts` (erweitert) - Neu: `src/api/attributesApi.ts`, `authApi.ts`, `automationApi.ts`, `chatbotApi.ts`, `connectionApi.ts`, `featuresApi.ts`, `fileApi.ts`, `mandateApi.ts`, `permissionApi.ts`, `promptApi.ts`, `rbacRulesApi.ts`, `roleApi.ts`, `trusteeApi.ts`, `userApi.ts`, `workflowApi.ts` ### Auth & Provider - `src/providers/auth/AuthProvider.tsx`, `ProtectedRoute.tsx`, `authConfig.ts` - `src/providers/language/LanguageContext.tsx` - `src/auth/ProtectedRoute.tsx` (entfernt/ersetzt) ### Core: PageManager - `src/core/PageManager/PageManager.tsx`, `PageRenderer.tsx`, `SidebarProvider.tsx`, `pageInterface.ts` - `src/core/PageManager/data/pages/*`: admin (mandates, rbac-role, rbac-rules, team-members), automations, chatbot, connections, dashboard, files, pek, pek-tables, prompts, settings, speech, speech-transcripts, trustee (access, contracts, documents, organisations, positions, roles), workflows - `src/config/pageRegistry.tsx` ### Komponenten (Auswahl) - **AccessRules:** AccessLevelSelect, AccessRulesEditor, AccessRulesTable + Styles - **FormGenerator:** FormGeneratorControls, FormGeneratorForm, FormGeneratorList, FormGeneratorTable, ActionButtons (Copy, Custom, Delete, Download, Edit, Remove, View) - **Navigation:** MandateNavigation, TreeNavigation, UserSection + Styles - **NotificationBell**, **ContentPreview** (inkl. Renderer) - **Sidebar:** Sidebar, SidebarItem, SidebarSubmenu, SidebarUser, Styles, Logic, Types - **Dashboard/DashboardChat:** teils entfernt/umgebaut (Playground-basiert) - **Connections, Dateien, Mitglieder, PageManager, Popup, Prompts:** entfernt oder nach core/Pages migriert - **Speech:** SpeechConfirmation, SpeechInfo, SpeechSettings, SpeechSignUp - **TestSharepoint:** Tabelle, Logic, Interfaces - **Workflows:** WorkflowsTable, workflowsLogic, workflowsTypes - **UiComponents:** AutoScroll, Button, ConnectedFilesList, CopyableTruncatedValue, DragDropOverlay, DropdownSelect, InfoMessageOverlay, LocationInput, Log/LogMessage, MapView, Messages/ChatMessages, ParcelInfoPanel, Popup, Tabs, TextField, Toast, ViewForm, VoiceLanguageSelect, WorkflowStatus - **settings:** settingsUser ### Hooks - Neu/erweitert: `useAccessRules`, `useAdminMandates`, `useAdminRbacRoles`, `useAdminRbacRules`, `useAuthentication`, `useAutomations`, `useChatbot`, `useConnections`, `useCurrentInstance`, `useFeatureAccess`, `useFiles`, `useInstancePermissions`, `useInvitations`, `useMandateRoles`, `useMandates`, `useNavigation`, `useNotifications`, `usePek`, `usePekTables`, `usePermissions`, `usePlayground`, `usePrompts`, `useRbacExportImport`, `useResizablePanels`, `useRoles`, `useSettings`, `useTrustee`, `useTrusteeOptions`, `useUserMandates`, `useUsers`, `useWorkflows` - Playground: `useDashboardInputForm`, `useDashboardLogTree`, `useWorkflowLifecycle`, `useWorkflowPolling`, `useWorkflows`, `playgroundUtils` - Entfernt: `useSharePointTest` ### Seiten - **Neu:** `Dashboard.tsx`, `FeatureView.tsx`, `GDPR.tsx`, `InvitePage.tsx`, `PasswordResetRequest.tsx`, `Reset.tsx`, `Settings.tsx` - **Login, Register:** überarbeitet - **Home:** Connections, Dashboard, Dateien, Einstellungen, Prompts, TeamBereich, TestSharepoint, Workflows entfernt/ausgelagert; `Home.tsx` angepasst - **admin/:** AdminFeatureAccessPage, AdminFeatureInstanceUsersPage, AdminFeatureRolesPage, AdminInvitationsPage, AdminMandateRolePermissionsPage, AdminMandateRolesPage, AdminMandatesPage, AdminUserAccessOverviewPage, AdminUserMandatesPage, AdminUsersPage - **basedata/:** ConnectionsPage, FilesPage, PromptsPage - **migrate/:** ChatbotPage, PekPage, SpeechPage - **views/trustee/:** TrusteeDashboardView, TrusteeDocumentsView, TrusteeExpenseImportView, TrusteeInstanceRolesView, TrusteePositionDocumentsView, TrusteePositionsView - **workflows/:** AutomationsPage, PlaygroundPage, WorkflowsPage ### Contexts, Stores, Utils, Locales - **Contexts:** FileContext, PekContext, PekTablesContext, ToastContext, WorkflowSelectionContext - **Stores:** featureStore - **Utils:** attributeTypeMapper, csrfUtils, privilegeCheckers, time, userCache - **Types:** mandate.ts - **Locales:** de.ts, en.ts, fr.ts (erweitert) ### Styles & Assets - `src/styles/`: buttons.css, pages.module.css, themes (dark, light), assets/bg.jpg - `src/assets/styles/light.css` entfernt - `src/index.css`, `src/main.tsx` ### Dokumentation - `docs/DASHBOARD_LOG_POLLING_DOCUMENTATION.md` (neu) - `documentation/sidebar.md` (entfernt) - `.cursor/plans/implement_rbac_roles_page_*.plan.md` (Cursor-Plan) --- ## Commit-Historie (chronologisch) | Datum | Commit | Nachricht | |-------|--------|-----------| | 2025-09-10 | |
||
|---|---|---|
| .cursor/plans | ||
| .github/workflows | ||
| config | ||
| docs | ||
| public | ||
| scripts | ||
| src | ||
| .gitignore | ||
| env.d.ts | ||
| eslint.config.js | ||
| index.html | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| staticwebapp.config.json | ||
| tsconfig.app.json | ||
| tsconfig.json | ||
| tsconfig.node.json | ||
| vite.config.ts | ||
PowerOn Nyla Frontend
🏗️ Project Architecture
graph TB
%% Environment Files
ENV_DEV[".env.dev<br/>Development"]
ENV_PROD[".env.prod<br/>Production"]
ENV_INT[".env.int<br/>Integration"]
%% Configuration System
CONFIG_TS["config.ts<br/>TypeScript Config<br/>(React Frontend)"]
CONFIG_JS["serverConfig.js<br/>JavaScript Config<br/>(Node.js Servers)"]
%% Source Code
SRC["src/<br/>React Components"]
PUBLIC["public/<br/>Static Assets"]
HTML["index.html<br/>Main Template"]
%% Build Process
VITE["vite.config.ts<br/>Build Configuration"]
PACKAGE["package.json<br/>Dependencies & Scripts"]
TSCONFIG["tsconfig.json<br/>TypeScript Config"]
%% Build Output
DIST["dist/<br/>Built Application"]
%% Servers
SERVER_DEV["server.js<br/>Dev Server"]
SERVER_DEPLOY["deploy-server.js<br/>Deploy Server"]
SERVER_LEGACY["server.js<br/>Legacy Server"]
%% Deployment
GITHUB[".github/workflows/<br/>GitHub Actions"]
AZURE["Azure Static Web Apps"]
STATIC_CONFIG["staticwebapp.config.json<br/>Azure Config"]
%% Environment Flow
ENV_DEV --> CONFIG_TS
ENV_PROD --> CONFIG_TS
ENV_INT --> CONFIG_TS
ENV_DEV --> CONFIG_JS
ENV_PROD --> CONFIG_JS
ENV_INT --> CONFIG_JS
%% Configuration Usage
CONFIG_TS --> SRC
CONFIG_JS --> SERVER_DEV
CONFIG_JS --> SERVER_DEPLOY
CONFIG_JS --> SERVER_LEGACY
%% Build Process
SRC --> VITE
PUBLIC --> VITE
HTML --> VITE
PACKAGE --> VITE
TSCONFIG --> VITE
CONFIG_TS --> VITE
VITE --> DIST
%% Server Usage
DIST --> SERVER_DEV
DIST --> SERVER_DEPLOY
DIST --> SERVER_LEGACY
%% Deployment Flow
GITHUB --> ENV_PROD
GITHUB --> ENV_INT
GITHUB --> DIST
GITHUB --> SERVER_DEPLOY
GITHUB --> AZURE
STATIC_CONFIG --> AZURE
%% Styling
classDef envFile fill:black,stroke:#01579b,stroke-width:2px
classDef configFile fill:black,stroke:#4a148c,stroke-width:2px
classDef sourceFile fill:black,stroke:#1b5e20,stroke-width:2px
classDef buildFile fill:black,stroke:#e65100,stroke-width:2px
classDef serverFile fill:black,stroke:#880e4f,stroke-width:2px
classDef deployFile fill:black,stroke:#33691e,stroke-width:2px
class ENV_DEV,ENV_PROD,ENV_INT envFile
class CONFIG_TS,CONFIG_JS configFile
class SRC,PUBLIC,HTML sourceFile
class VITE,PACKAGE,TSCONFIG,DIST buildFile
class SERVER_DEV,SERVER_DEPLOY,SERVER_LEGACY serverFile
class GITHUB,AZURE,STATIC_CONFIG deployFile
Flow Overview:
- Environment files → Configuration system → Source code
- Source code → Build process → Built application
- Built application → Servers → Deployment
- GitHub Actions → Azure Static Web Apps
🔧 Configuration Setup
The app uses a dual configuration system to handle environment variables across different contexts:
Configuration Files
-
config/config.ts- TypeScript config for React frontend- Why: Provides type-safe access to environment variables in the browser
- How: Uses
import.meta.env(Vite's environment API) to accessVITE_*variables - Used by: All React components, hooks, and frontend logic
-
config/serverConfig.js- JavaScript config for Node.js servers- Why: Node.js can't access
import.meta.env, needsprocess.env - How: Uses
dotenvto load.envfiles andprocess.envto access variables - Used by: Express servers and build scripts
- Why: Node.js can't access
Environment Files
-
config/.env.dev- Development environment variables- Why: Separate config for local development with debug settings
- How: Copied to root
.envbynpm run devcommand - Contains: Local API URLs, debug flags, dev-specific settings
-
config/.env.prod- Production environment variables- Why: Production-specific settings (live API URLs, optimized settings)
- How: Copied to root
.envby GitHub Actions workflow - Contains: Production API URLs, security settings, performance configs
-
config/.env.int- Integration environment variables- Why: Testing environment that mirrors production but with test data
- How: Copied to root
.envby integration deployment workflow - Contains: Staging API URLs, test user credentials, integration settings
Usage
# Development (loads .env.dev)
npm run dev
# Production build (loads .env.prod)
npm run build:prod
# Integration build (loads .env.int)
npm run build:int
🖥️ Server Files
-
scripts/server.js- Express server for local development- Why: Serves the built React app locally for testing
- How: Serves static files from
dist/directory on port 3000 - Used by: Developers running
npm run devor manual testing
-
scripts/deploy-server.js- Express server for deployment- Why: Production server that serves the built app in cloud environments
- How: Serves static files and handles routing for SPA (Single Page Application)
- Used by: Azure Static Web Apps and other deployment platforms
-
server.js- Legacy server (kept for compatibility)- Why: Backup server file in case deployment scripts need it
- How: Basic Express server setup
- Used by: Fallback option for deployments
Both servers use config/serverConfig.js for environment variables and logging.
📁 Root Directory Files
Core Application Files
-
package.json- Node.js project configuration- Why: Defines dependencies, scripts, and project metadata
- How: Used by npm/yarn to install packages and run scripts
- Contains: Dependencies, build scripts, project info
-
vite.config.ts- Vite build tool configuration- Why: Configures how Vite builds and serves the React app
- How: Defines plugins, build options, and environment variable handling
- Contains: React plugin, HTML plugin, environment loading, build settings
-
tsconfig.json- TypeScript compiler configuration- Why: Defines TypeScript compilation rules and target settings
- How: Used by TypeScript compiler and IDE for type checking
- Contains: Compiler options, file includes/excludes, module resolution
-
index.html- Main HTML template- Why: Entry point for the React application
- How: Vite injects the built JavaScript and CSS into this template
- Contains: HTML structure, dynamic title injection, script tags
Build and Deployment
staticwebapp.config.json- Azure Static Web Apps configuration- Why: Configures routing and MIME types for Azure deployment
- How: Used by Azure Static Web Apps service
- Contains: Navigation fallback rules, MIME type mappings
Source Code and Assets
-
src/- Source code directory- Why: Contains all React components, hooks, and application logic
- How: Vite processes these files during build
- Contains: Components, pages, hooks, contexts, locales, assets
-
public/- Static assets- Why: Files that should be copied directly to build output
- How: Vite copies these files to
dist/during build - Contains: Images, logos, favicons, other static files
Configuration and Scripts
-
config/- Configuration files directory- Why: Centralizes all configuration and environment files
- How: Contains environment files and config modules
- Contains: Environment files, config.ts, serverConfig.js
-
scripts/- Server scripts directory- Why: Separates server-related files from main application code
- How: Contains Express server implementations
- Contains: server.js, deploy-server.js
CI/CD
.github/workflows/- GitHub Actions workflows- Why: Automates deployment to different environments
- How: Triggers on git pushes and deploys to Azure
- Contains: YAML files for dev, int, and prod deployments