@almadar/orb 1.9.4

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 (83) hide show
  1. package/README.md +45 -0
  2. package/bin/almadar +95 -0
  3. package/package.json +58 -0
  4. package/scripts/postinstall.js +41 -0
  5. package/shells/almadar-shell/LICENSE +21 -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 +28 -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 +55 -0
  12. package/shells/almadar-shell/packages/client/postcss.config.js +6 -0
  13. package/shells/almadar-shell/packages/client/src/App.tsx +79 -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 +35 -0
  24. package/shells/almadar-shell/packages/client/src/main.tsx +10 -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.config.js +12 -0
  28. package/shells/almadar-shell/packages/client/tsconfig.json +33 -0
  29. package/shells/almadar-shell/packages/client/vite.config.ts +49 -0
  30. package/shells/almadar-shell/packages/server/eslint.config.cjs +19 -0
  31. package/shells/almadar-shell/packages/server/package.json +37 -0
  32. package/shells/almadar-shell/packages/server/src/app.ts +36 -0
  33. package/shells/almadar-shell/packages/server/src/index.ts +30 -0
  34. package/shells/almadar-shell/packages/server/src/routes.ts +11 -0
  35. package/shells/almadar-shell/packages/server/src/types/express.d.ts +15 -0
  36. package/shells/almadar-shell/packages/server/tsconfig.json +23 -0
  37. package/shells/almadar-shell/packages/shared/package.json +10 -0
  38. package/shells/almadar-shell/packages/shared/src/index.ts +2 -0
  39. package/shells/almadar-shell/pnpm-lock.yaml +9724 -0
  40. package/shells/almadar-shell/pnpm-workspace.yaml +2 -0
  41. package/shells/almadar-shell/tsup.config.ts +13 -0
  42. package/shells/almadar-shell/turbo.json +17 -0
  43. package/shells/almadar-shell/vitest.config.ts +8 -0
  44. package/shells/orb-shell/LICENSE +21 -0
  45. package/shells/orb-shell/README.md +25 -0
  46. package/shells/orb-shell/locales/en.json +120 -0
  47. package/shells/orb-shell/package.json +35 -0
  48. package/shells/orb-shell/packages/client/eslint.config.cjs +23 -0
  49. package/shells/orb-shell/packages/client/index.html +13 -0
  50. package/shells/orb-shell/packages/client/package.json +55 -0
  51. package/shells/orb-shell/packages/client/postcss.config.js +6 -0
  52. package/shells/orb-shell/packages/client/src/App.tsx +79 -0
  53. package/shells/orb-shell/packages/client/src/config/firebase.ts +37 -0
  54. package/shells/orb-shell/packages/client/src/features/auth/AuthContext.tsx +139 -0
  55. package/shells/orb-shell/packages/client/src/features/auth/authService.ts +83 -0
  56. package/shells/orb-shell/packages/client/src/features/auth/components/Login.tsx +218 -0
  57. package/shells/orb-shell/packages/client/src/features/auth/components/ProtectedRoute.tsx +27 -0
  58. package/shells/orb-shell/packages/client/src/features/auth/components/UserProfile.tsx +68 -0
  59. package/shells/orb-shell/packages/client/src/features/auth/components/index.ts +3 -0
  60. package/shells/orb-shell/packages/client/src/features/auth/index.ts +13 -0
  61. package/shells/orb-shell/packages/client/src/features/auth/types.ts +24 -0
  62. package/shells/orb-shell/packages/client/src/index.css +35 -0
  63. package/shells/orb-shell/packages/client/src/main.tsx +10 -0
  64. package/shells/orb-shell/packages/client/src/navigation/index.ts +55 -0
  65. package/shells/orb-shell/packages/client/src/pages/index.ts +12 -0
  66. package/shells/orb-shell/packages/client/tailwind-preset.js +243 -0
  67. package/shells/orb-shell/packages/client/tailwind.config.js +15 -0
  68. package/shells/orb-shell/packages/client/tsconfig.json +33 -0
  69. package/shells/orb-shell/packages/client/vite.config.ts +49 -0
  70. package/shells/orb-shell/packages/server/eslint.config.cjs +19 -0
  71. package/shells/orb-shell/packages/server/package.json +37 -0
  72. package/shells/orb-shell/packages/server/src/app.ts +36 -0
  73. package/shells/orb-shell/packages/server/src/index.ts +30 -0
  74. package/shells/orb-shell/packages/server/src/routes.ts +11 -0
  75. package/shells/orb-shell/packages/server/src/types/express.d.ts +15 -0
  76. package/shells/orb-shell/packages/server/tsconfig.json +23 -0
  77. package/shells/orb-shell/packages/shared/package.json +10 -0
  78. package/shells/orb-shell/packages/shared/src/index.ts +2 -0
  79. package/shells/orb-shell/pnpm-lock.yaml +9247 -0
  80. package/shells/orb-shell/pnpm-workspace.yaml +2 -0
  81. package/shells/orb-shell/tsup.config.ts +13 -0
  82. package/shells/orb-shell/turbo.json +17 -0
  83. package/shells/orb-shell/vitest.config.ts +8 -0
