Skip to content

Installation

Backend setup

There is two way of installing the Adomin files:

  • automatic install through an npx script
  • manual install

Automatic install

Run the following command at the root of your adonis backend folder, it will:

  • copy adomin files into ./app/adomin
  • modify imports inside ./package.json
  • modify paths inside ./tsconfig.json
  • import adomin_router inside ./start/routes.ts
Terminal window
npx @galadrim/adomin@latest

After running the command, continue here

Manual install

To install Adomin, you will need to copy the folder ./app/adomin into your backend code, to do so, git clone this project and copy the ./app/adomin into your project

Adomin use imports starting with #adomin so you will have to configure this:

  • edit package.json and add
"#adomin/*": "./app/adomin/*.js"

inside the "imports" object

  • edit tsconfig.json and add
"#adomin/*": ["./app/adomin/*.js"]

inside the "paths" object

  • edit start/routes.ts : add this import statement to enable all of Adomin routes
import '#adomin/routes/adomin_router'

Backend deps

Adomin needs the following npm packages:

  • xlsx needed for excel export
  • @adonisjs/validator adomin uses the adonis v5 way of dealing with validation, I plan to use vine later but in the meantime you will need it
Terminal window
yarn add xlsx @adonisjs/validator

Backend routes

You should check the content of app/adomin/routes/adomin_router.ts this is where all the backend routes of Adomin are defined. By default only the middleware.auth() is used.

I recommend that you can change this to restrict route access to only admins of your app.

Frontend installation

To setup the adomin frontend you need to follow these steps:

  • clone the frontend code
Terminal window
git clone https://github.com/galadrimteam/adomin-frontend.git
  • install dependencies
Terminal window
cd adomin-frontend && yarn
  • check that the VITE_API_URL is set to your backend URL

  • start the vite server

Terminal window
yarn dev


Adomin is now installed and ready.

To add some configuration, go this way