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
importsinside./package.json - modify
pathsinside./tsconfig.json - import
adomin_routerinside./start/routes.ts
npx @galadrim/adomin@latestAfter 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.jsonand add
"#adomin/*": "./app/adomin/*.js"inside the "imports" object
- edit
tsconfig.jsonand 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:
xlsxneeded for excel export
yarn add xlsxBackend 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
git clone https://github.com/galadrimteam/adomin-frontend.git- install dependencies
cd adomin-frontend && yarn-
check that the
VITE_API_URLis set to your backend URL -
start the
viteserver
yarn devAdomin is now installed and ready.
To add some configuration, go this way