How fenghao-jun/low_design works
Main Components Identification
• Design Pages (the “design” folder): These house the main entry pages and business pages that end users will interact with. They include components and pages such as “design/pages”, “design/components”, and various UI elements.
• Low-Code Logic Handler (the “design-code” folder, found under “src/design-core” in the file tree): This contains the logic, actions, types, utilities, and rendering setup needed to process low-code commands. It is the central processing unit for events (actions), component registration, and handling the low-code data structure.
• Low-Code Editor (the “design-editor” folder): This is dedicated to editing the low-code content. It includes flow-event handling (for event propagation, context menus, etc.), work-flow configuration (which covers various node types like start, condition, router, etc.), and APIs that interface with the back-end or other services.
• Remote / Extensible Components: The project supports extensibility through remote components by using module federation. This enables non-universal components to be developed in separate repositories (as noted with remote-component and module federation setup in the README) and then integrated into the system.
• Shared Utility/Infrastructure: There are shared assets, styles, hooks, and HTTP utilities that support the entire system. These common utilities are found in directories like “src/utils”, “src/styles”, and configuration files that govern the project setup (webpack/vite configs, env files, etc.).
Relationships and Interactions
• The Design Pages rely on the core low-code processing (“design-code”) for business logic and component registration. They call upon the actions and render functionalities to display UI components dynamically.
• The Design Editor interacts with both the low-code core and the design pages. It serves as the interface for configuring workflows, setting up events, and linking UI elements to low-code definitions.
• The remote components are designed to be registered via a centralized registry (see “component-regiter.ts” in design-core) and are dynamically imported in components such as “src/design/components/RemoteComponent/index.vue”. This introduces an external dependency that is abstracted through module federation.
• Common utilities and shared resources are used by all parts of the project to standardize API calls, manage styles, enforce hooks, and perform validations.
Architectural Patterns and Design Principles
• Separation of concerns is evident by dividing the project into pages (UI rendering), core low-code logic (action and event handling), and editor functionality (workflow and design editing).
• The system uses component registration for dynamic rendering. The “componentActionCenter” and “component-regiter” utilities indicate a plugin-like architecture.
• Module Federation is applied for remote component integration, ensuring that externally developed UI components can be plugged in seamlessly.
• The design-editor’s decoupling of flow events, node types, and work-flow suggests an event-driven and component-based architecture.