@almadar/orb 6.3.0 → 6.4.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 (87) hide show
  1. package/package.json +6 -6
  2. package/shells/almadar-shell/LICENSE +72 -0
  3. package/shells/almadar-shell/README.md +25 -0
  4. package/shells/almadar-shell/locales/en.json +120 -0
  5. package/shells/almadar-shell/package.json +35 -0
  6. package/shells/almadar-shell/packages/client/eslint.config.cjs +23 -0
  7. package/shells/almadar-shell/packages/client/index.html +13 -0
  8. package/shells/almadar-shell/packages/client/package.json +61 -0
  9. package/shells/almadar-shell/packages/client/postcss.config.js +6 -0
  10. package/shells/almadar-shell/packages/client/src/App.tsx +84 -0
  11. package/shells/almadar-shell/packages/client/src/config/firebase.ts +37 -0
  12. package/shells/almadar-shell/packages/client/src/features/auth/AuthContext.tsx +139 -0
  13. package/shells/almadar-shell/packages/client/src/features/auth/authService.ts +83 -0
  14. package/shells/almadar-shell/packages/client/src/features/auth/components/Login.tsx +218 -0
  15. package/shells/almadar-shell/packages/client/src/features/auth/components/ProtectedRoute.tsx +27 -0
  16. package/shells/almadar-shell/packages/client/src/features/auth/components/UserProfile.tsx +68 -0
  17. package/shells/almadar-shell/packages/client/src/features/auth/components/index.ts +3 -0
  18. package/shells/almadar-shell/packages/client/src/features/auth/index.ts +13 -0
  19. package/shells/almadar-shell/packages/client/src/features/auth/types.ts +24 -0
  20. package/shells/almadar-shell/packages/client/src/index.css +35 -0
  21. package/shells/almadar-shell/packages/client/src/main.tsx +8 -0
  22. package/shells/almadar-shell/packages/client/src/navigation/index.ts +55 -0
  23. package/shells/almadar-shell/packages/client/src/pages/index.ts +12 -0
  24. package/shells/almadar-shell/packages/client/tailwind-preset.cjs +259 -0
  25. package/shells/almadar-shell/packages/client/tailwind.config.js +21 -0
  26. package/shells/almadar-shell/packages/client/tsconfig.json +33 -0
  27. package/shells/almadar-shell/packages/client/vite.config.ts +50 -0
  28. package/shells/almadar-shell/packages/server/eslint.config.cjs +19 -0
  29. package/shells/almadar-shell/packages/server/package.json +38 -0
  30. package/shells/almadar-shell/packages/server/src/app.ts +36 -0
  31. package/shells/almadar-shell/packages/server/src/index.ts +30 -0
  32. package/shells/almadar-shell/packages/server/src/routes.ts +11 -0
  33. package/shells/almadar-shell/packages/server/src/types/express.d.ts +15 -0
  34. package/shells/almadar-shell/packages/server/tsconfig.json +23 -0
  35. package/shells/almadar-shell/packages/shared/package.json +10 -0
  36. package/shells/almadar-shell/packages/shared/pnpm-lock.yaml +22 -0
  37. package/shells/almadar-shell/packages/shared/src/index.ts +2 -0
  38. package/shells/almadar-shell/pnpm-lock.yaml +8792 -0
  39. package/shells/almadar-shell/pnpm-workspace.yaml +2 -0
  40. package/shells/almadar-shell/tsup.config.ts +13 -0
  41. package/shells/almadar-shell/turbo.json +17 -0
  42. package/shells/almadar-shell/vitest.config.ts +8 -0
  43. package/shells/almadar-shell-hono/LICENSE +72 -0
  44. package/shells/almadar-shell-hono/README.md +25 -0
  45. package/shells/almadar-shell-hono/locales/en.json +120 -0
  46. package/shells/almadar-shell-hono/package.json +31 -0
  47. package/shells/almadar-shell-hono/packages/client/eslint.config.cjs +23 -0
  48. package/shells/almadar-shell-hono/packages/client/index.html +13 -0
  49. package/shells/almadar-shell-hono/packages/client/package-lock.json +9750 -0
  50. package/shells/almadar-shell-hono/packages/client/package.json +61 -0
  51. package/shells/almadar-shell-hono/packages/client/postcss.config.js +6 -0
  52. package/shells/almadar-shell-hono/packages/client/src/App.tsx +84 -0
  53. package/shells/almadar-shell-hono/packages/client/src/config/firebase.ts +37 -0
  54. package/shells/almadar-shell-hono/packages/client/src/features/auth/AuthContext.tsx +139 -0
  55. package/shells/almadar-shell-hono/packages/client/src/features/auth/authService.ts +83 -0
  56. package/shells/almadar-shell-hono/packages/client/src/features/auth/components/Login.tsx +218 -0
  57. package/shells/almadar-shell-hono/packages/client/src/features/auth/components/ProtectedRoute.tsx +27 -0
  58. package/shells/almadar-shell-hono/packages/client/src/features/auth/components/UserProfile.tsx +68 -0
  59. package/shells/almadar-shell-hono/packages/client/src/features/auth/components/index.ts +3 -0
  60. package/shells/almadar-shell-hono/packages/client/src/features/auth/index.ts +13 -0
  61. package/shells/almadar-shell-hono/packages/client/src/features/auth/types.ts +24 -0
  62. package/shells/almadar-shell-hono/packages/client/src/index.css +35 -0
  63. package/shells/almadar-shell-hono/packages/client/src/main.tsx +8 -0
  64. package/shells/almadar-shell-hono/packages/client/src/navigation/index.ts +55 -0
  65. package/shells/almadar-shell-hono/packages/client/src/pages/index.ts +12 -0
  66. package/shells/almadar-shell-hono/packages/client/tailwind-preset.cjs +259 -0
  67. package/shells/almadar-shell-hono/packages/client/tailwind.config.js +21 -0
  68. package/shells/almadar-shell-hono/packages/client/tsconfig.json +33 -0
  69. package/shells/almadar-shell-hono/packages/client/vite.config.ts +50 -0
  70. package/shells/almadar-shell-hono/packages/server/eslint.config.cjs +19 -0
  71. package/shells/almadar-shell-hono/packages/server/package.json +37 -0
  72. package/shells/almadar-shell-hono/packages/server/pnpm-lock.yaml +4665 -0
  73. package/shells/almadar-shell-hono/packages/server/src/app.ts +31 -0
  74. package/shells/almadar-shell-hono/packages/server/src/index.ts +31 -0
  75. package/shells/almadar-shell-hono/packages/server/src/routes.ts +12 -0
  76. package/shells/almadar-shell-hono/packages/server/src/serve.ts +45 -0
  77. package/shells/almadar-shell-hono/packages/server/tsconfig.json +23 -0
  78. package/shells/almadar-shell-hono/packages/shared/package.json +25 -0
  79. package/shells/almadar-shell-hono/packages/shared/pnpm-lock.yaml +919 -0
  80. package/shells/almadar-shell-hono/packages/shared/src/index.ts +2 -0
  81. package/shells/almadar-shell-hono/packages/shared/tsconfig.json +17 -0
  82. package/shells/almadar-shell-hono/packages/shared/tsup.config.ts +10 -0
  83. package/shells/almadar-shell-hono/pnpm-lock.yaml +9423 -0
  84. package/shells/almadar-shell-hono/pnpm-workspace.yaml +2 -0
  85. package/shells/almadar-shell-hono/tsup.config.ts +13 -0
  86. package/shells/almadar-shell-hono/turbo.json +17 -0
  87. package/shells/almadar-shell-hono/vitest.config.ts +8 -0
