/apps, and all reusable code lives in /packages. Apps and packages can consume any sibling package directly without publishing to npm — the dependency is declared with workspace:* in package.json.
Naming convention
Every package name follows the pattern<PACKAGE_TYPE>-<SPECIAL_DEPENDENCY or USAGE>.
For example, components-pixi is a components package whose special dependency is pixi-svelte, and utils-sound is a utils package whose special dependency is howler.
*-shared packages are an exception: instead of a special dependency they are designed to have a minimum set of dependencies and a broad set of use cases so they can be imported almost everywhere.
Monorepo structure
Package groups
config-*
Reusable toolchain configurations shared across apps and packages.
config-lingui— lingui i18n configconfig-storybook— Storybook configconfig-svelte— Svelte compiler configconfig-ts— TypeScripttsconfigbaseconfig-vite— Vite config
pixi-*
Svelte 5 + PixiJS 8 integration layer.
pixi-svelte— declarative Svelte components wrapping PixiJS primitives; also published to npmpixi-svelte-storybook— Storybook forpixi-sveltecomponents
constants-*
Global compile-time constants with no runtime dependencies.
constants-shared— bet multipliers, z-index values, time helpers, color constants, particle configs
state-*
Global reactive Svelte
$state objects shared across packages.state-shared—stateBet,stateSound,stateUrl,stateModal,stateMeta,stateConfig,stateUi,stateI18n
utils-*
Utility functions and types organized by dependency or use case.
utils-book— book event processing (playBookEvents,playBookEvent)utils-event-emitter— type-safe event bus (createEventEmitter)utils-xstate— XState finite state machine for bet flowsutils-layout— responsive canvas layout systemutils-slots— reel and board spin mechanicsutils-sound— audio management via Howler.jsutils-fetcher— wrapper around the Fetch APIutils-shared— miscellaneous helpers (no lodash/lingui dependency)utils-resize-observer— ResizeObserver utilitiesutils-bet— bet-related types and helpers
components-*
Reusable Svelte components organized by rendering layer.
components-layout— layout components (depend onutils-layout)components-pixi— PixiJS game components (depend onpixi-svelte)components-shared— HTML-based shared componentscomponents-storybook— Storybook helper componentscomponents-ui-pixi— PixiJS UI components (bet button, balance, etc.)components-ui-html— HTML UI components (modals, version overlay, etc.)
rgs-*
Remote Game Server (RGS) communication layer.
rgs-fetcher— low-level HTTP fetch utilities for RGS endpointsrgs-requests— typed request functions (requestBet,requestEndRound, etc.)
Context-providing packages
Four packages create Svelte context that child components can read with agetContext*() call. setContext*() must be called at the app entry level (e.g. +page.svelte) before any child tries to consume it.
| Package | Creates | Context helpers |
|---|---|---|
pixi-svelte | stateApp | setContextApp / getContextApp |
utils-event-emitter | eventEmitter | setContextEventEmitter / getContextEventEmitter |
utils-layout | stateLayout, stateLayoutDerived | setContextLayout / getContextLayout |
utils-xstate | stateXstate, stateXstateDerived | setContextXstate / getContextXstate |
