@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 aModelDef 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
- Schema generation:
veloiq generatecreates{module}Schema.gen.tsfor each backend module, containingModelDefarrays that describe every model’s fields and relations. - Resource registration:
generateResources(models, moduleName)converts thoseModelDefarrays into Refine resource definitions with correct list/show/create/edit paths. - Routing: You map each resource path to the corresponding
DynamicList,DynamicShow,DynamicCreate, andDynamicEditcomponents in your React Router routes. - Auth:
authProviderhandles login againstPOST /auth/login, stores the JWT inlocalStorage, and redirects to/loginon 401.accessControlProviderreads cached role permissions to hide unauthorized UI elements.httpClientattaches 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.