What problem does it solve?
It solves the problem of adding multi-tenant, account-scoped navigation and authorization in a Phoenix app that already uses phx.gen.auth, so users can switch between organizations/accounts safely.
Core Features & Use Cases
- Multi-tenant data model: creates
accounts and account_users (membership) with roles and slug-based accounts.
- Account-scoped access layer: adds an
AccountContext facade to list accessible accounts, validate account access per user, and pick a default account from session.
- Authenticated dashboard UX: provides a dashboard layout with sidebar navigation, breadcrumbs, and an account switcher LiveComponent, including theme toggle support via DaisyUI.
- Routing + redirect flow: implements an account-scoped dashboard route (
/dashboard/accounts/:account_id) with LoadAccount plug and a /dashboard redirect controller to the user’s default account.
Quick Start
Install the skill and run the bootstrap workflow for your existing Phoenix 1.8 + phx.gen.auth + DaisyUI app by telling the assistant: bootstrap accounts for my Phoenix app so users can switch between multiple accounts with an account-scoped dashboard.