Basic configuration
Now That Adomin is installed and ready, if not, start here , let’s add some basic configuration:
Add the following code, don’t forget to import User
(or any model that you want)
const USER_VIEW = createModelViewConfig ( () => User , {
email: { type: " string " , isEmail: true , label: " Super email " },
password: { type: " string " , isPassword: true , label: " Strong password " },
export const ADOMIN_CONFIG : AdominConfig = {
title: " Your backoffice title " ,
This will add a page in your adomin frontend.
If you did not setup adomin frontend yet, go here
Note
💡 Fields configurated inside the columns
field will be shown on the admin frontend, additionnaly the primary key field will be shown
(Adomin uses Lucid model primaryKey
field to know which is the primary key)
💡 To show the primary key on the frontend, Adomin applies a default config to your primary key field:
const PRIMARY_KEY_DEFAULT_CONFIG : AdominNumberFieldConfig = {
You can overwrite this config as you please, e.g. if the primary key is a string
Real world configuration
In a real application, your Back-office might have many pages with complex configurations, to learn what you can do with Adomin see the reference pages for models views