How mitate-gengaku/visualflow works
Main Components
• Frontend Application: Since this is a React/Next.js application, start by showing the overall client-side structure. Include key components such as:
• App Entry (Next.js pages, layout, global styles)
• Flow Feature Module: This is the core of the application. Illustrate components under src/src/features/flow which handle:
• The visual design canvas (ReactFlow integration)
• Node components (workflow-node, job-node, step-node)
• Control components (zoom controls, save/download controls)
• Export functionality (export dialogs, code-block, copy & download operations)
• Configuration and custom handlers (custom source/target handles, initial node/edge configuration)
• Theme Feature Module: Represent the theming system based on files under src/src/features/theme and the theme provider in src/src/components/provider.
• State Management: Include the state stores (under src/src/store and within src/src/features/flow/store) managing the workflow state, connections, edges, nodes, and UI dialogs (export/save data).
Relationships and Data Flow
• How the Next.js app acts as the central container, bootstrapping the visual designer.
• How UI components (layout, header, sidebar, etc.) interact with feature components (the flow and theme modules).
• Conversion from visual workflow (UI state) to YAML code, flowing from the ReactFlow components through export utilities and finally to the clipboard/download functionalities.
• Integration of external libraries like ReactFlow as an integral part of the visual flow design component.
Architectural Patterns and Design Principles
• Modularity: Different features (flow design, theme switching) are encapsulated in separate directories, which helps in maintaining and swapping modules as needed.
Technologies and Dependencies
• Next.js: Indicate the SSR/React-based front end framework forming the app’s backbone.
• ReactFlow: Highlight its role in managing and displaying the visual workflow.
• TypeScript: Mention that the code is strongly typed (as seen in .ts and .tsx files).
• Tailwind CSS and PostCSS: For styling (evident by tailwind.config.ts and globals.css).