Skip to main content
@veloiq/ui is the React component library for VeloIQ frontend applications. It is built on top of Refine and Ant Design and provides everything you need to wire up a fully functional admin UI: schema-driven CRUD pages that render from ModelDef definitions without hand-written component code, layout components, JWT authentication providers, and role-based access control.

Installation

@veloiq/ui declares its Refine and Ant Design dependencies as peer dependencies. Install them alongside the package:

Core components


DynamicResource

The DynamicResource components render complete CRUD pages from a ModelDef schema object. You do not write component code for each resource — the schema drives field rendering, relation display, form validation, and access control. See DynamicResource for the full schema reference.

Types


Providers

See Auth Providers for wiring instructions.

Utilities

generateResources(models, moduleName, options?)

Converts a ModelDef[] array into Refine ResourceDef[] definitions. Each module’s models are grouped under a shared parent resource so Refine renders a clean module label in the sidebar. Relation-only models (those whose name ends in _relation or _rela, or that have eid_from/eid_to fields) are hidden from the sidebar by default.

authSystemModels

A static ModelDef[] array with built-in definitions for the User, Role, and Tenant CRUD pages that correspond to the VeloIQ auth tables (veloiq_user, veloiq_role, veloiq_tenant). Pass these directly to generateResources to include an access-control section in your sidebar.

How it fits together

  1. Schema generation: veloiq generate creates {module}Schema.gen.ts for each backend module, containing ModelDef arrays that describe every model’s fields and relations.
  2. Resource registration: generateResources(models, moduleName) converts those ModelDef arrays into Refine resource definitions with correct list/show/create/edit paths.
  3. Routing: You map each resource path to the corresponding DynamicList, DynamicShow, DynamicCreate, and DynamicEdit components in your React Router routes.
  4. Auth: authProvider handles login against POST /auth/login, stores the JWT in localStorage, and redirects to /login on 401. accessControlProvider reads cached role permissions to hide unauthorized UI elements. httpClient attaches the token to every API call.

DynamicResource

Schema-driven CRUD page components and the ModelDef type reference.

Auth Providers

Wire up authProvider, accessControlProvider, and httpClient in App.tsx.