How prasad2604/workflow-to-json works
1. This repository is a client-side React application built with TypeScript and Vite. There is no backend, API layer, or server-side code in the tree, so the architecture is centered on a single browser-rendered UI.
2. The application entry path is conventional: index.html loads src/main.tsx, which mounts src/App.tsx. App.tsx appears to be the top-level composition layer that wires global styles and the primary feature screen together.
3. The main feature subsystem is a workflow-designer UI under src/components/WorkflowDesigner.tsx. Based on the surrounding components, this is the core stateful surface of the app: it likely owns the workflow graph model, selection state, and event handling for editing nodes and connections.
4. The workflow canvas is split into specialized renderers:
- CustomNode.tsx renders the visual representation of a workflow node.
- CustomEdge.tsx renders the visual representation of a connection between nodes.
These are boundary components between the editor’s data model and its visual graph rendering.
5. Sidebar.tsx is the secondary interaction surface. It likely acts as the inspector/editor for the currently selected node or workflow item, separating structural editing on the canvas from property editing in a side panel.
6. The data flow is probably:
browser interaction on the canvas or sidebar -> workflow state changes inside WorkflowDesigner -> updated node/edge props flow down into CustomNode and CustomEdge -> sidebar reflects the current selection and editable properties.
This makes WorkflowDesigner the central orchestration point.
7. The src/components/ui folder contains reusable presentational primitives such as card.tsx and input.tsx. These are app-wide UI building blocks rather than feature logic, and they support a clean separation between domain-specific workflow editing and generic form/layout controls.
8. components.json strongly suggests a component generator/design-system setup, commonly used with shadcn-style UI patterns. Architecturally, that means the app favors local, composable UI primitives over a large third-party widget framework.
9. Shared utility code lives in src/lib/utils.ts, which likely provides small cross-cutting helpers used by the UI layer. This is the usual place for class-name composition or similar shared presentation helpers.
10. Styling is split between src/index.css for global base styles and src/App.css for feature-level styling. This keeps application shell styling separate from workflow-designer-specific layout and interaction styles.
11. Static assets are stored under src/assets, while public/ holds files that must be served as-is. There is no evidence of runtime asset fetching or external data dependencies in the repository structure.
12. Tooling is standard modern frontend tooling: Vite for development/build, TypeScript for static typing, and ESLint for code quality. The repository is therefore optimized for rapid local iteration and type-safe component development rather than distributed-system concerns.
13. For an architecture diagram, the key boundaries are:
- bootstrapping layer: index.html → main.tsx
- app shell: App.tsx
- core feature domain: WorkflowDesigner.tsx
- domain renderers: CustomNode.tsx, CustomEdge.tsx
- inspector/editing panel: Sidebar.tsx
- shared UI primitives and utilities: components/ui/*, lib/utils.ts
- global styling/static assets: CSS files, assets/, public/
Main entry points: App.tsx App.tsx · WorkflowDesigner.tsx WorkflowDesigner · ui UI primitives · main.tsx main.tsx
Components 19
Bootstrap
Browser entry and app composition
- index.html · Browser entry document that loads the app bundle
index.html - main.tsx · Bootstraps React and mounts the app root
src/main.tsx - App.tsx · Top-level composition layer for the client app
src/App.tsx
Workflow UI
Core workflow designer and its canvas surfaces
- WorkflowDesigner · Central stateful workflow editing surface
src/components/WorkflowDesigner.tsx - CustomNode · Renders individual workflow nodes on the canvas
src/components/CustomNode.tsx - CustomEdge · Renders connections between workflow nodes
src/components/CustomEdge.tsx
Inspector
Selection and property editing panel
- Sidebar · Secondary panel for selection details and property edits
src/components/Sidebar.tsx
Shared UI
Reusable primitives and utilities
- UI primitives · Reusable presentational controls used across the app
src/components/ui - card.tsx · Card container primitive
src/components/ui/card.tsx - input.tsx · Input control primitive
src/components/ui/input.tsx - utils.ts · Shared utility helpers for the UI layer
src/lib/utils.ts
Style & Assets
Global styles and static resources
Tooling
Build and type-check configuration
- components.json · Component generation and design-system configuration
components.json - vite.config.ts · Vite development and build configuration
vite.config.ts - tsconfig · TypeScript compilation settings
tsconfig.json - eslint.config.js · Code quality and linting rules
eslint.config.js
Connections 20
- index.html → main.tsx: loads · The HTML entry loads the React entrypoint
- main.tsx → App.tsx: mounts · The entrypoint mounts the top-level app shell
- App.tsx → WorkflowDesigner: renders · The app shell composes the core workflow editor
- WorkflowDesigner → CustomNode: uses · Workflow state drives node rendering
- WorkflowDesigner → CustomEdge: uses · Workflow state drives edge rendering
- WorkflowDesigner → Sidebar: coordinates · Selection and editing state flow into the inspector panel
- Sidebar → input.tsx: uses · The sidebar relies on reusable form controls
- Sidebar → card.tsx: uses · The sidebar relies on reusable layout primitives
- App.tsx → App.css: styles · Application shell styles are attached to the top-level app
- App.tsx → index.css: styles · Global base styles apply across the app
- WorkflowDesigner → UI primitives: composes · The designer builds its UI from shared primitives
- UI primitives → card.tsx: includes · Representative shared container primitive
- UI primitives → input.tsx: includes · Representative shared form primitive
- UI primitives → utils.ts: uses · Shared primitives depend on small UI helpers
- assets → App.tsx: supports · Static assets support the browser UI
- public → index.html: serves · Public files are served directly alongside the HTML entry
- components.json → UI primitives: configures · Component-generation config supports the shared UI layer
- vite.config.ts → main.tsx: builds · Vite config drives the client bundle entry
- tsconfig → main.tsx: types · TypeScript settings apply to the application code
- eslint.config.js → App.tsx: checks · Linting covers the application and component code