Run the DMS inside AdonisJS
Start the DMS and its dashboard from an AdonisJS application, add DMS modules in code, and know what embedded mode leaves out.
The template-dms-adonis template runs the DMS as a guest of an AdonisJS application. Pick it when you already have, or want, an AdonisJS app that owns the HTTP server, signals, logger and configuration. For a new application without that constraint, start from the starter template in Quickstart. It supports hot reload for the dashboard and every ajs command.
Standalone and embedded modes
In standalone mode the ajs CLI owns the process and reads the modules from antelope.config.ts, as in template-dms-demo. In embedded mode your application owns the process and starts the runtime with createRuntime() from @antelopejs/core, with the modules listed in code. The Embedded runtime concept page compares the two.
In the template, providers/antelope_provider.ts creates the runtime in register(), starts it in start() and stops it in shutdown(), so the DMS follows the AdonisJS lifecycle.
Start the backend and dashboard
You need the Node.js release in the template's .nvmrc, pnpm, and a MongoDB server on mongodb://localhost:27017 (MONGODB_URL in .env).
npx @antelopejs/core project init my-app --template dms-adonis
cd my-app
cp .env.example .env
node ace generate:key
Start AdonisJS and the embedded DMS:
pnpm dev
AdonisJS listens on http://localhost:3333 and the DMS API on http://localhost:5010. While the backend runs, build and start the dashboard in a second terminal:
pnpm frontend:build
pnpm frontend:start
Open the address that the backend logs after No owner exists yet, such as http://localhost:3001/onboarding?token=…. On a fresh database, the first-run wizard creates your administrator account with the setup token in that address. After that, the dashboard shows the sign-in page.
The .env file holds the secrets that the two processes share. DMS_BOOTSTRAP_SECRET is the DMS frontend.bootstrapSecret, which the dashboard presents to the backend. DMS_SESSION_SECRET, at least 32 characters long, signs the dashboard sessions. DMS_COOKIE_SECURE=false lets the session cookie work over plain http locally. Remove it behind TLS. Replace every development secret before you deploy. Frontend CLI covers ajs dms build, ajs dms start and their variables.
Add a DMS module
In embedded mode the provider's code is the module list, so ajs project modules add does not apply. To add a module such as @antelopejs/dms-lang:
Install the package
pnpm add @antelopejs/dms-lang
The runtime loads modules from the application's node_modules (or a local path), not from the ~/.antelopejs cache.
List it in the provider
Add an entry to the modules map of providers/antelope_provider.ts, with its configuration under config:
this.runtime = createRuntime({
projectFolder: this.app.makePath(),
modules: {
'@antelopejs/dms': { config: { /* ... */ } },
'@antelopejs/dms-lang': {},
// ...
},
uses: ['@antelopejs/interface-dms'],
})
Restart and rebuild the dashboard
Restart pnpm dev, then run pnpm frontend:build and pnpm frontend:start again: the build bundles the frontend modules the backend serves, so a module added or removed after the last build does not show until you rebuild.
Application code reaches the DMS through runtime.use(), never by importing an @antelopejs/interface-* package directly. The template's GET /dms/info route in start/routes.ts shows the pattern.
Limitations
Embedded mode trades the ajs tooling for control over the process. The Embedded runtime guide details each point:
- No
ajs dms dev. The embedded runtime forcesdev: false, so the DMS does not publish the layer source paths the dashboard's hot-reload server needs. Build and start the dashboard instead, and rebuild after a module change. - A separate API port.
@antelopejs/apilistens on its own port (DMS_API_PORT,5010by default), not inside the AdonisJS HTTP server, and needspublicBaseUrlset to the origin browsers reach it at. - No module hot reload. With
dev: false, DMS modules load once per runtime start: restartpnpm devafter changing the module list or a module's configuration. - No
ajs projectcommands,envOverridesorenvironments: configure modules in the provider, from AdonisJS'senv.
Tested setup
The template is tested with the @adonisjs/core release that it pins in its package.json. The @antelopejs/* ranges @antelopejs/dms supports are in the compatibility block of its README.
AdonisJS is the only tested host. Other Node.js hosts (Express, Fastify, NestJS) follow the same principle, described in the framework guide.