Skip to content
ARDOR 0.4.8-8 · MIT · Bun 1.4+ · React

Shape your admin panels.ARDOR tempers the surface.

Admin consoles on react-admin, with the same dependency injection and filter language as IGNIS, plus sign-in and i18n.

Create an admin
$bun x @venizia/vulcan init --preset ardor --project demo --frontend-dir apps --app admin
$cd demo && make dev
import {
  type BaseArdorApplication as TArdorApplication,
  configuration,
  CoreBindings,
  DefaultRestDataProvider,
  inject,
  provide,
  RuntimeConfig,
} from '@venizia/ardor';

@configuration()
export class AdminConfiguration {
  constructor(
    @inject({ key: CoreBindings.APPLICATION_INSTANCE })
    private readonly application: TArdorApplication,
  ) {}

  @provide({ key: CoreBindings.REST_DATA_PROVIDER_OPTIONS })
  restDataProviderOptions() {
    const url = RuntimeConfig.get({
      key: 'VITE_API_URL',
      buildTimeEnv: import.meta.env,
      defaultValue: '/api',
    });

    return { url, noAuthPathRegex: /./ };
  }

  @provide({ key: CoreBindings.DEFAULT_REST_DATA_PROVIDER })
  restDataProvider() {
    return this.application.instantiate(DefaultRestDataProvider).value(this.application);
  }
}
import 'reflect-metadata';

import { configureStore } from '@reduxjs/toolkit';
import { ArdorApplication } from '@venizia/ardor';
import { createRoot } from 'react-dom/client';

import { Application } from '#src/application';
import { Home } from '#src/pages/home';

const application = new Application();
const store = configureStore({
  reducer: { app: (state: { ready: boolean } = { ready: true }) => state },
});

await application.start();

createRoot(document.getElementById('root')!).render(
  <ArdorApplication
    container={application}
    reduxStore={store}
    suspense={<p>Loading</p>}
    dashboard={Home}
  />,
);
$bun x @venizia/vulcan init --preset ardor --project demo --frontend-dir apps --app admin
$cd demo && make dev
the admin is on http://localhost:5173/
$

src/configurations/admin.configuration.ts: The configuration the preset writes into a new admin, with the i18n bindings left out. Configuration

src/main.tsx: The mount point of the same preset, without its stylesheet import. Application

The commands of Create a project.

4packages
3examples
74test files
0Node builtins in the browser packages

Counted from the repository (0.4.8-8): the packages and examples folders, every *.test.ts and *.test.tsx file in them, and the imports of Node builtins in the kernel, react and admin sources. A test fails when a number drifts.

Is it for you?

Honest about the fit.

Use ARDOR when

  • An enterprise admin panel that needs a clean IoC architecture
  • An application that pairs react-admin with an IGNIS backend
  • A team that wants DI in React through useInjectable
  • A typed REST data provider, token refresh and i18n

Look elsewhere when

  • A lightweight landing page with no admin state
  • An application that is not built on React
  • An app with no service orchestration or DI requirement
  • A project that needs a 1.0 API: ARDOR is 0.x and a patch release can carry a breaking change

ARDOR is 0.x: a patch release can carry a breaking change. Pin exact versions and read the changelog before upgrading. It ships no socket client: use the IGNIS one.