@@ -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,38 @@
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.2.0",
17
+ "@almadar/evaluator": ">=2.6.0",
18
+ "@almadar/core": ">=2.9.0",
19
+ "@almadar/integrations": ">=2.3.0",
20
+ "cors": "^2.8.5",
21
+ "dotenv": "^16.4.7",
22
+ "express": "^4.21.2",
23
+ "firebase-admin": "^12.7.0",
24
+ "zod": "^3.22.0"
25
+ },
26
+ "devDependencies": {
27
+ "@almadar/eslint-plugin": ">=2.3.0",
28
+ "@typescript-eslint/parser": "8.56.0",
29
+ "@types/cors": "^2.8.17",
30
+ "@types/express": "^5.0.0",
31
+ "@types/node": "^20.17.19",
32
+ "eslint": "10.0.0",
33
+ "esbuild": "^0.25.0",
34
+ "tsx": "^4.19.3",
35
+ "typescript": "^5.7.3",
36
+ "vitest": "^2.1.9"
37
+ }
38
+ }
@@ -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 {};
@@ -0,0 +1,23 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "ESNext",
5
+ "moduleResolution": "bundler",
6
+ "outDir": "./dist",
7
+ "strict": true,
8
+ "strictNullChecks": false,
9
+ "esModuleInterop": true,
10
+ "skipLibCheck": true,
11
+ "forceConsistentCasingInFileNames": true,
12
+ "declaration": true,
13
+ "declarationMap": true,
14
+ "baseUrl": ".",
15
+ "paths": {
16
+ "@/*": ["./src/*"],
17
+ "@app/shared": ["../shared/src/index.ts"],
18
+ "@app/shared/*": ["../shared/src/*"]
19
+ }
20
+ },
21
+ "include": ["src"],
22
+ "exclude": ["node_modules", "dist", "src/**/__tests__/**", "src/**/*.test.ts", "src/**/*.spec.ts"]
23
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "@app/shared",
3
+ "version": "1.0.0",
4
+ "private": true,
5
+ "main": "src/index.ts",
6
+ "types": "src/index.ts",
7
+ "dependencies": {
8
+ "zod": "^3.22.0"
9
+ }
10
+ }
@@ -0,0 +1,22 @@
1
+ lockfileVersion: '9.0'
2
+
3
+ settings:
4
+ autoInstallPeers: true
5
+ excludeLinksFromLockfile: false
6
+
7
+ importers:
8
+
9
+ .:
10
+ dependencies:
11
+ zod:
12
+ specifier: ^3.22.0
13
+ version: 3.25.76
14
+
15
+ packages:
16
+
17
+ zod@3.25.76:
18
+ resolution: {integrity: sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==}
19
+
20
+ snapshots:
21
+
22
+ zod@3.25.76: {}
@@ -0,0 +1,2 @@
1
+ // Placeholder — the compiler generates actual shared types here.
2
+ export {};