mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-15 02:01:10 +02:00
Comprehensive analysis of inconsistencies across all web apps: - Dependencies & versions (Tailwind, SvelteKit, Vite, TypeScript) - API client patterns (3 architectures, 5 error handling strategies) - i18n implementation (10 apps with, 7 without) - Auth implementation (97% consistent) - Styling & Tailwind (97% consistent) - Components & layouts (duplications identified) Includes prioritized recommendations for standardization.
8.1 KiB
8.1 KiB
Monorepo Konsistenz-Bericht
Erstellt: 29. Januar 2026
Übersicht
Nach eingehender Analyse aller Web-Apps im Monorepo wurden folgende Bereiche auf Inkonsistenzen untersucht:
| Bereich | Konsistenz | Priorität |
|---|---|---|
| Dependencies & Versionen | ⚠️ Mittel | Hoch |
| API Client Patterns | ❌ Niedrig | Hoch |
| i18n Implementation | ⚠️ Mittel | Mittel |
| Auth Implementation | ✅ Gut | Niedrig |
| Styling & Tailwind | ✅ Sehr gut | Niedrig |
| Komponenten & Layouts | ⚠️ Mittel | Mittel |
1. Dependencies & Versionen
Kritische Inkonsistenzen
Tailwind CSS Ansatz (2 verschiedene Methoden)
| Methode | Apps |
|---|---|
@tailwindcss/postcss |
manadeck, chat, manacore, presi |
@tailwindcss/vite |
clock, planta, skilltree, todo, contacts, nutriphi, questions, calendar, storage, matrix |
SvelteKit Versionen
| Version | Apps |
|---|---|
| ^2.0.0 (minimal) | planta, clock, skilltree, todo, contacts, nutriphi, presi, questions, calendar, storage |
| ^2.15.7 - ^2.47.1 | manadeck, chat, manacore, picture, matrix |
Vite Major Version Split
| Version | Apps |
|---|---|
| v6.0.x | clock, skilltree, todo, contacts, nutriphi, questions, calendar, storage, manacore |
| v7.1.x | manadeck, chat, picture |
TypeScript Versionen
^5.9.x(spezifisch): manadeck, chat, manacore, picture^5.0.0(locker): planta, clock, skilltree, todo, contacts, nutriphi, presi, questions, calendar, storage
Empfehlungen
- Tailwind auf Vite-Plugin vereinheitlichen - alle 4 PostCSS-Apps migrieren
- SvelteKit auf ^2.47.1 für alle Apps aktualisieren
- TypeScript auf ^5.9.3 festlegen
- Vite auf eine Major-Version (v7.x empfohlen)
2. API Client Patterns
Kritische Inkonsistenzen
3 verschiedene Architektur-Patterns
| Pattern | Apps | Beispiel |
|---|---|---|
| Factory Function | calendar, manacore | createApiClient() |
| Class-Based Singleton | clock, nutriphi, skilltree, questions, planta, todo | new ApiClient() |
| Functional API Objects | chat, picture, contacts, presi, storage | conversationApi.getAll() |
4 verschiedene Token-Handling Ansätze
| Ansatz | Apps | Problem |
|---|---|---|
authStore.getAccessToken() |
clock, contacts, nutriphi, planta, storage | Kein Auto-Refresh |
authStore.getValidToken() |
picture, planta, chat | ✅ Auto-Refresh |
localStorage.getItem() |
presi, skilltree, questions | Sync, veraltete Tokens möglich |
| Manuelles Token-Property | todo, skilltree | Erfordert externen Setter |
5 verschiedene Error-Handling Strategien
| Strategie | Apps |
|---|---|
Result Type {data, error} |
calendar, manacore |
| Response Wrapper | clock, storage |
| Throw-on-Error | nutriphi, contacts, skilltree, questions, planta, todo |
| Domain-specific Fallbacks | chat, picture |
| Retry mit Backoff | nur manacore |
Base URL Handling
| Methode | Apps | Status |
|---|---|---|
| Hardcoded localhost | clock, todo, storage | ❌ Nicht für Produktion |
| Environment Variables | calendar, chat, picture, nutriphi | ⚠️ Build-Zeit |
| Runtime Injection (Docker) | skilltree, questions, planta | ✅ Flexibel |
Empfehlungen
-
@manacore/shared-api-clientPackage erstellen mit:- Standardisiertem
createApiClient(config)Factory ApiResult<T>Type (Go-style)- Auto-Token-Refresh bei 401
- Retry mit Exponential Backoff
- FormData Support
- Standardisiertem
-
authStore.getValidToken()als Standard für alle Apps -
Runtime URL Injection (Window-Objekt) für Docker-Kompatibilität
3. i18n Implementation
Status
Apps MIT i18n (10)
| App | Sprachen |
|---|---|
| chat | DE, EN, IT, FR, ES |
| picture | DE, EN, IT, FR, ES |
| calendar | DE, EN, IT, FR, ES |
| presi | DE, EN, IT, FR, ES |
| manadeck | DE, EN, IT, FR, ES |
| manacore | DE, EN, IT, FR, ES |
| contacts | DE, EN |
| storage | DE, EN |
| clock | DE, EN |
Apps OHNE i18n (7)
- zitare
- skilltree
- planta
- nutriphi
- todo
- matrix
- questions
Inkonsistenzen
- Verschiedene localStorage Keys:
chat_locale,picture_locale,locale - Unterschiedliche Sprachanzahl (2-5 Sprachen)
- Manacore Landing nutzt Custom-Implementation statt svelte-i18n
Empfehlungen
- i18n zu allen 7 fehlenden Apps hinzufügen
- Storage Key vereinheitlichen auf
{app}_locale - Mindestens DE + EN für alle Apps
4. Auth Implementation
Status: ✅ Gut (97% konsistent)
Alle Apps nutzen Mana Core Auth mit @manacore/shared-auth.
Kleine Variationen
| Aspekt | Pattern A | Pattern B |
|---|---|---|
| Init | initializeWebAuth (8 Apps) |
Custom Setup (ManaDeck) |
| URL Config | Window Injection (modern) | Static Import |
| Route Guards | (protected)/ Ordner |
(app)/ Ordner |
Empfehlungen
- Window Injection für URLs als Standard dokumentieren
- Auth Store Pattern in Shared Package extrahieren
- Server-Side Route Guards ergänzen (aktuell nur Client-Side)
5. Styling & Tailwind
Status: ✅ Sehr gut (97% konsistent)
- Alle Apps nutzen
@manacore/shared-tailwind/preset - Einheitliches Theme-System mit CSS Variables
- Dark Mode über
.darkKlasse - 4 Themes verfügbar: Lume, Nature, Stone, Ocean
Kleine Inkonsistenzen
- App-spezifische Farben in
app.cssvstailwind.config.js - Manche Apps definieren Shadows für Dark Mode doppelt
- Mixed
--theme-*und--color-*Prefixe
Empfehlungen
- App-Farben in tailwind.config.js statt app.css
- Dark Mode Shadows in Shared Preset konsolidieren
6. Komponenten & Layouts
Duplikationen gefunden
Toast System (2 Versionen)
| Version | Apps | Status |
|---|---|---|
| Svelte 5 Runes | chat, etc. | ✅ Modern |
| Writable Store | contacts, etc. | ⚠️ Legacy |
AuthGateModal
- Dupliziert in: chat, todo, contacts, calendar
- Sollte in
@manacore/shared-auth-ui
AppLoadingSkeleton
- Jede App hat eigene Version
- Könnte mit
@manacore/shared-uiSkeletons vereinheitlicht werden
Global Error Handler
- Nur in Contacts App vollständig implementiert
- Sollte extrahiert werden
Empfehlungen (nach Priorität)
Hoch
- Toast Store & Component vereinheitlichen - Svelte 5 Runes Standard
- AuthGateModal nach shared-auth-ui verschieben
- Global Error Handler als Composable extrahieren
Mittel
@manacore/shared-sveltekit-layoutPackage mit Root-Layout Template- FormModal Generator für config-driven Formulare
- AppLoadingSkeleton vereinheitlichen
Zusammenfassung der Prioritäten
🔴 Hohe Priorität
| Aufgabe | Aufwand | Impact |
|---|---|---|
| API Client Package erstellen | Hoch | Alle Apps |
| Tailwind auf Vite-Plugin migrieren (4 Apps) | Mittel | Build-Konsistenz |
| Toast System vereinheitlichen | Niedrig | UX Konsistenz |
🟡 Mittlere Priorität
| Aufgabe | Aufwand | Impact |
|---|---|---|
| i18n zu 7 Apps hinzufügen | Mittel | Internationalisierung |
| AuthGateModal in Shared Package | Niedrig | Code-Reduktion |
| Global Error Handler extrahieren | Niedrig | Error UX |
| Dependencies aktualisieren | Mittel | Maintenance |
🟢 Niedrige Priorität
| Aufgabe | Aufwand | Impact |
|---|---|---|
| SvelteKit/Vite Versionen angleichen | Niedrig | Konsistenz |
| App-Skeletons vereinheitlichen | Niedrig | Code-Reduktion |
| Auth Store Pattern dokumentieren | Niedrig | Onboarding |
Nächste Schritte
- API Client Package als erstes angehen (höchster Impact)
- Tailwind Migration für 4 Apps durchführen
- Toast System konsolidieren
- Schrittweise weitere Punkte abarbeiten
Anhang: Analysierte Apps
Web Apps (16)
- calendar, chat, clock, contacts, manadeck, manacore, matrix, nutriphi, picture, planta, presi, questions, skilltree, storage, todo, zitare
Shared Packages
- @manacore/shared-auth
- @manacore/shared-auth-ui
- @manacore/shared-icons (Phosphor)
- @manacore/shared-i18n
- @manacore/shared-tailwind
- @manacore/shared-ui
- @manacore/shared-theme