@almadar/orb 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/README.md +83 -0
  2. package/bin/orb +101 -0
  3. package/package.json +58 -0
  4. package/scripts/postinstall.js +51 -0
  5. package/shells/almadar-shell/LICENSE +72 -0
  6. package/shells/almadar-shell/README.md +25 -0
  7. package/shells/almadar-shell/locales/en.json +120 -0
  8. package/shells/almadar-shell/package.json +35 -0
  9. package/shells/almadar-shell/packages/client/eslint.config.cjs +23 -0
  10. package/shells/almadar-shell/packages/client/index.html +13 -0
  11. package/shells/almadar-shell/packages/client/package.json +61 -0
  12. package/shells/almadar-shell/packages/client/postcss.config.js +6 -0
  13. package/shells/almadar-shell/packages/client/src/App.tsx +81 -0
  14. package/shells/almadar-shell/packages/client/src/config/firebase.ts +37 -0
  15. package/shells/almadar-shell/packages/client/src/features/auth/AuthContext.tsx +139 -0
  16. package/shells/almadar-shell/packages/client/src/features/auth/authService.ts +83 -0
  17. package/shells/almadar-shell/packages/client/src/features/auth/components/Login.tsx +218 -0
  18. package/shells/almadar-shell/packages/client/src/features/auth/components/ProtectedRoute.tsx +27 -0
  19. package/shells/almadar-shell/packages/client/src/features/auth/components/UserProfile.tsx +68 -0
  20. package/shells/almadar-shell/packages/client/src/features/auth/components/index.ts +3 -0
  21. package/shells/almadar-shell/packages/client/src/features/auth/index.ts +13 -0
  22. package/shells/almadar-shell/packages/client/src/features/auth/types.ts +24 -0
  23. package/shells/almadar-shell/packages/client/src/index.css +42 -0
  24. package/shells/almadar-shell/packages/client/src/main.tsx +8 -0
  25. package/shells/almadar-shell/packages/client/src/navigation/index.ts +55 -0
  26. package/shells/almadar-shell/packages/client/src/pages/index.ts +12 -0
  27. package/shells/almadar-shell/packages/client/tailwind-preset.cjs +259 -0
  28. package/shells/almadar-shell/packages/client/tailwind.config.js +21 -0
  29. package/shells/almadar-shell/packages/client/tsconfig.json +33 -0
  30. package/shells/almadar-shell/packages/client/vite.config.ts +50 -0
  31. package/shells/almadar-shell/packages/server/eslint.config.cjs +19 -0
  32. package/shells/almadar-shell/packages/server/package.json +39 -0
  33. package/shells/almadar-shell/packages/server/src/app.ts +36 -0
  34. package/shells/almadar-shell/packages/server/src/index.ts +30 -0
  35. package/shells/almadar-shell/packages/server/src/routes.ts +11 -0
  36. package/shells/almadar-shell/packages/server/src/types/express.d.ts +15 -0
  37. package/shells/almadar-shell/packages/server/tsconfig.json +23 -0
  38. package/shells/almadar-shell/packages/shared/package.json +11 -0
  39. package/shells/almadar-shell/packages/shared/pnpm-lock.yaml +22 -0
  40. package/shells/almadar-shell/packages/shared/src/index.ts +2 -0
  41. package/shells/almadar-shell/pnpm-lock.yaml +8791 -0
  42. package/shells/almadar-shell/pnpm-workspace.yaml +2 -0
  43. package/shells/almadar-shell/tsup.config.ts +13 -0
  44. package/shells/almadar-shell/turbo.json +17 -0
  45. package/shells/almadar-shell/vitest.config.ts +8 -0
  46. package/shells/almadar-shell-hono/LICENSE +72 -0
  47. package/shells/almadar-shell-hono/README.md +25 -0
  48. package/shells/almadar-shell-hono/locales/en.json +120 -0
  49. package/shells/almadar-shell-hono/package.json +31 -0
  50. package/shells/almadar-shell-hono/packages/client/eslint.config.cjs +23 -0
  51. package/shells/almadar-shell-hono/packages/client/index.html +13 -0
  52. package/shells/almadar-shell-hono/packages/client/package-lock.json +9750 -0
  53. package/shells/almadar-shell-hono/packages/client/package.json +61 -0
  54. package/shells/almadar-shell-hono/packages/client/postcss.config.js +6 -0
  55. package/shells/almadar-shell-hono/packages/client/src/App.tsx +84 -0
  56. package/shells/almadar-shell-hono/packages/client/src/config/firebase.ts +37 -0
  57. package/shells/almadar-shell-hono/packages/client/src/features/auth/AuthContext.tsx +139 -0
  58. package/shells/almadar-shell-hono/packages/client/src/features/auth/authService.ts +83 -0
  59. package/shells/almadar-shell-hono/packages/client/src/features/auth/components/Login.tsx +218 -0
  60. package/shells/almadar-shell-hono/packages/client/src/features/auth/components/ProtectedRoute.tsx +27 -0
  61. package/shells/almadar-shell-hono/packages/client/src/features/auth/components/UserProfile.tsx +68 -0
  62. package/shells/almadar-shell-hono/packages/client/src/features/auth/components/index.ts +3 -0
  63. package/shells/almadar-shell-hono/packages/client/src/features/auth/index.ts +13 -0
  64. package/shells/almadar-shell-hono/packages/client/src/features/auth/types.ts +24 -0
  65. package/shells/almadar-shell-hono/packages/client/src/index.css +35 -0
  66. package/shells/almadar-shell-hono/packages/client/src/main.tsx +8 -0
  67. package/shells/almadar-shell-hono/packages/client/src/navigation/index.ts +55 -0
  68. package/shells/almadar-shell-hono/packages/client/src/pages/index.ts +12 -0
  69. package/shells/almadar-shell-hono/packages/client/tailwind-preset.cjs +259 -0
  70. package/shells/almadar-shell-hono/packages/client/tailwind.config.js +21 -0
  71. package/shells/almadar-shell-hono/packages/client/tsconfig.json +33 -0
  72. package/shells/almadar-shell-hono/packages/client/vite.config.ts +50 -0
  73. package/shells/almadar-shell-hono/packages/server/eslint.config.cjs +19 -0
  74. package/shells/almadar-shell-hono/packages/server/package.json +38 -0
  75. package/shells/almadar-shell-hono/packages/server/pnpm-lock.yaml +4665 -0
  76. package/shells/almadar-shell-hono/packages/server/src/app.ts +31 -0
  77. package/shells/almadar-shell-hono/packages/server/src/index.ts +31 -0
  78. package/shells/almadar-shell-hono/packages/server/src/routes.ts +12 -0
  79. package/shells/almadar-shell-hono/packages/server/src/serve.ts +45 -0
  80. package/shells/almadar-shell-hono/packages/server/tsconfig.json +23 -0
  81. package/shells/almadar-shell-hono/packages/shared/package.json +25 -0
  82. package/shells/almadar-shell-hono/packages/shared/pnpm-lock.yaml +919 -0
  83. package/shells/almadar-shell-hono/packages/shared/src/index.ts +2 -0
  84. package/shells/almadar-shell-hono/packages/shared/tsconfig.json +17 -0
  85. package/shells/almadar-shell-hono/packages/shared/tsup.config.ts +10 -0
  86. package/shells/almadar-shell-hono/pnpm-lock.yaml +9441 -0
  87. package/shells/almadar-shell-hono/pnpm-workspace.yaml +2 -0
  88. package/shells/almadar-shell-hono/tsup.config.ts +13 -0
  89. package/shells/almadar-shell-hono/turbo.json +17 -0
  90. package/shells/almadar-shell-hono/vitest.config.ts +8 -0
  91. package/shells/orb-shell/LICENSE +21 -0
  92. package/shells/orb-shell/README.md +25 -0
  93. package/shells/orb-shell/locales/en.json +120 -0
  94. package/shells/orb-shell/package.json +35 -0
  95. package/shells/orb-shell/packages/client/eslint.config.cjs +23 -0
  96. package/shells/orb-shell/packages/client/index.html +13 -0
  97. package/shells/orb-shell/packages/client/package-lock.json +11390 -0
  98. package/shells/orb-shell/packages/client/package.json +55 -0
  99. package/shells/orb-shell/packages/client/postcss.config.js +6 -0
  100. package/shells/orb-shell/packages/client/src/App.tsx +79 -0
  101. package/shells/orb-shell/packages/client/src/config/firebase.ts +37 -0
  102. package/shells/orb-shell/packages/client/src/features/auth/AuthContext.tsx +139 -0
  103. package/shells/orb-shell/packages/client/src/features/auth/authService.ts +83 -0
  104. package/shells/orb-shell/packages/client/src/features/auth/components/Login.tsx +218 -0
  105. package/shells/orb-shell/packages/client/src/features/auth/components/ProtectedRoute.tsx +27 -0
  106. package/shells/orb-shell/packages/client/src/features/auth/components/UserProfile.tsx +68 -0
  107. package/shells/orb-shell/packages/client/src/features/auth/components/index.ts +3 -0
  108. package/shells/orb-shell/packages/client/src/features/auth/index.ts +13 -0
  109. package/shells/orb-shell/packages/client/src/features/auth/types.ts +24 -0
  110. package/shells/orb-shell/packages/client/src/index.css +35 -0
  111. package/shells/orb-shell/packages/client/src/main.tsx +10 -0
  112. package/shells/orb-shell/packages/client/src/navigation/index.ts +55 -0
  113. package/shells/orb-shell/packages/client/src/pages/index.ts +12 -0
  114. package/shells/orb-shell/packages/client/tailwind-preset.cjs +243 -0
  115. package/shells/orb-shell/packages/client/tailwind.config.js +15 -0
  116. package/shells/orb-shell/packages/client/tsconfig.json +33 -0
  117. package/shells/orb-shell/packages/client/vite.config.ts +49 -0
  118. package/shells/orb-shell/packages/server/eslint.config.cjs +19 -0
  119. package/shells/orb-shell/packages/server/package-lock.json +6323 -0
  120. package/shells/orb-shell/packages/server/package.json +37 -0
  121. package/shells/orb-shell/packages/server/src/app.ts +36 -0
  122. package/shells/orb-shell/packages/server/src/index.ts +30 -0
  123. package/shells/orb-shell/packages/server/src/routes.ts +11 -0
  124. package/shells/orb-shell/packages/server/src/types/express.d.ts +15 -0
  125. package/shells/orb-shell/packages/server/tsconfig.json +23 -0
  126. package/shells/orb-shell/packages/shared/package-lock.json +24 -0
  127. package/shells/orb-shell/packages/shared/package.json +10 -0
  128. package/shells/orb-shell/packages/shared/src/index.ts +2 -0
  129. package/shells/orb-shell/pnpm-lock.yaml +9433 -0
  130. package/shells/orb-shell/pnpm-workspace.yaml +2 -0
  131. package/shells/orb-shell/tsup.config.ts +13 -0
  132. package/shells/orb-shell/turbo.json +17 -0
  133. package/shells/orb-shell/vitest.config.ts +8 -0
