@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.
- package/README.md +45 -0
- package/bin/almadar +95 -0
- package/package.json +58 -0
- package/scripts/postinstall.js +41 -0
- package/shells/almadar-shell/LICENSE +21 -0
- package/shells/almadar-shell/README.md +25 -0
- package/shells/almadar-shell/locales/en.json +120 -0
- package/shells/almadar-shell/package.json +28 -0
- package/shells/almadar-shell/packages/client/eslint.config.cjs +23 -0
- package/shells/almadar-shell/packages/client/index.html +13 -0
- package/shells/almadar-shell/packages/client/package.json +55 -0
- package/shells/almadar-shell/packages/client/postcss.config.js +6 -0
- package/shells/almadar-shell/packages/client/src/App.tsx +79 -0
- package/shells/almadar-shell/packages/client/src/config/firebase.ts +37 -0
- package/shells/almadar-shell/packages/client/src/features/auth/AuthContext.tsx +139 -0
- package/shells/almadar-shell/packages/client/src/features/auth/authService.ts +83 -0
- package/shells/almadar-shell/packages/client/src/features/auth/components/Login.tsx +218 -0
- package/shells/almadar-shell/packages/client/src/features/auth/components/ProtectedRoute.tsx +27 -0
- package/shells/almadar-shell/packages/client/src/features/auth/components/UserProfile.tsx +68 -0
- package/shells/almadar-shell/packages/client/src/features/auth/components/index.ts +3 -0
- package/shells/almadar-shell/packages/client/src/features/auth/index.ts +13 -0
- package/shells/almadar-shell/packages/client/src/features/auth/types.ts +24 -0
- package/shells/almadar-shell/packages/client/src/index.css +35 -0
- package/shells/almadar-shell/packages/client/src/main.tsx +10 -0
- package/shells/almadar-shell/packages/client/src/navigation/index.ts +55 -0
- package/shells/almadar-shell/packages/client/src/pages/index.ts +12 -0
- package/shells/almadar-shell/packages/client/tailwind.config.js +12 -0
- package/shells/almadar-shell/packages/client/tsconfig.json +33 -0
- package/shells/almadar-shell/packages/client/vite.config.ts +49 -0
- package/shells/almadar-shell/packages/server/eslint.config.cjs +19 -0
- package/shells/almadar-shell/packages/server/package.json +37 -0
- package/shells/almadar-shell/packages/server/src/app.ts +36 -0
- package/shells/almadar-shell/packages/server/src/index.ts +30 -0
- package/shells/almadar-shell/packages/server/src/routes.ts +11 -0
- package/shells/almadar-shell/packages/server/src/types/express.d.ts +15 -0
- package/shells/almadar-shell/packages/server/tsconfig.json +23 -0
- package/shells/almadar-shell/packages/shared/package.json +10 -0
- package/shells/almadar-shell/packages/shared/src/index.ts +2 -0
- package/shells/almadar-shell/pnpm-lock.yaml +9724 -0
- package/shells/almadar-shell/pnpm-workspace.yaml +2 -0
- package/shells/almadar-shell/tsup.config.ts +13 -0
- package/shells/almadar-shell/turbo.json +17 -0
- package/shells/almadar-shell/vitest.config.ts +8 -0
- package/shells/orb-shell/LICENSE +21 -0
- package/shells/orb-shell/README.md +25 -0
- package/shells/orb-shell/locales/en.json +120 -0
- package/shells/orb-shell/package.json +35 -0
- package/shells/orb-shell/packages/client/eslint.config.cjs +23 -0
- package/shells/orb-shell/packages/client/index.html +13 -0
- package/shells/orb-shell/packages/client/package.json +55 -0
- package/shells/orb-shell/packages/client/postcss.config.js +6 -0
- package/shells/orb-shell/packages/client/src/App.tsx +79 -0
- package/shells/orb-shell/packages/client/src/config/firebase.ts +37 -0
- package/shells/orb-shell/packages/client/src/features/auth/AuthContext.tsx +139 -0
- package/shells/orb-shell/packages/client/src/features/auth/authService.ts +83 -0
- package/shells/orb-shell/packages/client/src/features/auth/components/Login.tsx +218 -0
- package/shells/orb-shell/packages/client/src/features/auth/components/ProtectedRoute.tsx +27 -0
- package/shells/orb-shell/packages/client/src/features/auth/components/UserProfile.tsx +68 -0
- package/shells/orb-shell/packages/client/src/features/auth/components/index.ts +3 -0
- package/shells/orb-shell/packages/client/src/features/auth/index.ts +13 -0
- package/shells/orb-shell/packages/client/src/features/auth/types.ts +24 -0
- package/shells/orb-shell/packages/client/src/index.css +35 -0
- package/shells/orb-shell/packages/client/src/main.tsx +10 -0
- package/shells/orb-shell/packages/client/src/navigation/index.ts +55 -0
- package/shells/orb-shell/packages/client/src/pages/index.ts +12 -0
- package/shells/orb-shell/packages/client/tailwind-preset.js +243 -0
- package/shells/orb-shell/packages/client/tailwind.config.js +15 -0
- package/shells/orb-shell/packages/client/tsconfig.json +33 -0
- package/shells/orb-shell/packages/client/vite.config.ts +49 -0
- package/shells/orb-shell/packages/server/eslint.config.cjs +19 -0
- package/shells/orb-shell/packages/server/package.json +37 -0
- package/shells/orb-shell/packages/server/src/app.ts +36 -0
- package/shells/orb-shell/packages/server/src/index.ts +30 -0
- package/shells/orb-shell/packages/server/src/routes.ts +11 -0
- package/shells/orb-shell/packages/server/src/types/express.d.ts +15 -0
- package/shells/orb-shell/packages/server/tsconfig.json +23 -0
- package/shells/orb-shell/packages/shared/package.json +10 -0
- package/shells/orb-shell/packages/shared/src/index.ts +2 -0
- package/shells/orb-shell/pnpm-lock.yaml +9247 -0
- package/shells/orb-shell/pnpm-workspace.yaml +2 -0
- package/shells/orb-shell/tsup.config.ts +13 -0
- package/shells/orb-shell/turbo.json +17 -0
- package/shells/orb-shell/vitest.config.ts +8 -0
|
@@ -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,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,49 @@
|
|
|
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
|
+
},
|
|
23
|
+
|
|
24
|
+
server: {
|
|
25
|
+
host: true,
|
|
26
|
+
port: 5173,
|
|
27
|
+
proxy: {
|
|
28
|
+
'/api': {
|
|
29
|
+
target: backendUrl,
|
|
30
|
+
changeOrigin: true,
|
|
31
|
+
},
|
|
32
|
+
'/ws': {
|
|
33
|
+
target: wsUrl,
|
|
34
|
+
ws: true,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
build: {
|
|
40
|
+
outDir: 'dist',
|
|
41
|
+
sourcemap: true,
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
test: {
|
|
45
|
+
environment: 'jsdom',
|
|
46
|
+
globals: true,
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
});
|
|
@@ -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,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,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
|
+
}
|