Skip to content

Entity System Packages

The Entity System is a small family of focused packages, not one monolithic library. Each package owns a single concern, and you pick the combination that matches how you intend to build.

Authenticate with pub.vyuh.tech first

Every Entity System package is hosted on the private pub.vyuh.tech registry. Before running pub get, register a Bearer token issued by Vyuh Technologies based on your plan.

Run the one-time setup:

dart pub token add https://pub.vyuh.tech

Don't have a token yet? Email ask@vyuh.tech to request one. For full details (CI, Docker, rotation, troubleshooting), see the Pub Token Setup guide.

Core packages

These four packages form the entity system itself.

Packages

Package Version Role
vyuh_entity_annotations3.3.0Pure-Dart `@Entity` / `@Field` / `@ServerEntity` annotations, field companions, UI layout declarations, and the `Authorize` DSL — no Flutter, no `source_gen`, no analyzer. Safe to import from client, server, and shared model packages.
vyuh_entity_generator3.3.0`build_runner` code generator that reads the annotations and emits `*.entity.dart` and `*.server.dart` part files: base classes, field definitions, API/config wiring, default table/kanban/detail/form layouts, workspace config, and server route modules.
vyuh_entity_system5.1.0The core runtime — entity models (`EntityBase` + `Auditable` / `Versionable` / `Draftable` mixins), API layer (`HttpEntityApi<T>`, caching, mutations), configuration descriptors, services, drafts/versioning, and the `EntitySystemPlugin`.
vyuh_entity_system_ui6.1.0Flutter widgets, layouts (`EntityTableConfig`, `EntityGridConfig`, kanban, detail tabs, dashboard, analytics), editors, route builders, workspaces, authorization guards, import/export UI, and command-palette wiring.
  • vyuh_entity_annotations3.3.0

    Pure-Dart `@Entity` / `@Field` / `@ServerEntity` annotations, field companions, UI layout declarations, and the `Authorize` DSL — no Flutter, no `source_gen`, no analyzer. Safe to import from client, server, and shared model packages.

  • vyuh_entity_generator3.3.0

    `build_runner` code generator that reads the annotations and emits `*.entity.dart` and `*.server.dart` part files: base classes, field definitions, API/config wiring, default table/kanban/detail/form layouts, workspace config, and server route modules.

  • vyuh_entity_system5.1.0

    The core runtime — entity models (`EntityBase` + `Auditable` / `Versionable` / `Draftable` mixins), API layer (`HttpEntityApi<T>`, caching, mutations), configuration descriptors, services, drafts/versioning, and the `EntitySystemPlugin`.

  • vyuh_entity_system_ui6.1.0

    Flutter widgets, layouts (`EntityTableConfig`, `EntityGridConfig`, kanban, detail tabs, dashboard, analytics), editors, route builders, workspaces, authorization guards, import/export UI, and command-palette wiring.

Supporting packages

These travel with the entity system but are useful on their own. The runtime and UI packages depend on most of them transitively, so you usually do not need to add them to your own pubspec.yaml — list one only when you want to import its public API directly.

Packages

Package Version Role
vyuh_entity_api_memory4.0.0Drop-in `EntityApi<T>` implementation backed by an in-memory store. Use it in samples, widget tests, storybooks, and any context where you do not want to run a real server.
vyuh_entity_crud_types0.2.2Pure-Dart wire contracts for draft metadata, draft status, workflow operations, and CRUD-side payload vocabulary shared by the server plugin and `vyuh_entity_system`.
vyuh_ems_cli3.0.0The `vyuh_ems` CLI for scaffolding entity-management Flutter apps from templates. Run `dart pub global activate vyuh_ems_cli` and then `vyuh_ems create my_app`.
vyuh_property_system1.4.0Type-safe property descriptors used by `FieldDefinition` and the form/editor stack to validate, render, and edit entity fields.
vyuh_form_editor1.8.0Drag-and-drop form editor used to build entity edit/create forms visually. Consumed by `vyuh_entity_system_ui` form parts.
cdx_query1.9.0UI-agnostic filter models, operators, and presets. Used by `getMany(filters: …)` and by the entity table filter UI.
  • vyuh_entity_api_memory4.0.0

    Drop-in `EntityApi<T>` implementation backed by an in-memory store. Use it in samples, widget tests, storybooks, and any context where you do not want to run a real server.

  • vyuh_entity_crud_types0.2.2

    Pure-Dart wire contracts for draft metadata, draft status, workflow operations, and CRUD-side payload vocabulary shared by the server plugin and `vyuh_entity_system`.

  • vyuh_ems_cli3.0.0

    The `vyuh_ems` CLI for scaffolding entity-management Flutter apps from templates. Run `dart pub global activate vyuh_ems_cli` and then `vyuh_ems create my_app`.

  • vyuh_property_system1.4.0

    Type-safe property descriptors used by `FieldDefinition` and the form/editor stack to validate, render, and edit entity fields.

  • vyuh_form_editor1.8.0

    Drag-and-drop form editor used to build entity edit/create forms visually. Consumed by `vyuh_entity_system_ui` form parts.

  • cdx_query1.9.0

    UI-agnostic filter models, operators, and presets. Used by `getMany(filters: …)` and by the entity table filter UI.

