Installation
Copy MarkdownIncant ships an Igniter-powered installer:
mix incant.install
The task creates:
lib/my_app/admin.ex
lib/my_app/admin/resources/sample.ex
lib/my_app/admin/themes/default.exIt also patches the Phoenix router and app CSS when it can detect them.
Router patch
The installer looks for a Phoenix router and adds use Incant.Router plus an admin mount in the browser scope:
defmodule MyAppWeb.Router do
use MyAppWeb, :router
use Incant.Router
scope "/", MyAppWeb do
pipe_through :browser
incant "/admin", MyApp.Admin
end
endRouter patching uses AST checks and AST insertion with a conservative fallback. If the router cannot be patched confidently, apply the snippet manually.
CSS patch
The installer looks for assets/css/app.css and adds the Incant Tailwind source:
@source "../deps/incant/lib";If your app keeps CSS elsewhere, add the source manually.
Dry run
Igniter supports previewing changes before writing them. Use the regular Igniter task options available in your environment to inspect the generated diff before applying.
Next steps
After installation:
- Visit
/admin. - Replace the sample resource with your app resources.
- Configure a theme or copy the default CSS variables from
Incant.Design.css_variables/0. - Add a policy if the admin surface should be restricted.
See also: