How mittwald/flow works
Main Components / Modules
• Documentation & Demo Apps – Under “apps” you have at least a docs site (with Next.js) and a remote-dom-demo. These are the consumer applications that use the design system.
• Components Library – “packages/components” is the heart of the design system, hosting all UI components (Accordion, Button, Modal, etc.). It also includes development utilities, storybook configurations, and integration with TypeScript.
• Remote & Bridging Functionality – Several packages work together for remote component rendering and cross-boundary integrations:
• “packages/ext-bridge” manages external bridging integration.
• “packages/remote-core” handles low‐level remote connectivity.
• “packages/remote-elements” provides auto‐generated web components that wrap the UI components.
• “packages/remote-react-components” offers ready-to-use React wrappers for those elements.
• “packages/remote-react-renderer” provides a rendering mechanism for these remote components.
• “packages/react-tunnel” supplies additional context and tunnel components for complex layout or communication between boundaries.
• Tooling & Dev Infrastructure – Notice folders like “packages/codemods”, “packages/typescript-config”, and configuration files (e.g., Vite, lerna, nx, pnpm-workspace) that make up the build and maintenance pipeline.
Relationships and Interactions
• The UI Components package is the primary consumer of the design tokens and is itself consumed by various consumer apps (documentation/demo apps) and further wrapped in the remote elements and remote react wrappers for integration in various environments.
• The ext-bridge, remote-core, remote-elements, and remote-react components work together to expose the components as web or remote elements with reactive properties so that host applications (which might be built in Next.js or other frameworks) can integrate them seamlessly.
• Tooling and codemods are used to assist development and migration, ensuring that changes in the design system propagate correctly across the components and apps.
• There is a clear dependency chain where lower-level packages (design tokens, TypeScript configurations) provide building blocks for higher-level UI components, which then feed into demo/documentation apps.
Architectural Patterns / Principles
• Modularity: The project is structured as a monorepo with many packages, each addressing a specific concern (design tokens, UI components, bridging, remote rendering, etc.).
• Reusability and Separation of Concerns: The tokens, core components, wrappers, and integration layers are clearly separated to allow reuse in different contexts.
• Remote Component Pattern: The use of remote-core, remote-elements, and react wrappers suggests a design that supports micro-frontend or remote component rendering strategies.
• Consistent API and Themability: Design tokens help maintain a consistent look while allowing themes to be applied across all components.
Final Advice
• Component’s role is stated (e.g., “Design Tokens: central styling configuration”, “Components: UI library”, “Remote Elements: Web component wrappers”, “React Renderer: handles remote rendering”).
• Directional data flow and the dependency relationships: for instance, which packages consume or provide services to others.
• Remember to mark critical interfaces and integration touchpoints (like the ext-bridge and remote-core modules) as these are central to the remote component mechanism.