@@ -0,0 +1,24 @@
1
+ import { User } from 'firebase/auth';
2
+
3
+ export interface LoginCredentials {
4
+ email: string;
5
+ password: string;
6
+ }
7
+
8
+ export interface SignUpCredentials extends LoginCredentials {
9
+ displayName?: string;
10
+ }
11
+
12
+ export interface AuthContextType {
13
+ user: User | null;
14
+ loading: boolean;
15
+ error: string | null;
16
+ signInWithGoogle: () => Promise<void>;
17
+ signOut: () => Promise<void>;
18
+ signInWithEmail: (email: string, password: string) => Promise<void>;
19
+ signUpWithEmail: (email: string, password: string, displayName?: string) => Promise<void>;
20
+ sendSignInLinkToEmail: (email: string) => Promise<void>;
21
+ signInWithEmailLink: (email: string, emailLink: string) => Promise<void>;
22
+ isSignInWithEmailLink: (emailLink: string) => boolean;
23
+ clearError: () => void;
24
+ }
@@ -0,0 +1,42 @@
1
+ /* Import Almadar theme - @import must precede @tailwind directives */
2
+ @import '@almadar/ui/themes/almadar.css';
3
+
4
+ @tailwind base;
5
+ @tailwind components;
6
+ @tailwind utilities;
7
+
8
+ /* Page-level layout: readable max-width column with breathing room.
9
+ *
10
+ * The :not() selectors below SKIP the constraint when the slot's
11
+ * `data-pattern` indicates it owns its own page chrome
12
+ * (dashboard-layout, game-shell). Those patterns render a fixed sidebar
13
+ * + edge-to-edge content and would look "boxed in" inside a 80rem
14
+ * column. For everything else (forms, plain content, non-chrome list
15
+ * pages) the readable column applies. */
16
+ .ui-slot-main:not([data-pattern="dashboard-layout"]):not([data-pattern="game-shell"]) {
17
+ padding: 1.5rem 1rem;
18
+ max-width: 80rem;
19
+ margin-left: auto;
20
+ margin-right: auto;
21
+ }
22
+
23
+ @media (min-width: 768px) {
24
+ .ui-slot-main:not([data-pattern="dashboard-layout"]):not([data-pattern="game-shell"]) {
25
+ padding: 1.5rem 1.5rem;
26
+ }
27
+ }
28
+
29
+ @media (min-width: 1024px) {
30
+ .ui-slot-main:not([data-pattern="dashboard-layout"]):not([data-pattern="game-shell"]) {
31
+ padding: 2rem 2rem;
32
+ }
33
+ }
34
+
35
+ /* Global transition baseline: smooth state changes on interactive elements */
36
+ button,
37
+ a,
38
+ [role="button"],
39
+ [data-entity-row],
40
+ [data-interactive] {
41
+ transition: all var(--transition-normal, 250ms) var(--transition-timing, cubic-bezier(0.4, 0, 0.2, 1));
42
+ }
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom/client';
3
+ import App from './App';
4
+ import './index.css';
5
+
6
+ ReactDOM.createRoot(document.getElementById('root')!).render(
7
+ <App />
8
+ );
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Navigation Module for Compiled Shells
3
+ *
4
+ * Re-exports schema-driven navigation from @almadar/ui/renderer.
5
+ * This module provides unified navigation that:
6
+ * - Finds pages by path pattern (supports :id params)
7
+ * - Switches active page via NavigationContext
8
+ * - Fires INIT events with merged payload (route params + explicit)
9
+ * - Optionally updates browser URL via history.pushState
10
+ *
11
+ * Usage in generated pages:
12
+ * ```tsx
13
+ * import { useNavigateTo, useInitPayload } from '../navigation';
14
+ *
15
+ * function InspectionsPage() {
16
+ * const navigateTo = useNavigateTo();
17
+ * const initPayload = useInitPayload();
18
+ *
19
+ * const handleRowClick = (item) => {
20
+ * navigateTo(`/inspection/${item.id}`, { id: item.id });
21
+ * };
22
+ *
23
+ * // Use initPayload for INIT event handling
24
+ * }
25
+ * ```
26
+ *
27
+ * @packageDocumentation
28
+ */
29
+
30
+ // Re-export all navigation utilities from @almadar/ui/renderer
31
+ export {
32
+ // Context and Provider
33
+ NavigationProvider,
34
+ useNavigation,
35
+ useNavigateTo,
36
+ useNavigationState,
37
+ useInitPayload,
38
+ useActivePage,
39
+ useNavigationId,
40
+ // Path utilities
41
+ matchPath,
42
+ extractRouteParams,
43
+ pathMatches,
44
+ // Page finding utilities
45
+ findPageByPath,
46
+ findPageByName,
47
+ getDefaultPage,
48
+ getAllPages,
49
+ } from '@almadar/ui/renderer';
50
+
51
+ export type {
52
+ NavigationState,
53
+ NavigationContextValue,
54
+ NavigationProviderProps,
55
+ } from '@almadar/ui/renderer';
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Pages Placeholder
3
+ *
4
+ * This directory receives generated page components:
5
+ * - Route pages from OrbitalSchema
6
+ * - Layout components
7
+ *
8
+ * DO NOT EDIT - Contents are overwritten by compiler
9
+ */
10
+
11
+ // {{GENERATED_PAGE_EXPORTS}}
12
+ export {};
@@ -0,0 +1,259 @@
1
+ /**
2
+ * @almadar/ui Tailwind Preset
3
+ *
4
+ * Provides the complete Almadar design token system as a Tailwind preset.
5
+ * Includes a safelist for CSS-variable-based arbitrary classes that use
6
+ * bracket notation (Tailwind can't extract these from source scanning).
7
+ *
8
+ * Note: @almadar/ui dist content scanning is handled by tailwind.config.js
9
+ * in the shell template, not here. The config resolves the dist path via
10
+ * require.resolve('@almadar/ui') which works regardless of hoisting.
11
+ *
12
+ * Usage in tailwind.config.js:
13
+ * presets: [require('@almadar/ui/tailwind-preset')]
14
+ */
15
+
16
+ /** @type {import('tailwindcss').Config} */
17
+ module.exports = {
18
+ darkMode: 'class',
19
+ safelist: [
20
+ // Standard utilities used via dynamic className from .orb schemas
21
+ 'p-4', 'p-6', 'p-8',
22
+ 'px-4', 'px-6', 'py-4', 'py-6',
23
+ 'mx-auto',
24
+ 'w-full',
25
+ 'max-w-sm', 'max-w-md', 'max-w-lg', 'max-w-xl', 'max-w-2xl', 'max-w-3xl', 'max-w-4xl', 'max-w-5xl', 'max-w-6xl', 'max-w-7xl',
26
+ 'min-h-screen',
27
+ 'gap-1', 'gap-2', 'gap-3', 'gap-4', 'gap-6', 'gap-8',
28
+ 'grid-cols-1', 'grid-cols-2', 'grid-cols-3', 'grid-cols-4',
29
+ 'sm:grid-cols-2', 'md:grid-cols-2', 'md:grid-cols-3', 'lg:grid-cols-3', 'lg:grid-cols-4',
30
+ 'text-center', 'text-left', 'text-right',
31
+ // CSS variable-based classes from @almadar/ui components
32
+ 'accent-[var(--color-foreground)]',
33
+ 'accent-[var(--color-primary)]',
34
+ 'active:bg-[var(--color-muted)]',
35
+ 'active:bg-[var(--color-primary)]',
36
+ 'active:scale-[var(--active-scale)]',
37
+ 'active:shadow-[var(--shadow-active)]',
38
+ 'active:text-[var(--color-primary-foreground)]',
39
+ 'bg-[var(--color-accent)]',
40
+ 'bg-[var(--color-background)]',
41
+ 'bg-[var(--color-border)]',
42
+ 'bg-[var(--color-card)]',
43
+ 'bg-[var(--color-error)]',
44
+ 'bg-[var(--color-foreground)]',
45
+ 'bg-[var(--color-info)]',
46
+ 'bg-[var(--color-muted)]',
47
+ 'bg-[var(--color-muted-foreground)]',
48
+ ':bg-[var(--color-primary)]',
49
+ 'bg-[var(--color-primary)]',
50
+ 'bg-[var(--color-primary-foreground)]',
51
+ 'bg-[var(--color-secondary)]',
52
+ 'bg-[var(--color-success)]',
53
+ 'bg-[var(--color-surface)]',
54
+ 'bg-[var(--color-table-header)]',
55
+ 'bg-[var(--color-warning)]',
56
+ 'border-b-[length:var(--border-width)]',
57
+ 'border-b-[var(--color-foreground)]',
58
+ 'border-b-[var(--color-primary)]',
59
+ 'border-[length:var(--border-width)]',
60
+ 'border-[length:var(--border-width-thin)]',
61
+ 'border-l-[length:var(--border-width)]',
62
+ 'border-l-[var(--color-foreground)]',
63
+ 'border-l-[var(--color-primary)]',
64
+ 'border-r-[length:var(--border-width)]',
65
+ 'border-r-[var(--color-foreground)]',
66
+ 'border-r-[var(--color-primary)]',
67
+ 'border-t-[length:var(--border-width)]',
68
+ 'border-t-[var(--color-foreground)]',
69
+ 'border-t-[var(--color-primary)]',
70
+ 'border-[var(--color-accent)]',
71
+ ':border-[var(--color-border)]',
72
+ 'border-[var(--color-border)]',
73
+ 'border-[var(--color-card)]',
74
+ 'border-[var(--color-error)]',
75
+ 'border-[var(--color-foreground)]',
76
+ 'border-[var(--color-info)]',
77
+ ':border-[var(--color-primary)]',
78
+ 'border-[var(--color-primary)]',
79
+ 'border-[var(--color-success)]',
80
+ 'border-[var(--color-table-border)]',
81
+ 'border-[var(--color-warning)]',
82
+ 'border-x-[length:var(--border-width)]',
83
+ 'checked:bg-[var(--color-primary)]',
84
+ 'dark:bg-[var(--color-background)]',
85
+ 'dark:bg-[var(--color-card)]',
86
+ 'dark:bg-[var(--color-foreground)]',
87
+ 'dark:bg-[var(--color-muted)]',
88
+ 'dark:border-[var(--color-border)]',
89
+ 'dark:hover:bg-[var(--color-error)]',
90
+ 'dark:hover:bg-[var(--color-muted)]',
91
+ 'dark:text-[var(--color-error)]',
92
+ 'dark:text-[var(--color-foreground)]',
93
+ 'dark:text-[var(--color-muted-foreground)]',
94
+ 'disabled:bg-[var(--color-muted)]',
95
+ 'disabled:text-[var(--color-muted-foreground)]',
96
+ 'duration-[var(--transition-fast)]',
97
+ 'duration-[var(--transition-normal)]',
98
+ 'fill-[var(--color-warning)]',
99
+ 'focus:bg-[var(--color-card)]',
100
+ 'focus:bg-[var(--color-muted)]',
101
+ 'focus:border-[var(--color-error)]',
102
+ 'focus:border-[var(--color-primary)]',
103
+ 'focus:border-[var(--color-ring)]',
104
+ 'focus:ring-[length:var(--focus-ring-width)]',
105
+ 'focus:ring-offset-[length:var(--focus-ring-offset)]',
106
+ 'focus:ring-[var(--color-error)]',
107
+ 'focus:ring-[var(--color-ring)]',
108
+ 'font-[var(--font-weight-bold)]',
109
+ 'font-[var(--font-weight-medium)]',
110
+ 'from-[var(--color-muted)]',
111
+ 'group-hover:bg-[var(--color-foreground)]',
112
+ 'group-hover:text-[var(--color-foreground)]',
113
+ 'group-hover:text-[var(--color-muted-foreground)]',
114
+ 'hover:bg-[var(--color-error)]',
115
+ 'hover:bg-[var(--color-muted)]',
116
+ 'hover:bg-[var(--color-muted-foreground)]',
117
+ 'hover:bg-[var(--color-primary)]',
118
+ 'hover:bg-[var(--color-primary-hover)]',
119
+ 'hover:bg-[var(--color-secondary-hover)]',
120
+ 'hover:bg-[var(--color-success)]',
121
+ 'hover:bg-[var(--color-surface)]',
122
+ 'hover:bg-[var(--color-surface-hover)]',
123
+ 'hover:bg-[var(--color-table-row-hover)]',
124
+ 'hover:bg-[var(--color-warning)]',
125
+ 'hover:border-[var(--color-border)]',
126
+ 'hover:border-[var(--color-border-hover)]',
127
+ 'hover:border-[var(--color-muted-foreground)]',
128
+ 'hover:border-[var(--color-primary)]',
129
+ 'hover:ring-[var(--color-ring)]',
130
+ 'hover:shadow-[var(--shadow-hover)]',
131
+ 'hover:shadow-[var(--shadow-sm)]',
132
+ 'hover:text-[var(--color-error)]',
133
+ 'hover:text-[var(--color-error-foreground)]',
134
+ 'hover:text-[var(--color-foreground)]',
135
+ 'hover:text-[var(--color-primary)]',
136
+ 'hover:text-[var(--color-success-foreground)]',
137
+ 'hover:text-[var(--color-warning-foreground)]',
138
+ 'peer-focus:ring-[var(--color-error)]',
139
+ 'peer-focus:ring-[var(--color-ring)]',
140
+ 'placeholder:text-[var(--color-muted-foreground)]',
141
+ 'placeholder:text-[var(--color-placeholder)]',
142
+ 'ring-[var(--color-accent)]',
143
+ 'ring-[var(--color-error)]',
144
+ 'ring-[var(--color-info)]',
145
+ 'ring-[var(--color-muted-foreground)]',
146
+ 'ring-[var(--color-primary)]',
147
+ 'ring-[var(--color-success)]',
148
+ 'ring-[var(--color-warning)]',
149
+ 'rounded-l-[var(--radius-sm)]',
150
+ 'rounded-r-[var(--radius-sm)]',
151
+ 'rounded-t-[var(--radius-lg)]',
152
+ 'rounded-t-[var(--radius-sm)]',
153
+ 'rounded-[var(--radius-full)]',
154
+ 'rounded-[var(--radius-lg)]',
155
+ 'rounded-[var(--radius-md)]',
156
+ 'rounded-[var(--radius-sm)]',
157
+ 'rounded-[var(--radius-xl)]',
158
+ 'shadow-[var(--shadow-lg)]',
159
+ 'shadow-[var(--shadow-main)]',
160
+ 'shadow-[var(--shadow-sm)]',
161
+ 'text-[var(--color-accent)]',
162
+ 'text-[var(--color-accent-foreground)]',
163
+ 'text-[var(--color-background)]',
164
+ 'text-[var(--color-card-foreground)]',
165
+ 'text-[var(--color-error)]',
166
+ 'text-[var(--color-error-foreground)]',
167
+ 'text-[var(--color-foreground)]',
168
+ 'text-[var(--color-info)]',
169
+ 'text-[var(--color-info-foreground)]',
170
+ 'text-[var(--color-muted)]',
171
+ 'text-[var(--color-muted-foreground)]',
172
+ 'text-[var(--color-primary)]',
173
+ ':text-[var(--color-primary-foreground)]',
174
+ 'text-[var(--color-primary-foreground)]',
175
+ 'text-[var(--color-secondary-foreground)]',
176
+ 'text-[var(--color-success)]',
177
+ 'text-[var(--color-warning)]',
178
+ 'text-[var(--color-warning-foreground)]',
179
+ 'to-[var(--color-accent)]',
180
+ ],
181
+ theme: {
182
+ fontFamily: {
183
+ sans: ['var(--font-family)', 'ui-sans-serif', 'system-ui', 'sans-serif'],
184
+ mono: ['var(--font-family-mono, ui-monospace)', 'SFMono-Regular', 'Menlo', 'Monaco', 'Consolas', 'monospace'],
185
+ },
186
+ extend: {
187
+ colors: {
188
+ primary: {
189
+ DEFAULT: 'var(--color-primary)',
190
+ foreground: 'var(--color-primary-foreground)',
191
+ hover: 'var(--color-primary-hover)',
192
+ },
193
+ secondary: {
194
+ DEFAULT: 'var(--color-secondary)',
195
+ foreground: 'var(--color-secondary-foreground)',
196
+ hover: 'var(--color-secondary-hover)',
197
+ },
198
+ muted: {
199
+ DEFAULT: 'var(--color-muted)',
200
+ foreground: 'var(--color-muted-foreground)',
201
+ },
202
+ accent: {
203
+ DEFAULT: 'var(--color-accent)',
204
+ foreground: 'var(--color-accent-foreground)',
205
+ },
206
+ background: 'var(--color-background)',
207
+ foreground: 'var(--color-foreground)',
208
+ card: {
209
+ DEFAULT: 'var(--color-card)',
210
+ foreground: 'var(--color-card-foreground)',
211
+ },
212
+ surface: 'var(--color-surface)',
213
+ border: 'var(--color-border)',
214
+ input: 'var(--color-input)',
215
+ ring: 'var(--color-ring)',
216
+ error: {
217
+ DEFAULT: 'var(--color-error)',
218
+ foreground: 'var(--color-error-foreground)',
219
+ },
220
+ success: {
221
+ DEFAULT: 'var(--color-success)',
222
+ foreground: 'var(--color-success-foreground)',
223
+ },
224
+ warning: {
225
+ DEFAULT: 'var(--color-warning)',
226
+ foreground: 'var(--color-warning-foreground)',
227
+ },
228
+ info: {
229
+ DEFAULT: 'var(--color-info)',
230
+ foreground: 'var(--color-info-foreground)',
231
+ },
232
+ },
233
+ borderRadius: {
234
+ none: 'var(--radius-none, 0)',
235
+ sm: 'var(--radius-sm)',
236
+ md: 'var(--radius-md)',
237
+ lg: 'var(--radius-lg)',
238
+ xl: 'var(--radius-xl)',
239
+ full: 'var(--radius-full)',
240
+ },
241
+ boxShadow: {
242
+ sm: 'var(--shadow-sm)',
243
+ DEFAULT: 'var(--shadow-main)',
244
+ lg: 'var(--shadow-lg)',
245
+ inner: 'var(--shadow-inner)',
246
+ },
247
+ fontWeight: {
248
+ normal: 'var(--font-weight-normal, 400)',
249
+ medium: 'var(--font-weight-medium, 500)',
250
+ bold: 'var(--font-weight-bold, 600)',
251
+ },
252
+ transitionDuration: {
253
+ fast: 'var(--transition-fast, 150ms)',
254
+ normal: 'var(--transition-normal, 250ms)',
255
+ slow: 'var(--transition-slow, 400ms)',
256
+ },
257
+ },
258
+ },
259
+ };
@@ -0,0 +1,21 @@
1
+ import { createRequire } from 'module';
2
+ import { dirname, join } from 'path';
3
+ const require = createRequire(import.meta.url);
4
+
5
+ // Resolve @almadar/ui dist regardless of node_modules hoisting
6
+ const uiEntry = require.resolve('@almadar/ui');
7
+ const uiDist = join(dirname(uiEntry), '..', '**', '*.js');
8
+
9
+ /** @type {import('tailwindcss').Config} */
10
+ export default {
11
+ presets: [require('./tailwind-preset.cjs')],
12
+ content: [
13
+ "./index.html",
14
+ "./src/**/*.{js,ts,jsx,tsx}",
15
+ uiDist,
16
+ ],
17
+ theme: {
18
+ extend: {},
19
+ },
20
+ plugins: [],
21
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "useDefineForClassFields": true,
5
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
6
+ "types": ["vite/client"],
7
+ "module": "ESNext",
8
+ "skipLibCheck": true,
9
+ "moduleResolution": "bundler",
10
+ "allowImportingTsExtensions": true,
11
+ "resolveJsonModule": true,
12
+ "isolatedModules": true,
13
+ "noEmit": true,
14
+ "jsx": "react-jsx",
15
+ "strict": true,
16
+ "noUnusedLocals": false,
17
+ "noUnusedParameters": false,
18
+ "noFallthroughCasesInSwitch": true,
19
+ "baseUrl": ".",
20
+ "paths": {
21
+ "@/*": ["./src/*"],
22
+ "@generated/*": ["./src/generated/*"],
23
+ "@pages/*": ["./src/pages/*"],
24
+ "@app/shared": ["../shared/src/index.ts"],
25
+ "@app/shared/*": ["../shared/src/*"],
26
+ "@shared/*": ["../shared/src/*"],
27
+ "@design-system": ["../../../design-system/index.ts"],
28
+ "@design-system/*": ["../../../design-system/*"]
29
+ }
30
+ },
31
+ "include": ["src", "../../../design-system/types"],
32
+ "exclude": ["node_modules", "dist", "src/**/__tests__", "src/**/*.stories.ts", "src/**/*.stories.tsx"]
33
+ }
@@ -0,0 +1,50 @@
1
+ import { defineConfig, loadEnv } from 'vite';
2
+ import react from '@vitejs/plugin-react';
3
+ import path from 'path';
4
+
5
+ export default defineConfig(({ mode }) => {
6
+ const env = loadEnv(mode, process.cwd(), '');
7
+ const backendUrl = env.VITE_API_URL || 'http://localhost:3030';
8
+ const wsUrl = backendUrl.replace('http://', 'ws://').replace('https://', 'wss://');
9
+
10
+ return {
11
+ plugins: [react()],
12
+
13
+ resolve: {
14
+ alias: {
15
+ '@design-system': path.resolve(__dirname, '../../../design-system'),
16
+ '@': path.resolve(__dirname, './src'),
17
+ '@generated': path.resolve(__dirname, './src/generated'),
18
+ '@pages': path.resolve(__dirname, './src/pages'),
19
+ '@app/shared': path.resolve(__dirname, '../shared/src'),
20
+ '@shared': path.resolve(__dirname, '../shared/src'),
21
+ },
22
+ dedupe: ['react', 'react-dom', '@almadar/ui'],
23
+ },
24
+
25
+ server: {
26
+ host: true,
27
+ port: 5173,
28
+ proxy: {
29
+ '/api': {
30
+ target: backendUrl,
31
+ changeOrigin: true,
32
+ },
33
+ '/ws': {
34
+ target: wsUrl,
35
+ ws: true,
36
+ },
37
+ },
38
+ },
39
+
40
+ build: {
41
+ outDir: 'dist',
42
+ sourcemap: true,
43
+ },
44
+
45
+ test: {
46
+ environment: 'jsdom',
47
+ globals: true,
48
+ },
49
+ };
50
+ });
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ const tsParser = require("@typescript-eslint/parser");
3
+ const almadarPlugin = require("@almadar/eslint-plugin");
4
+
5
+ module.exports = [
6
+ { ignores: ["dist/**", "node_modules/**", "**/*.test.ts"] },
7
+ {
8
+ files: ["src/**/*.ts"],
9
+ languageOptions: {
10
+ parser: tsParser,
11
+ parserOptions: { ecmaVersion: "latest", sourceType: "module" },
12
+ },
13
+ plugins: { almadar: almadarPlugin },
14
+ rules: {
15
+ "almadar/no-as-any": "error",
16
+ "almadar/no-import-generated": "error",
17
+ },
18
+ },
19
+ ];
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "@almadar/shell-server",
3
+ "version": "1.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "tsx watch src/index.ts",
8
+ "build": "esbuild src/index.ts --bundle --platform=node --format=esm --packages=external --outfile=dist/index.js",
9
+ "start": "node dist/index.js",
10
+ "typecheck": "tsc --noEmit",
11
+ "lint": "eslint src/",
12
+ "test": "vitest run --passWithNoTests",
13
+ "test:watch": "vitest"
14
+ },
15
+ "dependencies": {
16
+ "@almadar/server": ">=2.9.0",
17
+ "@almadar/runtime": ">=6.3.0",
18
+ "@almadar/evaluator": ">=2.9.2",
19
+ "@almadar/core": ">=7.12.0",
20
+ "@almadar/integrations": ">=2.6.3",
21
+ "cors": "^2.8.5",
22
+ "dotenv": "^16.4.7",
23
+ "express": "^4.21.2",
24
+ "firebase-admin": "^12.7.0",
25
+ "zod": "^3.22.0"
26
+ },
27
+ "devDependencies": {
28
+ "@almadar/eslint-plugin": ">=2.8.0",
29
+ "@typescript-eslint/parser": "8.56.0",
30
+ "@types/cors": "^2.8.17",
31
+ "@types/express": "^5.0.0",
32
+ "@types/node": "^20.17.19",
33
+ "eslint": "10.0.0",
34
+ "esbuild": "^0.25.0",
35
+ "tsx": "^4.19.3",
36
+ "typescript": "^5.7.3",
37
+ "vitest": "^2.1.9"
38
+ }
39
+ }
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Express Application Setup
3
+ */
4
+
5
+ import express, { type Express } from 'express';
6
+ import cors from 'cors';
7
+ import {
8
+ env,
9
+ logger,
10
+ errorHandler,
11
+ notFoundHandler,
12
+ debugEventsRouter,
13
+ } from '@almadar/server';
14
+ import { registerRoutes } from './routes.js';
15
+
16
+ export const app: Express = express();
17
+
18
+ // Middleware
19
+ app.use(cors({ origin: true, credentials: true }));
20
+ app.use(express.json());
21
+ app.use(express.urlencoded({ extended: true }));
22
+
23
+ // Health check
24
+ app.get('/health', (_req, res) => {
25
+ res.json({ status: 'ok' });
26
+ });
27
+
28
+ // Debug event bus endpoints (dev-only, no-op in production)
29
+ app.use('/api/debug', debugEventsRouter());
30
+
31
+ // Register generated routes
32
+ registerRoutes(app);
33
+
34
+ // Error handling
35
+ app.use(notFoundHandler);
36
+ app.use(errorHandler);
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Server Entry Point
3
+ */
4
+
5
+ import { initializeFirebase, env, logger } from '@almadar/server';
6
+
7
+ // Initialize Firebase before anything else uses it
8
+ initializeFirebase();
9
+
10
+ import { app } from './app.js';
11
+
12
+ const PORT = env.PORT || 3030;
13
+
14
+ async function start(): Promise<void> {
15
+ // Seed mock data when USE_MOCK_DATA is enabled
16
+ if (env.USE_MOCK_DATA) {
17
+ try {
18
+ const { initializeMockData } = await import(/* @vite-ignore */ './seedMockData.js' as string);
19
+ await initializeMockData();
20
+ } catch {
21
+ logger.warn('seedMockData.ts not found — skipping mock data seeding');
22
+ }
23
+ }
24
+
25
+ app.listen(PORT, () => {
26
+ logger.info(`Server running on port ${PORT}`);
27
+ });
28
+ }
29
+
30
+ start();
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Route Registration
3
+ *
4
+ * Compiler generates route registration code here.
5
+ */
6
+
7
+ import type { Express } from 'express';
8
+
9
+ export function registerRoutes(app: Express): void {
10
+ // {{GENERATED_ROUTE_REGISTRATION}}
11
+ }
@@ -0,0 +1,15 @@
1
+ declare global {
2
+ namespace Express {
3
+ interface Request {
4
+ firebaseUser?: {
5
+ uid: string;
6
+ email?: string;
7
+ name?: string;
8
+ picture?: string;
9
+ [key: string]: unknown;
10
+ };
11
+ }
12
+ }
13
+ }
14
+
15
+ export {};