Skip to content

Repository files navigation

@coderic/dashboard-shell

PatternFly 6 dashboard shell: masthead, sidebar, Auth0 provider, protected routes, React Query bootstrap.

Generic text brand only (BrandMark). No proprietary logos or default tenant labels.

Install

npm install @coderic/dashboard-shell @coderic/dashboard-core @coderic/acl

Peers (install in app): React 19, React Router 7, PatternFly 6, @auth0/auth0-spa-js, @tanstack/react-query.

@coderic:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}

Repo: https://github.com/Coderic/coderic-dashboard-shell

Styles: import "@coderic/dashboard-shell/styles";

Exports

SymbolPurpose
DashboardRootQueryClient + DashboardAuthProvider wrapper (requires claimsConfig)
DashboardAuthProviderAuth0 SPA + ACL context
AppShellPatternFly Page layout with sidebar
ProtectedRouteRedirect unauthenticated users
RouterLinkButtonPF button as React Router link
BrandMarkText masthead brand (title, optional subtitle)
useAuth, useAccessTokenAuth hooks

CSS classes use prefix dsh-* (not vendor-specific).

Vite (required in consuming apps)

Prebuilt @coderic/* dist must share one React instance with the app:

importpathfrom"node:path";import{fileURLToPath}from"node:url";constappDir=path.dirname(fileURLToPath(import.meta.url));exportdefaultdefineConfig({resolve: {dedupe: ["react","react-dom","react-router","react-router-dom","@tanstack/react-query"],alias: {react: path.join(appDir,"node_modules/react"),"react-dom": path.join(appDir,"node_modules/react-dom"),},},});

Without this, runtime fails with Cannot read properties of null (reading 'useEffect').

Usage

import{DashboardRoot,AppShell,ProtectedRoute}from"@coderic/dashboard-shell";import"@coderic/dashboard-shell/styles";import{env}from"./config/env";import{claimsConfig}from"./config/claims";import{dashboardRegistry}from"./auth/registry";createRoot(document.getElementById("root")!).render(<DashboardRootenv={env}registry={dashboardRegistry}claimsConfig={claimsConfig}isAdminUser={(user)=>user?.email?.endsWith("@example.com")}><BrowserRouterbasename="/dashboard"><Routes><Routeelement={<ProtectedRoute><AppShell/></ProtectedRoute>}></Route></Routes></BrowserRouter></DashboardRoot>,);

AppShell props

<AppShellbrand={dashboardBrand}dashboardLink={{label: "Home",route: "/"}}navSections={[]}showBilling={false}/>

Removed (do not use):CodericAuthProvider, MasterBrand, portalLabel.

Coderic portal mapping

PortalbrandSubtitleauth0ClientGroup
coderic.cloudCLOUDcorporate
coderic.storeSTOREcorporate
coderic.comBUSINESScorporate
coderic.financialFINANCIALcorporate
coderic.devDEVELOPMENTfoundation
coderic.orgORGANIZATIONfoundation
coderic.netNETWORKfoundation
coderic.ioHUBfoundation

Always set brandTitle="CODERIC" in Coderic portals.

License

MIT

About

@coderic/dashboard-shell library (MIT)

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages