Checklist — add an entity
Create src/entities/<name>/ with the standard folder set (keep it identical for every entity): config/ data/ details/ filter/ overview/ selecting/ + index.ts + setup.ts.
Full entity (with list UI)
- Model —
data/Entity.ts:class X extends EntityBasewith fields,override get $id()(return this.id || "new") andoverride get $title(). Export the class,export const Entity = X, and a default. - Config —
config/config.ts: aconst config: IConfigwithkey,routePrefix,api, the*Urlfields,defaultPageSize,icon, titles, and anybaseQueryParams. - Service —
data/EntityService.ts:class EntityService extends EntityServiceBase<Entity>; ctorsuper(axios, config); implementtoEntity. OverrideprepareItem/ add endpoints if needed. - Store —
data/store.ts:defineStore(Entity.name, () => createStore<Entity>(get<IEntityService<Entity>>(Entity.name)!, Entity.name)). - Search object —
filter/SearchObject.ts:class EntitySearchObject extends SearchObjectBasewith filter fields. - Views — keep them thin;
(c)= customize per entity, the rest is boilerplate copied as-is.overview/:Overview.vue(useSearchView+useRouteOverview),List.vue(c),ListItem.vue(c).filter/:Filter.vue(shell,useFilter),FilterInline.vue,FilterAdv.vue(c).details/:Details.vue(useDetails),Form.vue(c) (useForm),FormModalButton.vue.selecting/:Selector.vue(boilerplate relation picker),SelectorList.vue(c). - Plugin —
setup.ts:createRoutes()(Overview + Details with Fiche/Form children),addServices(sp),addIcons(icons), and a defaultinstall(app, { routes })that pushes routes, registers services/icons, and setsapp.config.globalProperties.$configs[Entity.name] = config. - Barrel —
index.ts: re-exportconfig,Entity, and the plugin. - Register — add the plugin to the
pluginsarray insrc/entities/index.ts(order matters where one entity's selector is used by another).
Lookup entity (no list UI)
Omit step 6's views and createRoutes(). The install only calls addServices, addIcons, and sets $configs[Entity.name]. SearchObject can be empty (extends SearchObjectBase {}). For small static lists, extend JSONService instead of EntityServiceBase.
App-level setup (once per app)
- Plugins & bootstrap —
main.ts/App.vue, install order, and the required-vs-optional plugin set. - App-shell scaffold — the concrete tooling, router split,
components/,infrastructure/, and views that surround the slices — see the public sample app Regira-PIM-Admin. - No authentication — omit
authPlugin, advanceAppStatustoReadyyourself, drop the auth UI. - Types from OpenAPI — generate DTO types and feed them into the models.
Verify
- Service resolves:
get<IEntityService<Entity>>(Entity.name)is defined (notundefined) after startup. - Overview lists and pages; archived rows hidden unless
searchObject.archivedis set. - Save round-trips: new item (
$id === "new") inserts; existing updates; bind results tosaved. - Routes resolve:
${key}Overview,${key}Details→${key}Form/${key}Fiche. - Smoke-test at runtime: after
npm run build, run the app against the live API and load one view per entity — a green build alone does not exercise the wiring.