Catalyzer
Architecture

Core Package

Business logic, pages, stores, hooks, providers, and configuration.

The business logic layer. Pages, Zustand stores, hooks, providers, navigation config, and smart components live here. This package depends on packages/ui for design system primitives and packages/i18n for translations.

Directory Structure

Components

The app shell. These three components compose together to form the sidebar dashboard layout used by both apps.

ComponentWhat it renders
app-layout.tsxFull layout wrapper (sidebar + header + content)
app-header.tsxTop bar with breadcrumbs and mobile trigger
app-sidebar.tsxSidebar that mounts all navigation groups

Pages

Full page components consumed by both apps. The app routes are thin wrappers around these.

PageRoute
HomePage.tsx/home
SettingsPage.tsx/settings
OverviewPage.tsx/dashboard/overview
AnalyticsPage.tsx/dashboard/analytics
ReportsPage.tsx/dashboard/reports

The /dashboard route itself redirects to /dashboard/overview. This is why both apps can share the same UI: the page logic lives here, not in the apps.

Hooks

HookWhat it does
use-app-hotkeys.tsRegisters application-wide keyboard shortcuts
use-drawer-history.tsManages drawer open/close state with browser history
use-mounted.tsReturns true after first client render
use-theme-transition.tsView Transition API wrapper for smooth theme switching
use-language-switcher.tsLocale change with theme re-application

Stores

Zustand stores with localStorage persistence where needed.

StoreState
sidebar-store.tsOpen/closed state, sidebar variant
theme-store.tsSelected color theme (data-theme attribute)
command-palette-store.tsCommand palette open/closed state
hotkeys-store.tsHotkeys dialog open/closed state
profile-drawer-store.tsProfile drawer open/closed state

Providers

ProviderWhat it does
theme-provider.tsxInjects the custom theme system (wraps next-themes)

Configuration

FileWhat it defines
hotkeys.tsKeyboard shortcut definitions and key bindings
navigation.tsSidebar navigation structure and routes
themes.tsTheme registry (40+ color schemes)
theme-init.tsScript injected into <head> to prevent flash of wrong theme

Utilities

FileWhat it provides
utils.tsfetchLatestGithubVersion() fetches latest release tag. formatHotkeyDisplay() platform-aware hotkey labels (⌘ on Mac, Ctrl elsewhere)
storage-utils.tsType-safe localStorage helpers for store persistence

Exports

Wildcard exports in package.json. No barrel files.

package.json (exports)
{
  "./components/*": "./src/components/*.tsx",
  "./pages/*": "./src/pages/*.tsx",
  "./pages/subpages/*": "./src/pages/subpages/*.tsx",
  "./hooks/*": "./src/hooks/*.ts",
  "./stores/*": "./src/stores/*.ts",
  "./config/*": "./src/config/*.ts",
  "./providers/*": "./src/providers/*.tsx",
  "./lib/*": "./src/lib/*.ts",
  "./scripts/*": "./src/scripts/*.ts"
}
// Usage
import { AppLayout } from "@workspace/core/components/layout/app-layout";
import { useThemeStore } from "@workspace/core/stores/theme-store";
import { HomePage } from "@workspace/core/pages/home-page";
import { ThemeProvider } from "@workspace/core/providers/theme-provider";

Direct path imports (no barrel index). Tree-shaking works out of the box and circular dependency issues are avoided.

Dependency Flow

core → ui  (design system primitives)
core → i18n (translations)

ui must never import from core. The dependency flow is strictly one-directional: core → ui. This prevents circular dependencies and keeps the design system independent.

On this page