Skip to content
Shamar

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:

  1. The host. @shamar/adonis is the package that registers routes and views. Introduction explains why that package is separate from the resource language.
  2. 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 installs mongoose, sets MONGO_URI, and registers a provider that connects before the panel boots. Using MongoDB is that path. The longer explanation, including session login, is MongoDB.
  3. 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.

Branded login — configure logos, colors, and Google Fonts in `config/shamar.ts`. Try it on the [live demo](/docs/guides/live-demo/).
Terminal window
pnpm add @shamar/adonis
# plus one of:
pnpm add @adonisjs/lucid # SQL
# or
pnpm add mongoose # MongoDB

Optional companions:

Terminal window
pnpm add @shamar/cherubim # RBAC + API credentials
pnpm add @shamar/rest # OpenAPI + Scalar UI
Terminal window
node ace configure @shamar/adonis

The 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.

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.

app/panels/admin/panel.ts
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).

After auth, your panel gets a dashboard, sidebar navigation, and resource routes — same shell as the playground demo.