Installation
Installation is how an existing AdonisJS application gains a panel. You are not creating a second app, and you are not choosing a front-end framework. A service provider boots with the rest of Adonis, reads config/shamar.ts, and starts serving HTML at a path you choose, usually /admin.
Before the commands below, it helps to know the three decisions the installer is walking you through:
- The host.
@shamar/adonisis the package that registers routes and views. Introduction explains why that package is separate from the resource language. - The database. The panel does not ship with a database. It uses one you already have.
orm: 'lucid'means SQL through Lucid.orm: 'mongoose'means MongoDB. Choosing Mongoose also installsmongoose, setsMONGO_URI, and registers a provider that connects before the panel boots. Using MongoDB is that path. The longer explanation, including session login, is MongoDB. - Sign-in. The published login page is a screen. The user model and session guard stay yours. You can finish installation and still see a login form that has nowhere to put a real user until auth is wired. That is expected, and Auth & RBAC is the next page for it.
The rest of this page is the commands and the smallest config that makes /admin exist.
Shamar plugs into AdonisJS as a service provider. Pick an ORM adapter, configure a panel, and open /admin.
Install packages
Section titled “Install packages”pnpm add @shamar/adonis# plus one of:pnpm add @adonisjs/lucid # SQL# orpnpm add mongoose # MongoDBOptional companions:
pnpm add @shamar/cherubim # RBAC + API credentialspnpm add @shamar/rest # OpenAPI + Scalar UIConfigure
Section titled “Configure”node ace configure @shamar/adonisThe codemod registers the provider, stubs config/shamar.ts, and asks Lucid vs Mongoose.
@shamar/adonis depends on @shamar/wire. The panel uses it, and a plain Adonis app can register it without a panel. See Wire. New versions of both packages are published by the publish.yml GitHub Actions workflow. npm trusts that workflow as the publisher for @shamar/wire.
Minimal panel
Section titled “Minimal panel”node ace configure @shamar/adonis writes config/shamar.ts for the database, auth, and branding, and app/panels/admin/panel.ts for the panel itself. Add another panel with node ace make:panel billing.
import { PanelProvider, panel } from '@shamar/adonis'
export default class AdminPanel extends PanelProvider { panel() { return panel('admin') .path('/admin') .branding({ name: 'Admin', primaryColor: '#f1511b' }) .discoverResources('app/panels/admin/resources') .discoverPages('app/panels/admin/pages') }}Boot the app and visit /admin (after your auth middleware allows it).
- Your first resource
- Live demo — try a seeded sandbox without installing
- Packages — what each
@shamar/*package owns, including MongoDB