@lego-box/shell
v1.0.24
Published
Piral microfrontend shell for Lego Box - provides authentication, PocketBase integration, RBAC, and shared UI components
Maintainers
Readme
@lego-box/shell
Piral microfrontend shell providing authentication, PocketBase integration, RBAC, and shared UI components for the Lego Box ecosystem.
Installation
npm install @lego-box/shell
# or
pnpm add @lego-box/shellUsage
Creating a Pilet
pilet new @lego-box/shell --target my-pilet
cd my-pilet
pnpm install
pnpm startPilet Development
import type { PiletApi } from '@lego-box/shell/pilet';
export function setup(app: PiletApi) {
// Access authentication
const user = app.auth.getUser();
// Access PocketBase
const records = await app.pocketbase.collection('items').getList();
// Register protected pages
app.registerProtectedPage('/my-route', MyPage, {
action: 'read',
subject: 'items'
});
// Register sidebar menu
app.registerSidebarMenu({
id: 'my-menu',
label: 'My Feature',
href: '/my-route',
action: 'read',
subject: 'items'
});
}Shared Dependencies
The shell provides these dependencies to all pilets:
@lego-box/ui-kit- Reusable UI componentspocketbase- Backend SDKpiral-auth- Authentication pluginreact&react-dom- UI framework
API Reference
See full documentation for complete API reference.
License
MIT
