Skip to content

dark-trench/squid_studio

Squid Studio

Visual editor for Squidie workflows.

Squidie Integration

Squid Studio uses Squidie as the workflow runtime and editor-spec boundary. Studio owns the embedded Phoenix UI; host applications still own runtime configuration, storage, queues, workers, authorization, and redaction.

Add both packages to a host application when the Studio UI should author, validate, preview, or inspect Squidie workflows:

defp deps do
  [
    {:squidie, "~> 0.1.3"},
    {:squid_studio, "~> 0.1.0"}
  ]
end

Hosts should configure Squidie directly in the host application:

config :squidie,
  repo: MyApp.Repo,
  queue: "default"

Squid Studio does not start workers or choose storage. Host applications expose only the workflows, runs, action registry, and visibility scope that a user is allowed to access.

Embed In A Phoenix App

Add Squid Studio as a dependency, then mount it from the host router:

defmodule MyAppWeb.Router do
  use MyAppWeb, :router

  import SquidStudio.Web.Router

  scope "/dev" do
    pipe_through :browser

    squid_studio "/squid-studio"
  end
end

Host applications can provide workflow data by implementing SquidStudio.Web.Resolver:

defmodule MyApp.SquidStudioResolver do
  @behaviour SquidStudio.Web.Resolver

  @impl true
  def resolve_user(conn), do: conn.assigns[:current_user]

  @impl true
  def resolve_access(_user), do: :all

  @impl true
  def resolve_workflows(_user) do
    [
      %{
        id: "workflow",
        name: "Workflow",
        nodes: [],
        edges: []
      }
    ]
  end
end

Then pass it to the mount macro:

squid_studio "/squid-studio", resolver: MyApp.SquidStudioResolver

Standalone Development

mix deps.get
mix assets.build
cd standalone
mix phx.server

Visit http://localhost:4000.

Run validation with:

mix precommit

About

Durable Workflow Visual Editor

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors