# Picture Monorepo - Complete Architecture Guide **Erstellt:** 2025-10-09 **Status:** Production Ready **Letzte Aktualisierung:** 2025-10-09 --- ## Inhaltsverzeichnis 1. [Executive Summary](#executive-summary) 2. [Architektur Übersicht](#architektur-übersicht) 3. [Framework Compatibility Matrix](#framework-compatibility-matrix) 4. [App Details](#app-details) 5. [Shared Packages](#shared-packages) 6. [PNPM Workspace Setup](#pnpm-workspace-setup) 7. [UI Component Strategy](#ui-component-strategy) 8. [Migration Steps](#migration-steps) 9. [Development Workflow](#development-workflow) 10. [Deployment Strategy](#deployment-strategy) 11. [Environment Variables](#environment-variables) 12. [Code Sharing Matrix](#code-sharing-matrix) 13. [Recommendations & Future Options](#recommendations--future-options) --- ## Executive Summary Das Picture Projekt ist ein **PNPM Workspace Monorepo** mit drei unabhängigen Applikationen: 1. **Mobile App** (React Native + Expo) - iOS & Android 2. **Web App** (SvelteKit) - Vollständige Webanwendung 3. **Landing Page** (Astro) - Marketing Website Alle Apps teilen gemeinsame TypeScript Packages für maximalen Code Reuse bei minimaler Komplexität. ### Wichtigste Erkenntnisse ✅ **Code Reuse:** ~35-40% des Codes wird geteilt ✅ **Framework-Unabhängigkeit:** Jede App nutzt den optimalen Tech Stack ✅ **Deployment-Flexibilität:** Unabhängiges Deployment pro App ⚠️ **UI Components:** Können NICHT zwischen Frameworks geteilt werden --- ## Architektur Übersicht ``` picture/ ├── apps/ │ ├── mobile/ # React Native (Expo) │ │ ├── app/ # Expo Router │ │ ├── components/ │ │ ├── hooks/ │ │ ├── package.json │ │ └── 🎯 Uses @memoro/mobile-ui │ │ │ ├── web/ # SvelteKit │ │ ├── src/ │ │ │ ├── lib/ │ │ │ │ ├── components/ # Svelte-specific UI │ │ │ │ └── stores/ │ │ │ ├── routes/ │ │ │ │ ├── +layout.svelte │ │ │ │ ├── +page.svelte │ │ │ │ ├── auth/ │ │ │ │ ├── images/ │ │ │ │ └── profile/ │ │ │ └── app.html │ │ ├── static/ │ │ ├── svelte.config.js │ │ └── package.json │ │ │ └── landing/ # Astro │ ├── src/ │ │ ├── components/ │ │ │ ├── Hero.astro │ │ │ ├── Features.astro │ │ │ ├── Pricing.astro │ │ │ └── Footer.astro │ │ ├── layouts/ │ │ │ └── Layout.astro │ │ ├── pages/ │ │ │ ├── index.astro # Homepage │ │ │ ├── features.astro │ │ │ ├── pricing.astro │ │ │ └── about.astro │ │ └── styles/ │ ├── public/ │ ├── astro.config.mjs │ └── package.json │ ├── packages/ │ ├── mobile-ui/ # @memoro/mobile-ui │ │ ├── components/ │ │ │ ├── ui/ # 17 React Native components │ │ │ └── navigation/ │ │ ├── cli/ # CLI tool for installation │ │ └── 🎯 React Native ONLY │ │ │ ├── shared/ # @picture/shared │ │ ├── src/ │ │ │ ├── types/ │ │ │ │ ├── database.ts # Supabase Types │ │ │ │ ├── models.ts # App Models │ │ │ │ └── index.ts │ │ │ ├── api/ │ │ │ │ ├── supabase.ts # Supabase Config │ │ │ │ ├── images.ts # Image API │ │ │ │ ├── auth.ts # Auth API │ │ │ │ └── index.ts │ │ │ ├── utils/ │ │ │ │ ├── image.ts # Image Utils │ │ │ │ ├── validation.ts # Validation │ │ │ │ └── index.ts │ │ │ └── index.ts │ │ ├── package.json │ │ └── tsconfig.json │ │ │ ├── design-tokens/ # @memoro/design-tokens (Future) │ │ ├── src/ │ │ │ ├── colors.ts │ │ │ ├── spacing.ts │ │ │ ├── typography.ts │ │ │ └── index.ts │ │ └── package.json │ │ │ └── ui/ # (empty/deprecated) │ ├── package.json # Root Package.json ├── pnpm-workspace.yaml # PNPM Workspace Config ├── .npmrc # NPM Config ├── tsconfig.base.json # Base TypeScript Config └── .env.example # Environment Variables Template ``` --- ## Framework Compatibility Matrix ### Package Kompatibilität | Package | Mobile (RN) | Web (Svelte) | Landing (Astro) | Beschreibung | |---------|-------------|--------------|-----------------|--------------| | `@memoro/mobile-ui` | ✅ Full support | ❌ Incompatible | ❌ Incompatible | React Native UI Components | | `@picture/shared` | ✅ Yes | ✅ Yes | ✅ Yes | Backend Logic, Types, APIs | | `@memoro/design-tokens` | ✅ Yes* | ✅ Yes* | ✅ Yes* | Colors, Spacing, Typography | *Future implementation ### Warum UI Components nicht geteilt werden können **@memoro/mobile-ui nutzt React Native Primitives:** ```tsx import { View, Pressable, Text } from 'react-native'; import Animated from 'react-native-reanimated'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; ``` **Web Apps nutzen andere Primitives:** ```svelte
``` ```astro
``` **Technische Einschränkungen:** - `View` ≠ `
` - `Pressable` ≠ `