AccrueAdmin
LiveView admin UI for Accrue billing operations. Versioning tracks the
accrue package—use the same ~> range for
both. For a plain-language history of releases (instead of only GitHub release
bullets), see Accrue release notes.
Quickstart
accrue_admin stays downstream of the core billing setup. Start with the
checked-in Fake-backed demo or the Accrue First Hour guide, get the core
billing facade and signed webhook path working, then mount the admin UI for
operators.
Hex vs
main: The{:accrue_admin, "~> …"}line below tracksaccrue_admin/mix.exs@versionon the branch you are reading (typicallymainon GitHub). Hex.pm publishes that train after release; use HexDocs for operator UI docs matched to the Hex version you resolved.
Keep accrue on the same ~> train when both packages are in the host mix.exs, and pin production upgrades via mix.lock.
Add accrue_admin to your host application and mount the package router where operators manage billing:
defp deps do
[
{:accrue_admin, "~> 1.1.2"}
]
enddefmodule MyAppWeb.Router do
use MyAppWeb, :router
import AccrueAdmin.Router
scope "/" do
pipe_through [:browser]
accrue_admin "/billing"
end
end
Run mix deps.get, finish the core billing and signed-webhook path, and then
continue with the package guide on HexDocs for route session options, branding,
and auth details:
Operator copy (tiers)
Contributors should treat operator-facing strings in three tiers:
- Tier A — Host contract: production
accrue_adminLiveView copy on mounted routes lives inAccrueAdmin.Copy(and verbatim legal/replay gates inAccrueAdmin.Copy.Locked). Treat changes as host-visible: follow semver and call them out under### Host-visible copy (accrue_admin)in this packageCHANGELOG.md. - v1.14 parity inventory: route-level Copy / token / VERIFY posture for the 11 core mounted surfaces is tracked in
guides/core-admin-parity.md(ADM-07); start there before widening VERIFY or Copy modules. - Tier B — Library demo:
ComponentKitchenLiveand fixture-heavy previews are non-contract; safe for marketing or instructional tone. - Tier C — Dev-only: routes behind dev flags may use placeholder copy but must not imply safety or compliance the library does not provide.
Host setup
accrue_admin expects the host app to provide browser session state and an Accrue.Auth adapter that can resolve an admin-capable operator. The full router mount, branding config, and auth expectations live in the admin UI guide on HexDocs:
The first-time host setup path for the core package lives in the Accrue First Hour guide:
The canonical local demo path lives in the checked-in host app:
examples/accrue_host/README.md
Published accrue_admin releases resolve accrue ~> 1.1.2. Monorepo development keeps the sibling ../accrue path dependency unless ACCRUE_ADMIN_HEX_RELEASE=1 is set for release validation.
Assets
The package ships its own committed static bundle from priv/static/. Rebuild it locally with:
cd accrue_admin
mix accrue_admin.assets.buildNo host Tailwind config or JavaScript bootstrap changes are required.
Browser UAT
The example-host browser proof in examples/accrue_host/README.md is the full mounted-admin proof path. The commands below are fast package smoke against the admin fixture endpoint only.
The browser regression suite lives under e2e/ and runs against the package's test Phoenix endpoint:
cd accrue_admin
npm ci
npx playwright install chromium
npm run e2eAdmin routes
Source of truth for paths is AccrueAdmin.Router.accrue_admin/2.
The operator sidebar curates navigation for usability; this section lists routes in router declaration order, which may differ from sidebar ordering.
Shipping live/3 routes (relative to the mount path), in monotonic router order:
| Order | Nav label | Path | LiveView module |
|---|---|---|---|
| 1 | Home | / | AccrueAdmin.Live.DashboardLive |
| 2 | Customers | /customers | AccrueAdmin.Live.CustomersLive |
| 3 | — | /customers/:id | AccrueAdmin.Live.CustomerLive |
| 4 | Subscriptions | /subscriptions | AccrueAdmin.Live.SubscriptionsLive |
| 5 | — | /subscriptions/:id | AccrueAdmin.Live.SubscriptionLive |
| 6 | Invoices | /invoices | AccrueAdmin.Live.InvoicesLive |
| 7 | — | /invoices/:id | AccrueAdmin.Live.InvoiceLive |
| 8 | Charges | /charges | AccrueAdmin.Live.ChargesLive |
| 9 | — | /charges/:id | AccrueAdmin.Live.ChargeLive |
| 10 | Coupons | /coupons | AccrueAdmin.Live.CouponsLive |
| 11 | — | /coupons/:id | AccrueAdmin.Live.CouponLive |
| 12 | Promotion codes | /promotion-codes | AccrueAdmin.Live.PromotionCodesLive |
| 13 | — | /promotion-codes/:id | AccrueAdmin.Live.PromotionCodeLive |
| 14 | Connect | /connect | AccrueAdmin.Live.ConnectAccountsLive |
| 15 | — | /connect/:id | AccrueAdmin.Live.ConnectAccountLive |
| 16 | Event log | /events | AccrueAdmin.Live.EventsLive |
| 17 | Webhooks | /webhooks | AccrueAdmin.Live.WebhooksLive |
| 18 | — | /webhooks/:id | AccrueAdmin.Live.WebhookLive |
Dev-only (allow_live_reload: true)
| Path | LiveView module |
|---|---|
/dev/clock | AccrueAdmin.Dev.ClockLive |
/dev/email-preview | AccrueAdmin.Dev.EmailPreviewLive |
/dev/webhook-fixtures | AccrueAdmin.Dev.WebhookFixtureLive |
/dev/components | AccrueAdmin.Dev.ComponentKitchenLive |
/dev/fake-inspect | AccrueAdmin.Dev.FakeInspectLive |