@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,37 @@
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.0.2",
17
+ "@almadar/evaluator": "^2.0.0",
18
+ "@almadar/core": "^2.1.0",
19
+ "cors": "^2.8.5",
20
+ "dotenv": "^16.4.7",
21
+ "express": "^4.21.2",
22
+ "firebase-admin": "^12.7.0",
23
+ "zod": "^3.22.0"
24
+ },
25
+ "devDependencies": {
26
+ "@almadar/eslint-plugin": ">=2.3.0",
27
+ "@typescript-eslint/parser": "8.56.0",
28
+ "@types/cors": "^2.8.17",
29
+ "@types/express": "^5.0.0",
30
+ "@types/node": "^20.17.19",
31
+ "eslint": "10.0.0",
32
+ "esbuild": "^0.25.0",
33
+ "tsx": "^4.19.3",
34
+ "typescript": "^5.7.3",
35
+ "vitest": "^2.1.9"
36
+ }
37
+ }
@@ -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,24 @@
1
+ {
2
+ "name": "@app/shared",
3
+ "version": "1.0.0",
4
+ "lockfileVersion": 3,
5
+ "requires": true,
6
+ "packages": {
7
+ "": {
8
+ "name": "@app/shared",
9
+ "version": "1.0.0",
10
+ "dependencies": {
11
+ "zod": "^3.22.0"
12
+ }
13
+ },
14
+ "node_modules/zod": {
15
+ "version": "3.25.76",
16
+ "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz",
17
+ "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==",
18
+ "license": "MIT",
19
+ "funding": {
20
+ "url": "https://github.com/sponsors/colinhacks"
21
+ }
22
+ }
23
+ }
24
+ }
@@ -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,2 @@
1
+ // Placeholder — the compiler generates actual shared types here.
2
+ export {};