@almadar/cli-linux-x64 1.5.2 → 1.5.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/almadar +0 -0
- package/package.json +1 -1
- package/shells/almadar-shell/.env.example +12 -0
- package/shells/almadar-shell/almadar-shell/.env.example +12 -0
- package/shells/almadar-shell/almadar-shell/package.json +19 -0
- package/shells/almadar-shell/almadar-shell/packages/client/index.html +13 -0
- package/shells/almadar-shell/almadar-shell/packages/client/package.json +49 -0
- package/shells/almadar-shell/almadar-shell/packages/client/postcss.config.js +6 -0
- package/shells/almadar-shell/almadar-shell/packages/client/src/App.tsx +68 -0
- package/shells/almadar-shell/almadar-shell/packages/client/src/config/firebase.ts +37 -0
- package/shells/almadar-shell/almadar-shell/packages/client/src/features/auth/AuthContext.tsx +139 -0
- package/shells/almadar-shell/almadar-shell/packages/client/src/features/auth/authService.ts +83 -0
- package/shells/almadar-shell/almadar-shell/packages/client/src/features/auth/components/Login.tsx +218 -0
- package/shells/almadar-shell/almadar-shell/packages/client/src/features/auth/components/ProtectedRoute.tsx +27 -0
- package/shells/almadar-shell/almadar-shell/packages/client/src/features/auth/components/UserProfile.tsx +68 -0
- package/shells/almadar-shell/almadar-shell/packages/client/src/features/auth/components/index.ts +3 -0
- package/shells/almadar-shell/almadar-shell/packages/client/src/features/auth/index.ts +13 -0
- package/shells/almadar-shell/almadar-shell/packages/client/src/features/auth/types.ts +24 -0
- package/shells/almadar-shell/almadar-shell/packages/client/src/generated/index.ts +13 -0
- package/shells/almadar-shell/almadar-shell/packages/client/src/index.css +6 -0
- package/shells/almadar-shell/almadar-shell/packages/client/src/main.tsx +10 -0
- package/shells/almadar-shell/almadar-shell/packages/client/src/navigation/index.ts +55 -0
- package/shells/almadar-shell/almadar-shell/packages/client/src/pages/index.ts +12 -0
- package/shells/almadar-shell/almadar-shell/packages/client/tailwind.config.js +12 -0
- package/shells/almadar-shell/almadar-shell/packages/client/tsconfig.json +33 -0
- package/shells/almadar-shell/almadar-shell/packages/client/vite.config.ts +49 -0
- package/shells/almadar-shell/almadar-shell/packages/server/package.json +32 -0
- package/shells/almadar-shell/almadar-shell/packages/server/src/app.ts +36 -0
- package/shells/almadar-shell/almadar-shell/packages/server/src/index.ts +16 -0
- package/shells/almadar-shell/almadar-shell/packages/server/src/routes.ts +11 -0
- package/shells/almadar-shell/almadar-shell/packages/server/src/types/express.d.ts +15 -0
- package/shells/almadar-shell/almadar-shell/packages/server/tsconfig.json +23 -0
- package/shells/almadar-shell/almadar-shell/packages/shared/package.json +10 -0
- package/shells/almadar-shell/almadar-shell/packages/shared/src/index.ts +2 -0
- package/shells/almadar-shell/almadar-shell/turbo.json +17 -0
- package/shells/almadar-shell/package.json +19 -0
- package/shells/almadar-shell/packages/client/index.html +13 -0
- package/shells/almadar-shell/packages/client/package.json +49 -0
- package/shells/almadar-shell/packages/client/postcss.config.js +6 -0
- package/shells/almadar-shell/packages/client/src/App.tsx +68 -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/generated/index.ts +13 -0
- package/shells/almadar-shell/packages/client/src/index.css +6 -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/package.json +32 -0
- package/shells/almadar-shell/packages/server/src/app.ts +36 -0
- package/shells/almadar-shell/packages/server/src/index.ts +16 -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/turbo.json +17 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Navigate } from 'react-router-dom';
|
|
3
|
+
import { useAuthContext } from '../AuthContext';
|
|
4
|
+
|
|
5
|
+
interface ProtectedRouteProps {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const ProtectedRoute: React.FC<ProtectedRouteProps> = ({ children }) => {
|
|
10
|
+
const { user, loading } = useAuthContext();
|
|
11
|
+
|
|
12
|
+
if (loading) {
|
|
13
|
+
return (
|
|
14
|
+
<div className="min-h-screen flex items-center justify-center">
|
|
15
|
+
<div className="animate-spin rounded-full h-8 w-8 border-b-2 border-indigo-600" />
|
|
16
|
+
</div>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (!user) {
|
|
21
|
+
return <Navigate to="/login" replace />;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return <>{children}</>;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default ProtectedRoute;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React, { useState, useRef, useEffect } from 'react';
|
|
2
|
+
import { useAuthContext } from '../AuthContext';
|
|
3
|
+
|
|
4
|
+
const UserProfile: React.FC = () => {
|
|
5
|
+
const { user, loading, signOut } = useAuthContext();
|
|
6
|
+
const [open, setOpen] = useState(false);
|
|
7
|
+
const ref = useRef<HTMLDivElement>(null);
|
|
8
|
+
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
const handleClickOutside = (e: MouseEvent) => {
|
|
11
|
+
if (ref.current && !ref.current.contains(e.target as Node)) setOpen(false);
|
|
12
|
+
};
|
|
13
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
14
|
+
return () => document.removeEventListener('mousedown', handleClickOutside);
|
|
15
|
+
}, []);
|
|
16
|
+
|
|
17
|
+
if (!user) return null;
|
|
18
|
+
|
|
19
|
+
const handleSignOut = async () => {
|
|
20
|
+
setOpen(false);
|
|
21
|
+
await signOut();
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<div ref={ref} className="relative">
|
|
26
|
+
<button
|
|
27
|
+
onClick={() => setOpen(!open)}
|
|
28
|
+
className="flex items-center space-x-2 hover:opacity-80 transition-opacity"
|
|
29
|
+
>
|
|
30
|
+
{user.photoURL ? (
|
|
31
|
+
<img
|
|
32
|
+
className="h-8 w-8 rounded-full ring-2 ring-gray-200 dark:ring-gray-700"
|
|
33
|
+
src={user.photoURL}
|
|
34
|
+
alt={user.displayName || 'User'}
|
|
35
|
+
/>
|
|
36
|
+
) : (
|
|
37
|
+
<div className="h-8 w-8 rounded-full bg-gray-300 dark:bg-gray-600 flex items-center justify-center text-sm font-medium text-gray-600 dark:text-gray-300">
|
|
38
|
+
{(user.displayName || user.email || 'U')[0].toUpperCase()}
|
|
39
|
+
</div>
|
|
40
|
+
)}
|
|
41
|
+
</button>
|
|
42
|
+
|
|
43
|
+
{open && (
|
|
44
|
+
<div className="absolute right-0 mt-2 w-56 rounded-md shadow-lg bg-white dark:bg-gray-800 ring-1 ring-black/5 dark:ring-white/10 z-50">
|
|
45
|
+
<div className="px-4 py-3 border-b border-gray-100 dark:border-gray-700">
|
|
46
|
+
<p className="text-sm font-medium text-gray-900 dark:text-gray-100 truncate">
|
|
47
|
+
{user.displayName || 'User'}
|
|
48
|
+
</p>
|
|
49
|
+
<p className="text-sm text-gray-500 dark:text-gray-400 truncate">
|
|
50
|
+
{user.email}
|
|
51
|
+
</p>
|
|
52
|
+
</div>
|
|
53
|
+
<div className="py-1">
|
|
54
|
+
<button
|
|
55
|
+
onClick={handleSignOut}
|
|
56
|
+
disabled={loading}
|
|
57
|
+
className="w-full text-left px-4 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 disabled:opacity-50"
|
|
58
|
+
>
|
|
59
|
+
Sign Out
|
|
60
|
+
</button>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
)}
|
|
64
|
+
</div>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export default UserProfile;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Context
|
|
2
|
+
export { AuthProvider, useAuthContext } from './AuthContext';
|
|
3
|
+
|
|
4
|
+
// Components
|
|
5
|
+
export { default as Login } from './components/Login';
|
|
6
|
+
export { default as UserProfile } from './components/UserProfile';
|
|
7
|
+
export { default as ProtectedRoute } from './components/ProtectedRoute';
|
|
8
|
+
|
|
9
|
+
// Service
|
|
10
|
+
export { authService } from './authService';
|
|
11
|
+
|
|
12
|
+
// Types
|
|
13
|
+
export type { AuthContextType, LoginCredentials, SignUpCredentials } from './types';
|
|
@@ -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,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated Code Placeholder
|
|
3
|
+
*
|
|
4
|
+
* This directory receives compiler output:
|
|
5
|
+
* - Trait state machines
|
|
6
|
+
* - Entity schemas
|
|
7
|
+
* - Event handlers
|
|
8
|
+
*
|
|
9
|
+
* DO NOT EDIT - Contents are overwritten by compiler
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
// {{GENERATED_EXPORTS}}
|
|
13
|
+
export {};
|
|
@@ -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,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"],
|
|
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,32 @@
|
|
|
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": "tsc",
|
|
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": "^1.3.1",
|
|
17
|
+
"@almadar/evaluator": "^1.0.0",
|
|
18
|
+
"@almadar/core": "^1.0.0",
|
|
19
|
+
"cors": "^2.8.5",
|
|
20
|
+
"dotenv": "^16.4.0",
|
|
21
|
+
"express": "^4.21.0",
|
|
22
|
+
"firebase-admin": "^12.0.0"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@types/cors": "^2.8.17",
|
|
26
|
+
"@types/express": "^5.0.0",
|
|
27
|
+
"@types/node": "^20.0.0",
|
|
28
|
+
"tsx": "^4.19.0",
|
|
29
|
+
"typescript": "^5.7.0",
|
|
30
|
+
"vitest": "^2.1.0"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Express Application Setup
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import 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();
|
|
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,16 @@
|
|
|
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
|
+
app.listen(PORT, () => {
|
|
15
|
+
logger.info(`Server running on port ${PORT}`);
|
|
16
|
+
});
|
|
@@ -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"]
|
|
23
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://turbo.build/schema.json",
|
|
3
|
+
"tasks": {
|
|
4
|
+
"dev": {
|
|
5
|
+
"cache": false,
|
|
6
|
+
"persistent": true
|
|
7
|
+
},
|
|
8
|
+
"build": {
|
|
9
|
+
"dependsOn": ["^build"],
|
|
10
|
+
"outputs": ["dist/**"]
|
|
11
|
+
},
|
|
12
|
+
"typecheck": {
|
|
13
|
+
"dependsOn": ["^typecheck"]
|
|
14
|
+
},
|
|
15
|
+
"lint": {}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@almadar/shell",
|
|
3
|
+
"version": "1.0.14",
|
|
4
|
+
"private": true,
|
|
5
|
+
"description": "Minimal full-stack shell template for Almadar applications",
|
|
6
|
+
"workspaces": [
|
|
7
|
+
"packages/*"
|
|
8
|
+
],
|
|
9
|
+
"scripts": {
|
|
10
|
+
"dev": "npx concurrently -n client,server -c blue,green \"npm run dev -w packages/client\" \"npm run dev -w packages/server\"",
|
|
11
|
+
"build": "npm run build --workspaces --if-present",
|
|
12
|
+
"typecheck": "turbo run typecheck",
|
|
13
|
+
"lint": "turbo run lint"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"concurrently": "^8.2.0",
|
|
17
|
+
"turbo": "^2.0.0"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -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,49 @@
|
|
|
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": "^1.0.0",
|
|
17
|
+
"@almadar/evaluator": "^1.0.0",
|
|
18
|
+
"@almadar/patterns": "^1.0.0",
|
|
19
|
+
"@almadar/core": "^1.0.0",
|
|
20
|
+
"firebase": "^11.0.0",
|
|
21
|
+
"@tanstack/react-query": "^5.62.0",
|
|
22
|
+
"react": "^18.3.1",
|
|
23
|
+
"react-dom": "^18.3.1",
|
|
24
|
+
"react-router-dom": "^7.1.0",
|
|
25
|
+
"zustand": "^5.0.2",
|
|
26
|
+
"react-markdown": "^9.0.0",
|
|
27
|
+
"remark-gfm": "^4.0.0",
|
|
28
|
+
"remark-math": "^6.0.0",
|
|
29
|
+
"rehype-katex": "^7.0.0",
|
|
30
|
+
"rehype-raw": "^7.0.0",
|
|
31
|
+
"react-force-graph-2d": "^1.25.0",
|
|
32
|
+
"@monaco-editor/react": "^4.6.0",
|
|
33
|
+
"monaco-editor": "^0.52.0"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@testing-library/react": "^16.1.0",
|
|
37
|
+
"@testing-library/jest-dom": "^6.6.0",
|
|
38
|
+
"@types/react": "^18.3.0",
|
|
39
|
+
"@types/react-dom": "^18.3.0",
|
|
40
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
41
|
+
"autoprefixer": "^10.4.20",
|
|
42
|
+
"jsdom": "^25.0.0",
|
|
43
|
+
"postcss": "^8.4.49",
|
|
44
|
+
"tailwindcss": "^3.4.17",
|
|
45
|
+
"typescript": "^5.7.0",
|
|
46
|
+
"vite": "^6.0.0",
|
|
47
|
+
"vitest": "^2.1.0"
|
|
48
|
+
}
|
|
49
|
+
}
|