Skip to content
AntFabric Corev1.0.0local

Clients

Four apps people use, built from shared libraries, each loading the screens of the plugins its instance selects.

App Built with Plugin screens from Notes
User app React + Vite plugins/<name>/web The organisation’s navigation (rail, sidebar or top bar) and the plugin’s area
Desktop app Tauri plugins/<name>/desktop, else web Wraps the user app; native notifications, tray, files
Phone app Expo (React Native) plugins/<name>/mobile Expo Router; Expo push
App Admin React + Vite plugins/<name>/admin Administrators only (admin-app:access)
Library Gives screens
@antfabric/sdk-web api (typed calls, token refresh, retries), useAuth, events (live updates), usePeople, usePresence, useNavigation, definePluginSurface; /client is the subset the phone uses
@antfabric/app-shell The shell: navigation rail, layouts, badges on navigation entries, profile, device notifications, the presence reporter
@antfabric/ui-kit Components and design tokens for web; /native for the phone

App code never touches tokens. api attaches the access token, refreshes it once when it expires (one refresh at a time across tabs, using Web Locks) and signs out every tab when the session ends.

Codegen writes each app’s plugins.generated.ts from the instance file. Each entry is the plugin’s id, its navigation entries, its declared routes and its screen module. The shell mounts each plugin under /<plugin short name>/…:

plugins/sales/web/index.tsx
export default definePluginSurface({
routes: [
{ path: '', title: 'Sales', layout: 'workspace', component: SalesApp },
{
path: 'leads/:leadId',
title: 'Lead',
layout: 'workspace',
component: LeadPage,
},
],
badges: [{ nav: 'sales.home', useCount: useDueFollowUps }],
});

Screens never build URLs to other screens. A plugin declares routes in plugin.yaml (navigation.routes: id, path, parameters, permissions, targets) and opens them by id:

navigation.open({
pluginId: 'af.chat',
routeId: 'conversation',
params: { conversationId },
});

The same id works on web, desktop and phone, in notifications (a tap opens the route), and between plugins (Sales opens Chat’s conversation without knowing Chat’s paths).

  • Phone: each plugin brings React Native screens; logic is shared with the web screens through the plugin’s shared/ folder. Push notifications through Expo (needs an EAS project id).
  • Desktop: the same screens as the user app inside Tauri; native notifications come through the desktop shell; the API allows the desktop client’s version header.
  • Browser push: Web Push with VAPID keys kept in the instance’s secret store, enabled per browser by the person.