package/README.md ADDED
@@ -0,0 +1,45 @@
1
+ # @almadar/cli
2
+
3
+ Almadar CLI - Compile Almadar schemas to full-stack applications.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install -g @almadar/cli
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```bash
14
+ # Validate a schema
15
+ almadar validate schema.orb
16
+
17
+ # Compile to TypeScript (React + Express)
18
+ almadar compile schema.orb --shell typescript
19
+
20
+ # Compile to Python (FastAPI + PyTorch)
21
+ almadar compile schema.orb --shell python
22
+
23
+ # Start development server
24
+ almadar dev schema.orb
25
+ ```
26
+
27
+ ## Commands
28
+
29
+ | Command | Description |
30
+ |---------|-------------|
31
+ | `almadar validate <file>` | Validate an Almadar schema |
32
+ | `almadar parse <file>` | Parse and display schema information |
33
+ | `almadar compile <file>` | Compile schema to generated code |
34
+ | `almadar serve <file>` | Start the Almadar server runtime |
35
+ | `almadar gui <file>` | Start the Almadar desktop GUI |
36
+ | `almadar dev <file>` | Start both server and client (dev mode) |
37
+
38
+ ## Documentation
39
+
40
+ - [Getting Started](https://almadar.io/docs/en/getting-started)
41
+ - [CLI Reference](https://almadar.io/docs/en/reference/cli)
42
+
43
+ ## License
44
+
45
+ MIT
package/bin/almadar ADDED
@@ -0,0 +1,95 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { execFileSync } = require('child_process');
4
+ const path = require('path');
5
+ const fs = require('fs');
6
+
7
+ const BINARY_NAME = process.platform === 'win32' ? 'almadar.exe' : 'almadar';
8
+
9
+ function getBinaryPath() {
10
+ const platform = process.platform;
11
+ const arch = process.arch;
12
+
13
+ // Map Node.js platform/arch to package names
14
+ const platformMap = {
15
+ 'darwin-x64': '@almadar/cli-darwin-x64',
16
+ 'darwin-arm64': '@almadar/cli-darwin-arm64',
17
+ 'linux-x64': '@almadar/cli-linux-x64',
18
+ 'linux-arm64': '@almadar/cli-linux-arm64',
19
+ 'win32-x64': '@almadar/cli-windows-x64',
20
+ };
21
+
22
+ const key = `${platform}-${arch}`;
23
+ const packageName = platformMap[key];
24
+
25
+ if (!packageName) {
26
+ console.error(`Unsupported platform: ${platform}-${arch}`);
27
+ console.error('Supported platforms: darwin-x64, darwin-arm64, linux-x64, linux-arm64, win32-x64');
28
+ process.exit(1);
29
+ }
30
+
31
+ // Try to find the binary in node_modules
32
+ const possiblePaths = [
33
+ // Installed as dependency
34
+ path.join(__dirname, '..', 'node_modules', packageName, BINARY_NAME),
35
+ // Hoisted to parent node_modules
36
+ path.join(__dirname, '..', '..', packageName, BINARY_NAME),
37
+ // Global install
38
+ path.join(__dirname, '..', '..', '..', packageName, BINARY_NAME),
39
+ ];
40
+
41
+ for (const binaryPath of possiblePaths) {
42
+ if (fs.existsSync(binaryPath)) {
43
+ return binaryPath;
44
+ }
45
+ }
46
+
47
+ console.error(`Could not find Almadar binary for ${platform}-${arch}`);
48
+ console.error('Please try reinstalling: npm install -g @almadar/cli');
49
+ process.exit(1);
50
+ }
51
+
52
+ function getShellsDir() {
53
+ // If user has set ORBITAL_SHELLS_DIR, respect it
54
+ if (process.env.ORBITAL_SHELLS_DIR) {
55
+ return process.env.ORBITAL_SHELLS_DIR;
56
+ }
57
+
58
+ // Look for shells bundled with this package
59
+ const possiblePaths = [
60
+ // Shells in same package
61
+ path.join(__dirname, '..', 'shells'),
62
+ // Global install - shells might be one level up
63
+ path.join(__dirname, '..', '..', '@almadar', 'cli', 'shells'),
64
+ ];
65
+
66
+ for (const shellsPath of possiblePaths) {
67
+ if (fs.existsSync(shellsPath) && fs.existsSync(path.join(shellsPath, 'typescript-shell'))) {
68
+ return shellsPath;
69
+ }
70
+ }
71
+
72
+ // No bundled shells found - binary will use its fallback or error
73
+ return null;
74
+ }
75
+
76
+ const binaryPath = getBinaryPath();
77
+ const shellsDir = getShellsDir();
78
+
79
+ // Build environment with ORBITAL_SHELLS_DIR if we found shells
80
+ const env = { ...process.env };
81
+ if (shellsDir) {
82
+ env.ORBITAL_SHELLS_DIR = shellsDir;
83
+ }
84
+
85
+ try {
86
+ execFileSync(binaryPath, process.argv.slice(2), {
87
+ stdio: 'inherit',
88
+ env: env,
89
+ });
90
+ } catch (error) {
91
+ if (error.status !== undefined) {
92
+ process.exit(error.status);
93
+ }
94
+ throw error;
95
+ }
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@almadar/orb",
3
+ "version": "1.9.4",
4
+ "description": "Orb CLI - Compile Orbital schemas to full-stack applications",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/almadar-io/almadar.git",
9
+ "directory": "cli/npm"
10
+ },
11
+ "homepage": "https://orb.almadar.io",
12
+ "bugs": {
13
+ "url": "https://github.com/almadar-io/almadar/issues"
14
+ },
15
+ "keywords": [
16
+ "orb",
17
+ "orbital",
18
+ "cli",
19
+ "compiler",
20
+ "codegen",
21
+ "full-stack",
22
+ "react",
23
+ "typescript",
24
+ "python",
25
+ "fastapi"
26
+ ],
27
+ "bin": {
28
+ "orb": "bin/orb"
29
+ },
30
+ "files": [
31
+ "bin",
32
+ "scripts",
33
+ "shells",
34
+ "README.md"
35
+ ],
36
+ "scripts": {
37
+ "postinstall": "node scripts/postinstall.js"
38
+ },
39
+ "os": [
40
+ "darwin",
41
+ "linux",
42
+ "win32"
43
+ ],
44
+ "cpu": [
45
+ "x64",
46
+ "arm64"
47
+ ],
48
+ "engines": {
49
+ "node": ">=16.0.0"
50
+ },
51
+ "optionalDependencies": {
52
+ "@almadar/orb-darwin-x64": "1.9.4",
53
+ "@almadar/orb-darwin-arm64": "1.9.4",
54
+ "@almadar/orb-linux-x64": "1.9.4",
55
+ "@almadar/orb-linux-arm64": "1.9.4",
56
+ "@almadar/orb-windows-x64": "1.9.4"
57
+ }
58
+ }
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+
6
+ const platform = process.platform;
7
+ const arch = process.arch;
8
+
9
+ const platformMap = {
10
+ 'darwin-x64': '@almadar/cli-darwin-x64',
11
+ 'darwin-arm64': '@almadar/cli-darwin-arm64',
12
+ 'linux-x64': '@almadar/cli-linux-x64',
13
+ 'linux-arm64': '@almadar/cli-linux-arm64',
14
+ 'win32-x64': '@almadar/cli-windows-x64',
15
+ };
16
+
17
+ const key = `${platform}-${arch}`;
18
+ const packageName = platformMap[key];
19
+
20
+ if (!packageName) {
21
+ console.warn(`\n⚠️ Almadar CLI: No pre-built binary for ${platform}-${arch}`);
22
+ console.warn(' You can build from source: https://github.com/almadar-io/almadar#building-from-source\n');
23
+ process.exit(0);
24
+ }
25
+
26
+ // Check if the platform-specific package was installed
27
+ const possiblePaths = [
28
+ path.join(__dirname, '..', 'node_modules', packageName),
29
+ path.join(__dirname, '..', '..', packageName),
30
+ path.join(__dirname, '..', '..', '..', packageName),
31
+ ];
32
+
33
+ const found = possiblePaths.some(p => fs.existsSync(p));
34
+
35
+ if (found) {
36
+ console.log(`✅ Almadar CLI installed for ${platform}-${arch}`);
37
+ } else {
38
+ console.warn(`\n⚠️ Almadar CLI: Platform package ${packageName} not found`);
39
+ console.warn(' This may happen if optional dependencies were skipped.');
40
+ console.warn(' Try: npm install -g @almadar/cli --include=optional\n');
41
+ }
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Almadar Team
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,25 @@
1
+ # @almadar/shell
2
+
3
+ > Minimal full-stack shell template for Almadar applications
4
+
5
+ Part of the [Almadar](https://github.com/almadar-io/almadar) platform.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install @almadar/shell
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ```typescript
16
+ import { /* ... */ } from '@almadar/shell';
17
+ ```
18
+
19
+ ## API
20
+
21
+ <!-- Document public exports here -->
22
+
23
+ ## License
24
+
25
+ MIT
@@ -0,0 +1,120 @@
1
+ {
2
+ "$meta": { "locale": "en", "direction": "ltr" },
3
+
4
+ "common.save": "Save",
5
+ "common.cancel": "Cancel",
6
+ "common.delete": "Delete",
7
+ "common.close": "Close",
8
+ "common.confirm": "Are you sure?",
9
+ "common.create": "Create",
10
+ "common.edit": "Edit",
11
+ "common.view": "View",
12
+ "common.add": "Add",
13
+ "common.remove": "Remove",
14
+ "common.search": "Search...",
15
+ "common.filter": "Filter",
16
+ "common.actions": "Actions",
17
+ "common.yes": "Yes",
18
+ "common.no": "No",
19
+ "common.ok": "OK",
20
+ "common.done": "Done",
21
+ "common.apply": "Apply",
22
+ "common.reset": "Reset",
23
+ "common.refresh": "Refresh",
24
+ "common.export": "Export",
25
+ "common.import": "Import",
26
+ "common.copy": "Copy",
27
+ "common.settings": "Settings",
28
+
29
+ "nav.previous": "Previous",
30
+ "nav.next": "Next",
31
+ "nav.back": "Back",
32
+ "nav.home": "Home",
33
+
34
+ "form.submit": "Submit",
35
+ "form.saving": "Saving...",
36
+ "form.required": "This field is required",
37
+ "form.invalidEmail": "Enter a valid email address",
38
+ "form.selectPlaceholder": "Select {{label}}...",
39
+ "form.searchPlaceholder": "Search {{entity}}...",
40
+
41
+ "table.empty.title": "No items found",
42
+ "table.empty.description": "No items to display.",
43
+ "table.search.placeholder": "Search...",
44
+ "table.pagination.showing": "Showing {{start}} to {{end}} of {{total}} results",
45
+ "table.pagination.page": "Page {{page}} of {{totalPages}}",
46
+ "table.bulk.selected": "{{count}} selected",
47
+ "table.loading": "Loading...",
48
+
49
+ "status.loading": "Loading...",
50
+ "status.scheduled": "Scheduled",
51
+ "status.inProgress": "In Progress",
52
+ "status.completed": "Completed",
53
+ "status.cancelled": "Cancelled",
54
+ "status.pending": "Pending",
55
+ "status.active": "Active",
56
+ "status.inactive": "Inactive",
57
+ "status.draft": "Draft",
58
+ "status.archived": "Archived",
59
+
60
+ "error.generic": "Something went wrong",
61
+ "error.retry": "Try again",
62
+ "error.notFound": "Not found",
63
+ "error.loadFailed": "Failed to load: {{message}}",
64
+ "error.configMissing": "Configuration not found for: {{id}}",
65
+
66
+ "common.loading": "Loading...",
67
+ "common.showMore": "Show More",
68
+ "common.showLess": "Show Less",
69
+ "common.noResults": "No results found",
70
+ "common.saveChanges": "Save Changes",
71
+ "common.retry": "Retry",
72
+ "common.open": "Open",
73
+ "common.back": "Back",
74
+
75
+ "empty.noItems": "No items",
76
+ "empty.noData": "No data available",
77
+ "empty.noItemsYet": "No items yet",
78
+ "empty.noItemsAdded": "No items added yet",
79
+ "empty.noOptionsFound": "No options found",
80
+
81
+ "list.addItemPlaceholder": "Add new item...",
82
+
83
+ "error.occurred": "An error occurred",
84
+ "error.failedToLoad": "Failed to load data",
85
+
86
+ "wizard.back": "Back",
87
+ "wizard.next": "Next",
88
+ "wizard.complete": "Complete",
89
+ "wizard.stepOf": "Step {{current}} of {{total}}",
90
+
91
+ "pagination.previous": "Previous",
92
+ "pagination.next": "Next",
93
+ "pagination.total": "Total:",
94
+ "pagination.show": "Show:",
95
+ "pagination.goTo": "Go to:",
96
+ "pagination.go": "Go",
97
+
98
+ "auth.signIn": "Sign in",
99
+ "auth.signOut": "Sign out",
100
+
101
+ "dialog.confirm": "Confirm",
102
+ "dialog.cancel": "Cancel",
103
+ "dialog.loading": "Loading...",
104
+ "dialog.delete.title": "Delete {{item}}?",
105
+ "dialog.delete.message": "This action cannot be undone.",
106
+
107
+ "trait.availableActions": "Available Actions",
108
+ "trait.transitions": "Transitions",
109
+ "trait.availableNow": "Available now",
110
+
111
+ "book.startReading": "Start Reading",
112
+ "book.tableOfContents": "Table of Contents",
113
+ "book.partNumber": "Part {{number}}",
114
+ "book.print": "Print",
115
+ "book.previousPage": "Previous page",
116
+ "book.nextPage": "Next page",
117
+
118
+ "quiz.showAnswer": "Show answer",
119
+ "quiz.hideAnswer": "Hide answer"
120
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@almadar/shell",
3
+ "version": "2.1.3",
4
+ "private": true,
5
+ "description": "Minimal full-stack shell template for Almadar applications",
6
+ "packageManager": "pnpm@10.30.3",
7
+ "scripts": {
8
+ "dev": "npx concurrently -n client,server -c blue,green \"pnpm --filter @almadar/shell-client dev\" \"pnpm --filter @almadar/shell-server dev\"",
9
+ "build": "pnpm run -r build",
10
+ "typecheck": "turbo run typecheck",
11
+ "lint": "turbo run lint",
12
+ "prepare": "git config core.hooksPath .githooks"
13
+ },
14
+ "devDependencies": {
15
+ "concurrently": "^8.2.0",
16
+ "turbo": "^2.0.0"
17
+ },
18
+ "files": [
19
+ "dist"
20
+ ],
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "https://github.com/almadar-io/almadar-shell.git"
24
+ },
25
+ "publishConfig": {
26
+ "access": "public"
27
+ }
28
+ }
@@ -0,0 +1,23 @@
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", "**/*.test.tsx"] },
7
+ {
8
+ files: ["src/**/*.ts", "src/**/*.tsx"],
9
+ languageOptions: {
10
+ parser: tsParser,
11
+ parserOptions: {
12
+ ecmaFeatures: { jsx: true },
13
+ ecmaVersion: "latest",
14
+ sourceType: "module",
15
+ },
16
+ },
17
+ plugins: { almadar: almadarPlugin },
18
+ rules: {
19
+ "almadar/no-as-any": "error",
20
+ "almadar/no-import-generated": "error",
21
+ },
22
+ },
23
+ ];
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Almadar App</title>
8
+ </head>
9
+ <body>
10
+ <div id="root"></div>
11
+ <script type="module" src="/src/main.tsx"></script>
12
+ </body>
13
+ </html>
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@almadar/shell-client",
3
+ "version": "1.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "build": "tsc && vite build",
9
+ "typecheck": "tsc --noEmit",
10
+ "lint": "eslint src/",
11
+ "preview": "vite preview",
12
+ "test": "vitest run --passWithNoTests",
13
+ "test:watch": "vitest"
14
+ },
15
+ "dependencies": {
16
+ "@almadar/ui": "^2.6.0",
17
+ "@almadar/evaluator": "^2.0.0",
18
+ "@almadar/patterns": "^2.0.0",
19
+ "@almadar/core": "^2.1.0",
20
+ "firebase": "^11.4.0",
21
+ "@tanstack/react-query": "^5.67.3",
22
+ "react": "^18.3.1",
23
+ "react-dom": "^18.3.1",
24
+ "react-router-dom": "^7.3.0",
25
+ "zustand": "^5.0.3",
26
+ "react-markdown": "^9.0.1",
27
+ "remark-gfm": "^4.0.1",
28
+ "remark-math": "^6.0.0",
29
+ "rehype-katex": "^7.0.1",
30
+ "rehype-raw": "^7.0.0",
31
+ "react-force-graph-2d": "^1.25.5",
32
+ "@monaco-editor/react": "^4.7.0",
33
+ "monaco-editor": "^0.52.2",
34
+ "leaflet": "^1.9.4",
35
+ "react-leaflet": "^4.2.1",
36
+ "lucide-react": "^0.344.0"
37
+ },
38
+ "devDependencies": {
39
+ "@almadar/eslint-plugin": ">=2.3.0",
40
+ "@typescript-eslint/parser": "8.56.0",
41
+ "eslint": "10.0.0",
42
+ "@testing-library/react": "^16.1.0",
43
+ "@testing-library/jest-dom": "^6.6.3",
44
+ "@types/react": "^18.3.18",
45
+ "@types/react-dom": "^18.3.5",
46
+ "@vitejs/plugin-react": "^4.3.4",
47
+ "autoprefixer": "^10.4.20",
48
+ "jsdom": "^25.0.1",
49
+ "postcss": "^8.5.3",
50
+ "tailwindcss": "^3.4.17",
51
+ "typescript": "^5.7.3",
52
+ "vite": "^6.2.1",
53
+ "vitest": "^2.1.9"
54
+ }
55
+ }
@@ -0,0 +1,6 @@
1
+ export default {
2
+ plugins: {
3
+ tailwindcss: {},
4
+ autoprefixer: {},
5
+ },
6
+ }
@@ -0,0 +1,79 @@
1
+ /**
2
+ * App Entry Point
3
+ *
4
+ * Main application component with compiler-generated content placeholders.
5
+ * The Rust compiler replaces {{PLACEHOLDERS}} with generated code.
6
+ *
7
+ * Navigation works via schema-driven NavigationProvider:
8
+ * - NavigationProvider holds active page state
9
+ * - navigateTo() switches pages and fires INIT with payload
10
+ * - No dependency on react-router for internal navigation
11
+ * - react-router is optional for URL bookmarkability
12
+ */
13
+
14
+ import { BrowserRouter, Routes, Route } from 'react-router-dom';
15
+ import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
16
+ import { ThemeProvider, UISlotProvider } from '@almadar/ui/context';
17
+ import { UISlotComponent, NotifyListener } from '@almadar/ui/components';
18
+ import {
19
+ EventBusProvider,
20
+ VerificationProvider,
21
+ } from '@almadar/ui/providers';
22
+ import { NavigationProvider } from '@almadar/ui/renderer';
23
+ import { I18nProvider, createTranslate } from '@almadar/ui/hooks';
24
+
25
+ // {{GENERATED_I18N_IMPORT}}
26
+ // {{GENERATED_IMPORTS}}
27
+
28
+ // Generated schema import (compiler fills this in)
29
+ // {{GENERATED_SCHEMA_IMPORT}}
30
+ const schema = { name: 'app', orbitals: [] }; // Placeholder - replaced by compiler
31
+
32
+ // {{GENERATED_I18N_VALUE}}
33
+ const i18nValue = { locale: 'en', direction: 'ltr' as const, t: createTranslate({}) };
34
+
35
+ const queryClient = new QueryClient({
36
+ defaultOptions: {
37
+ queries: {
38
+ staleTime: 1000 * 60,
39
+ refetchOnWindowFocus: false,
40
+ },
41
+ },
42
+ });
43
+
44
+ function App() {
45
+ return (
46
+ <I18nProvider value={i18nValue}>
47
+ <QueryClientProvider client={queryClient}>
48
+ <ThemeProvider>
49
+ <EventBusProvider>
50
+ <VerificationProvider>
51
+ <UISlotProvider>
52
+ <NavigationProvider
53
+ schema={schema}
54
+ updateUrl={true}
55
+ onNavigate={(pageName, path, payload) => {
56
+ console.log('[App] Navigation:', { pageName, path, payload });
57
+ }}
58
+ >
59
+ <BrowserRouter>
60
+ <Routes>
61
+ {/* {{GENERATED_ROUTES}} */}
62
+ <Route path="/" element={<div>Welcome to Almadar</div>} />
63
+ </Routes>
64
+ {/* Portal slots rendered by compiled trait views via CompiledPortal */}
65
+ {/* Toast notifications (non-overlapping, always safe to render here) */}
66
+ <UISlotComponent slot="toast" portal />
67
+ <NotifyListener />
68
+ </BrowserRouter>
69
+ </NavigationProvider>
70
+ </UISlotProvider>
71
+ </VerificationProvider>
72
+ </EventBusProvider>
73
+ </ThemeProvider>
74
+ </QueryClientProvider>
75
+ </I18nProvider>
76
+ );
77
+ }
78
+
79
+ export default App;
@@ -0,0 +1,37 @@
1
+ import { initializeApp, getApps, getApp, FirebaseApp } from 'firebase/app';
2
+ import { getAuth, Auth } from 'firebase/auth';
3
+
4
+ let app: FirebaseApp;
5
+ let auth: Auth;
6
+
7
+ export async function initializeFirebase(): Promise<void> {
8
+ if (getApps().length > 0) {
9
+ app = getApp();
10
+ auth = getAuth(app);
11
+ return;
12
+ }
13
+
14
+ let config;
15
+ try {
16
+ // On Firebase Hosting, fetch auto-config from reserved URL
17
+ const res = await fetch('/__/firebase/init.json');
18
+ if (!res.ok) throw new Error(`HTTP ${res.status}`);
19
+ config = await res.json();
20
+ } catch {
21
+ // Fall back to env vars for local development
22
+ config = {
23
+ apiKey: import.meta.env.VITE_APP_FIREBASE_API_KEY,
24
+ authDomain: import.meta.env.VITE_APP_FIREBASE_AUTH_DOMAIN,
25
+ projectId: import.meta.env.VITE_APP_FIREBASE_PROJECT_ID,
26
+ storageBucket: import.meta.env.VITE_APP_FIREBASE_STORAGE_BUCKET,
27
+ messagingSenderId: import.meta.env.VITE_APP_FIREBASE_MESSAGING_SENDER_ID,
28
+ appId: import.meta.env.VITE_APP_FIREBASE_APP_ID,
29
+ measurementId: import.meta.env.VITE_APP_FIREBASE_MEASUREMENT_ID,
30
+ };
31
+ }
32
+
33
+ app = initializeApp(config);
34
+ auth = getAuth(app);
35
+ }
36
+
37
+ export { auth, app };