Skip to content

Shared Package

Shared constants, helper utilities, hooks, types, locale files, and utility functions used by both web and mobile apps.

ModuleWhatLOC
Hooks6 React hooks — timer engine, dashboard stats, work tree, selection, appointment status, i18n~1,230
HelpersBusiness logic — work tree CRUD, finance processing, pomodoro phases, timer rounding~1,850
ConstantsShared values — colors, currencies, locales, UI dimensions, appointment defaults~200
Localesi18n translations in en/ and de/ across 5 namespaces (auth, common, docs, landing, legal)
TypesShared TypeScript types (e.g., TimeTrackerEngine types)
Export PathWhat
@life-manager/shared/constantsAll constants barrel
@life-manager/shared/constants/*Individual constant files
@life-manager/shared/helperAll helpers barrel
@life-manager/shared/helper/*Individual helper modules
@life-manager/shared/hooksAll hooks barrel
@life-manager/shared/hooks/*Individual hooks
@life-manager/shared/typesShared types
@life-manager/shared/utilsUtility functions
src/
constants/ # Shared constant values
appointment.ts # Appointment status options, defaults
colors.ts # Mantine color palette, module color options
settings.ts # Currency, locale, rounding options, app defaults
ui.ts # UI dimension constants, layout breakpoints
helper/ # Feature-grouped utility functions
workHelper/
workHelperFunctions.ts # Work-related calculations, formatting
treeHelperFunctions.ts # Project tree manipulation
timeEntryHelperFunctions.ts # Time entry formatting, calculations
timeTrackerFunctions.ts # Timer rounding, session time calculations
getTimeFragmentSession.ts # Time fragment session logic
resolveTimeEntryOverlaps.ts # Overlap detection and resolution
financeHelper/
financeHelperFunction.ts # Finance calculations, formatting
processRecurringCashflows.ts # Recurring cashflow processing logic
pomodoroHelper/
pomodoroFunctions.ts # Phase duration, transitions, state reconstruction
pomodoroStyles.ts # Phase colors, icons, border styles
appointmentHelper/
appointmentFormHelper.ts # Appointment form defaults, validation
appointmentTimerHelpers.ts # Appointment timer calculation utilities
hooks/ # Shared React hooks
useIntl.ts # Internationalization (formatMoney, formatDate, locale)
use-time-tracker-engine.ts # Shared timer engine logic
locales/ # i18n translation files
en/ # auth, common, docs, landing, legal
de/ # auth, common, docs, landing, legal
types/ # Shared type definitions
time-tracker-engine.types.ts
utils/ # Utility functions
intl.ts # Internationalization utilities
  • Constants: Always import from @life-manager/shared/constants/* (never duplicate in app code)
  • Helpers: Business logic shared between web and mobile lives here, not in app-specific src/lib/
  • useIntl hook: Used in protected routes for formatting. Public routes use useTranslation() from i18next
  • Locales: Five namespaces (auth, common, docs, landing, legal) in two languages (en, de)
  1. Constants: Add to existing file in constants/ or create new file, re-export from constants/index.ts
  2. Helpers: Create in appropriate feature folder under helper/, re-export from helper/index.ts
  3. Hooks: Add to hooks/, re-export from hooks/index.ts
  4. Types: Add to types/, re-export from types/index.ts
  5. Translations: Add keys to both en/ and de/ locale files in matching namespace