Setup MUFI

Backend

To integrate MUFI in your Cadmus API:

▶️ (1) add the Mufi.Api.Controllers NuGet package, plus MUFI.PgSql when using PostgreSQL (recommended for better performance).

▶️ (2) add to your API Program.cs in ConfigureAppServices or wherever you configure application services (configure options as preferred):

// MUFI (endpoints under api/mufi)
builder.Services.AddMufiServices(builder.Configuration);

Frontend

▶️ (1) add NPM package:

pnpm i @myrmidon/cadmus-refs-mufi-lookup

Usually this is enough if you are going to use MUFI only from within parts (like in Cadmus codicology parts). If instead you are going to use it inside a lookup providers set, you will typically add the provider to your application:

▶️ (2) add to app.ts the lookup provider configuration:

import { MufiRefLookupService } from '@myrmidon/cadmus-refs-mufi-lookup';

constructor(
    // ...
    const storage = inject(RamStorageService);
    const mufi = inject(MufiRefLookupService);
    storage.store(LOOKUP_CONFIGS_KEY, [
        // ...
        // MUFI
        {
          name: 'MUFI',
          iconUrl: '/img/mufi128.png',
          description: 'Medieval Unicode Font Initiative',
          label: 'ID',
          service: inject(MufiRefLookupService),
          itemIdGetter: (item: any) => item?.id,
          itemLabelGetter: (item: any) => mufi.getName(item),
        },
    ]);
)

▶️ (3) add to public/img the MUFI icon mufi128.png.