Skip to content

Latest commit

 

History

History
44 lines (30 loc) · 1.03 KB

File metadata and controls

44 lines (30 loc) · 1.03 KB

ReactFlow

Igniter installer for Phoenix apps that adds:

  • live_react
  • @xyflow/react (React Flow)
  • Vite-based frontend scaffolding compatible with LiveReact
  • Example ReactFlowLive route rendering a graph component

Usage

Add the installer package to your Phoenix project and run:

mix igniter.install react_flow

Or, if the dependency is already present:

mix react_flow.install

What It Patches

  • mix.exs: adds {:live_react, "~> 1.1"} and updates assets.* aliases
  • config/dev.exs: adds :live_react dev config and npm watcher
  • config/prod.exs: adds :live_react prod config with SSR disabled by default
  • lib/<app>_web.ex: imports LiveReact in html_helpers/0
  • root.html.heex: wraps app assets with LiveReact.Reload.vite_assets
  • assets/: creates Vite + React Flow starter files
  • Router and LiveView: adds /react-flow and an example ReactFlowLive

After Running

Run:

mix deps.get
npm install --prefix assets

Then start your Phoenix server and open /react-flow.