How they fit together

Entity system package stackThe UI package depends on the entity system package, which depends on annotations. The generator sits alongside the stack, with side packages consumed transitively or by tests and tools.vyuh_entity_system_uiFlutter widgets, routes, workspacesdepends onvyuh_entity_systemModels, API, config, services, plugindepends onvyuh_entity_annotationsPure-Dart annotations + Authorize DSLvyuh_entity_generatorbuild_runner builder, dev-dep onlyemits *.entity.dart and *.server.dartreadsSide packagesConsumed transitively, or directly by tests and toolsvyuh_property_system • vyuh_form_editor • cdx_queryvyuh_entity_crud_types • vyuh_entity_api_memory • vyuh_ems_cli

Key constraints:

  • vyuh_entity_annotations has no Flutter and no source_gen. You can share annotated models between a Flutter app and a Dart server.
  • vyuh_entity_generator is a dev-time dependency only — it runs under build_runner and never ships in your app binary.
  • vyuh_entity_system is the application runtime floor: if you write your own UI layer (no vyuh_entity_system_ui), this is the minimum you need.
  • vyuh_entity_system_ui re-exports vyuh_entity_system, so a single import 'package:vyuh_entity_system_ui/vyuh_entity_system_ui.dart'; covers both the runtime and the widgets in app code.

Pick the combination that matches your build

Full Flutter app with generator-driven models

The most common setup — annotate models, generate code, use the default UI:

yaml
dependencies:
  vyuh_entity_system:
    hosted: https://pub.vyuh.tech
    version: ^5.1.0
  vyuh_entity_system_ui:
    hosted: https://pub.vyuh.tech
    version: ^6.1.0
  vyuh_entity_annotations:
    hosted: https://pub.vyuh.tech
    version: ^3.3.0

dev_dependencies:
  vyuh_entity_generator:
    hosted: https://pub.vyuh.tech
    version: ^3.3.0
  build_runner: ^2.8.0
  json_serializable: ^6.7.1

Then write @Entity(...) / @Field(...) on your model class and run dart run build_runner build --delete-conflicting-outputs.

Full Flutter app without code generation

If you prefer to hand-write every FieldDefinition, EntityApi, and EntityConfiguration, you can drop the generator and the annotations:

yaml
dependencies:
  vyuh_entity_system:
    hosted: https://pub.vyuh.tech
    version: ^5.1.0
  vyuh_entity_system_ui:
    hosted: https://pub.vyuh.tech
    version: ^6.1.0

You lose the automatic boilerplate, but everything the generator would have produced is also a public API you can call directly.

Shared annotated models (Flutter + Dart server)

When a Dart server package wants to share @Entity-annotated models with a Flutter client:

yaml
# In the shared model package
dependencies:
  vyuh_entity_annotations:
    hosted: https://pub.vyuh.tech
    version: ^3.3.0

This pulls in no Flutter, so the same package can be a dependency of a dart:io server and a Flutter app simultaneously.

Runtime only (custom UI)

Some teams want to reuse the entity runtime (API, authorization, drafts, versioning) but build their own UI layer. That is a one-package setup:

yaml
dependencies:
  vyuh_entity_system:
    hosted: https://pub.vyuh.tech
    version: ^5.1.0

Tests, storybooks, and samples

Pair the runtime with vyuh_entity_api_memory and skip the network entirely:

yaml
dev_dependencies:
  vyuh_entity_api_memory:
    hosted: https://pub.vyuh.tech
    version: ^4.0.0

Pass the in-memory api into your EntityConfiguration<T> instead of HttpEntityApi<T>.

See also