@almadar/shell-hono 0.1.3
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/.env.example +12 -0
- package/.gitignore +4 -0
- package/LICENSE +72 -0
- package/README.md +25 -0
- package/locales/en.json +120 -0
- package/package.json +36 -0
- package/packages/client/eslint.config.cjs +23 -0
- package/packages/client/index.html +13 -0
- package/packages/client/node_modules/.bin/autoprefixer +21 -0
- package/packages/client/node_modules/.bin/eslint +21 -0
- package/packages/client/node_modules/.bin/tailwind +21 -0
- package/packages/client/node_modules/.bin/tailwindcss +21 -0
- package/packages/client/node_modules/.bin/tsc +21 -0
- package/packages/client/node_modules/.bin/tsserver +21 -0
- package/packages/client/node_modules/.bin/vite +21 -0
- package/packages/client/node_modules/.bin/vitest +21 -0
- package/packages/client/package-lock.json +9750 -0
- package/packages/client/package.json +61 -0
- package/packages/client/postcss.config.js +6 -0
- package/packages/client/src/App.tsx +84 -0
- package/packages/client/src/config/firebase.ts +37 -0
- package/packages/client/src/features/auth/AuthContext.tsx +139 -0
- package/packages/client/src/features/auth/authService.ts +83 -0
- package/packages/client/src/features/auth/components/Login.tsx +218 -0
- package/packages/client/src/features/auth/components/ProtectedRoute.tsx +27 -0
- package/packages/client/src/features/auth/components/UserProfile.tsx +68 -0
- package/packages/client/src/features/auth/components/index.ts +3 -0
- package/packages/client/src/features/auth/index.ts +13 -0
- package/packages/client/src/features/auth/types.ts +24 -0
- package/packages/client/src/generated/index.ts +13 -0
- package/packages/client/src/index.css +35 -0
- package/packages/client/src/main.tsx +8 -0
- package/packages/client/src/navigation/index.ts +55 -0
- package/packages/client/src/pages/index.ts +12 -0
- package/packages/client/tailwind-preset.cjs +259 -0
- package/packages/client/tailwind.config.js +24 -0
- package/packages/client/tsconfig.json +33 -0
- package/packages/client/vite.config.ts +50 -0
- package/packages/server/eslint.config.cjs +19 -0
- package/packages/server/node_modules/.bin/esbuild +21 -0
- package/packages/server/node_modules/.bin/eslint +21 -0
- package/packages/server/node_modules/.bin/tsc +21 -0
- package/packages/server/node_modules/.bin/tsserver +21 -0
- package/packages/server/node_modules/.bin/tsx +21 -0
- package/packages/server/node_modules/.bin/vitest +21 -0
- package/packages/server/package.json +38 -0
- package/packages/server/pnpm-lock.yaml +4665 -0
- package/packages/server/src/app.ts +31 -0
- package/packages/server/src/index.ts +31 -0
- package/packages/server/src/routes.ts +12 -0
- package/packages/server/src/serve.ts +45 -0
- package/packages/server/tsconfig.json +23 -0
- package/packages/shared/node_modules/.bin/tsc +21 -0
- package/packages/shared/node_modules/.bin/tsserver +21 -0
- package/packages/shared/node_modules/.bin/tsup +21 -0
- package/packages/shared/node_modules/.bin/tsup-node +21 -0
- package/packages/shared/package.json +25 -0
- package/packages/shared/pnpm-lock.yaml +919 -0
- package/packages/shared/src/index.ts +2 -0
- package/packages/shared/tsconfig.json +17 -0
- package/packages/shared/tsup.config.ts +10 -0
- package/pnpm-workspace.yaml +2 -0
- package/turbo.json +17 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hono Application Setup
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { Hono } from 'hono';
|
|
6
|
+
import { cors } from 'hono/cors';
|
|
7
|
+
import {
|
|
8
|
+
errorHandler,
|
|
9
|
+
notFoundHandler,
|
|
10
|
+
debugEventsRouter,
|
|
11
|
+
type AppEnv,
|
|
12
|
+
} from '@almadar/server-hono';
|
|
13
|
+
import { registerRoutes } from './routes.js';
|
|
14
|
+
|
|
15
|
+
export const app = new Hono<AppEnv>();
|
|
16
|
+
|
|
17
|
+
// Middleware
|
|
18
|
+
app.use('*', cors({ origin: (origin) => origin, credentials: true }));
|
|
19
|
+
|
|
20
|
+
// Health check
|
|
21
|
+
app.get('/health', (c) => c.json({ status: 'ok' }));
|
|
22
|
+
|
|
23
|
+
// Debug event bus endpoints (dev-only, no-op in production)
|
|
24
|
+
app.route('/api/debug', debugEventsRouter());
|
|
25
|
+
|
|
26
|
+
// Register generated routes
|
|
27
|
+
registerRoutes(app);
|
|
28
|
+
|
|
29
|
+
// Error handling
|
|
30
|
+
app.notFound(notFoundHandler);
|
|
31
|
+
app.onError(errorHandler);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server Entry Point
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { initializeFirebase, env, logger } from '@almadar/server-hono';
|
|
6
|
+
|
|
7
|
+
// Initialize Firebase before anything else uses it
|
|
8
|
+
initializeFirebase();
|
|
9
|
+
|
|
10
|
+
import { serve } from '@hono/node-server';
|
|
11
|
+
import { app } from './app.js';
|
|
12
|
+
|
|
13
|
+
const PORT = env.PORT || 3030;
|
|
14
|
+
|
|
15
|
+
async function start(): Promise<void> {
|
|
16
|
+
// Seed mock data when USE_MOCK_DATA is enabled
|
|
17
|
+
if (env.USE_MOCK_DATA) {
|
|
18
|
+
try {
|
|
19
|
+
const { initializeMockData } = await import(/* @vite-ignore */ './seedMockData.js' as string);
|
|
20
|
+
await initializeMockData();
|
|
21
|
+
} catch {
|
|
22
|
+
logger.warn('seedMockData.ts not found - skipping mock data seeding');
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
serve({ fetch: app.fetch, port: PORT }, () => {
|
|
27
|
+
logger.info(`Server running on port ${PORT}`);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
start();
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Route Registration
|
|
3
|
+
*
|
|
4
|
+
* Compiler generates route registration code here.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { Hono } from 'hono';
|
|
8
|
+
import type { AppEnv } from '@almadar/server-hono';
|
|
9
|
+
|
|
10
|
+
export function registerRoutes(_app: Hono<AppEnv>): void {
|
|
11
|
+
// {{GENERATED_ROUTE_REGISTRATION}}
|
|
12
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bun-native server entry point for `orb serve`
|
|
3
|
+
*
|
|
4
|
+
* Serves both the Hono API and the built client static files.
|
|
5
|
+
* No @hono/node-server needed: Bun serves Hono natively.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { env, logger } from '@almadar/server-hono';
|
|
11
|
+
import { app } from './app.js';
|
|
12
|
+
import { serveStatic } from 'hono/bun';
|
|
13
|
+
import { join } from 'path';
|
|
14
|
+
|
|
15
|
+
const PORT = Number(env.PORT) || 3030;
|
|
16
|
+
const clientDist = join(import.meta.dir, '../../client/dist');
|
|
17
|
+
|
|
18
|
+
// Seed mock data
|
|
19
|
+
if (env.USE_MOCK_DATA || env.NODE_ENV !== 'production') {
|
|
20
|
+
try {
|
|
21
|
+
const { initializeMockData } = await import(/* @vite-ignore */ './seedMockData.js' as string);
|
|
22
|
+
await initializeMockData();
|
|
23
|
+
} catch {
|
|
24
|
+
logger.warn('seedMockData.ts not found - skipping mock data seeding');
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Serve built client static files
|
|
29
|
+
app.use('/*', serveStatic({ root: clientDist }));
|
|
30
|
+
|
|
31
|
+
// SPA fallback: serve index.html for client-side routes
|
|
32
|
+
app.get('*', async (c) => {
|
|
33
|
+
const file = Bun.file(join(clientDist, 'index.html'));
|
|
34
|
+
if (await file.exists()) {
|
|
35
|
+
return c.html(await file.text());
|
|
36
|
+
}
|
|
37
|
+
return c.json({ error: 'Client not built' }, 404);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
logger.info(`Server running on http://localhost:${PORT}`);
|
|
41
|
+
|
|
42
|
+
export default {
|
|
43
|
+
fetch: app.fetch,
|
|
44
|
+
port: PORT,
|
|
45
|
+
};
|
|
@@ -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,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/home/osamah/kflow.ai.builder/orbital-rust/packages/almadar-shell-hono/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/osamah/kflow.ai.builder/orbital-rust/packages/almadar-shell-hono/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/osamah/kflow.ai.builder/orbital-rust/packages/almadar-shell-hono/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/home/osamah/kflow.ai.builder/orbital-rust/packages/almadar-shell-hono/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/osamah/kflow.ai.builder/orbital-rust/packages/almadar-shell-hono/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/osamah/kflow.ai.builder/orbital-rust/packages/almadar-shell-hono/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../typescript/bin/tsc" "$@"
|
|
21
|
+
fi
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/home/osamah/kflow.ai.builder/orbital-rust/packages/almadar-shell-hono/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/osamah/kflow.ai.builder/orbital-rust/packages/almadar-shell-hono/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/osamah/kflow.ai.builder/orbital-rust/packages/almadar-shell-hono/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/home/osamah/kflow.ai.builder/orbital-rust/packages/almadar-shell-hono/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/osamah/kflow.ai.builder/orbital-rust/packages/almadar-shell-hono/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/osamah/kflow.ai.builder/orbital-rust/packages/almadar-shell-hono/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../typescript/bin/tsserver" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../typescript/bin/tsserver" "$@"
|
|
21
|
+
fi
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/home/osamah/kflow.ai.builder/orbital-rust/packages/almadar-shell-hono/node_modules/.pnpm/tsup@8.5.1_jiti@1.21.7_postcss@8.5.8_tsx@4.21.0_typescript@5.9.3/node_modules/tsup/node_modules:/home/osamah/kflow.ai.builder/orbital-rust/packages/almadar-shell-hono/node_modules/.pnpm/tsup@8.5.1_jiti@1.21.7_postcss@8.5.8_tsx@4.21.0_typescript@5.9.3/node_modules:/home/osamah/kflow.ai.builder/orbital-rust/packages/almadar-shell-hono/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/home/osamah/kflow.ai.builder/orbital-rust/packages/almadar-shell-hono/node_modules/.pnpm/tsup@8.5.1_jiti@1.21.7_postcss@8.5.8_tsx@4.21.0_typescript@5.9.3/node_modules/tsup/node_modules:/home/osamah/kflow.ai.builder/orbital-rust/packages/almadar-shell-hono/node_modules/.pnpm/tsup@8.5.1_jiti@1.21.7_postcss@8.5.8_tsx@4.21.0_typescript@5.9.3/node_modules:/home/osamah/kflow.ai.builder/orbital-rust/packages/almadar-shell-hono/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../tsup/dist/cli-default.js" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../tsup/dist/cli-default.js" "$@"
|
|
21
|
+
fi
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/home/osamah/kflow.ai.builder/orbital-rust/packages/almadar-shell-hono/node_modules/.pnpm/tsup@8.5.1_jiti@1.21.7_postcss@8.5.8_tsx@4.21.0_typescript@5.9.3/node_modules/tsup/node_modules:/home/osamah/kflow.ai.builder/orbital-rust/packages/almadar-shell-hono/node_modules/.pnpm/tsup@8.5.1_jiti@1.21.7_postcss@8.5.8_tsx@4.21.0_typescript@5.9.3/node_modules:/home/osamah/kflow.ai.builder/orbital-rust/packages/almadar-shell-hono/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/home/osamah/kflow.ai.builder/orbital-rust/packages/almadar-shell-hono/node_modules/.pnpm/tsup@8.5.1_jiti@1.21.7_postcss@8.5.8_tsx@4.21.0_typescript@5.9.3/node_modules/tsup/node_modules:/home/osamah/kflow.ai.builder/orbital-rust/packages/almadar-shell-hono/node_modules/.pnpm/tsup@8.5.1_jiti@1.21.7_postcss@8.5.8_tsx@4.21.0_typescript@5.9.3/node_modules:/home/osamah/kflow.ai.builder/orbital-rust/packages/almadar-shell-hono/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../tsup/dist/cli-node.js" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../tsup/dist/cli-node.js" "$@"
|
|
21
|
+
fi
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@almadar/shell-hono-shared",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsup",
|
|
16
|
+
"dev": "tsup --watch"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"zod": "^3.22.0"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"tsup": "^8.0.0",
|
|
23
|
+
"typescript": "^5.7.0"
|
|
24
|
+
}
|
|
25
|
+
}
|