@almadar/shell 2.16.1 → 2.16.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 +17 -0
- package/.gitignore +31 -0
- package/locales/en.json +120 -0
- package/package.json +8 -2
- package/packages/client/dist/assets/index-B-wG_C4q.js +4157 -0
- package/packages/client/dist/assets/index-B-wG_C4q.js.map +1 -0
- package/packages/client/dist/assets/index-Ce2d2Q6W.js +7842 -0
- package/packages/client/dist/assets/index-Ce2d2Q6W.js.map +1 -0
- package/packages/client/dist/assets/index-DlMuyBNE.css +1 -0
- package/packages/client/dist/assets/index-x4KY6jHP.js +2 -0
- package/packages/client/dist/assets/index-x4KY6jHP.js.map +1 -0
- package/packages/client/dist/assets/leaflet-Dgihpmma.css +1 -0
- package/packages/client/dist/assets/leaflet-src-C9rI6ulw.js +5 -0
- package/packages/client/dist/assets/leaflet-src-C9rI6ulw.js.map +1 -0
- package/packages/client/dist/index.html +14 -0
- package/packages/client/eslint.config.cjs +56 -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.json +63 -0
- package/packages/client/postcss.config.js +6 -0
- package/packages/client/src/App.tsx +81 -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 +19 -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 +31 -0
- package/packages/client/tsconfig.json +33 -0
- package/packages/client/vite.config.ts +50 -0
- package/packages/server/dist/index.js +54 -0
- package/packages/server/eslint.config.cjs +23 -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 +42 -0
- package/packages/server/pnpm-lock.yaml +4723 -0
- package/packages/server/src/app.ts +41 -0
- package/packages/server/src/index.ts +30 -0
- package/packages/server/src/routes.ts +11 -0
- package/packages/server/src/types/express.d.ts +17 -0
- package/packages/server/tsconfig.json +23 -0
- package/packages/shared/package.json +11 -0
- package/packages/shared/pnpm-lock.yaml +22 -0
- package/packages/shared/src/index.ts +2 -0
- package/pnpm-lock.yaml +8937 -0
- package/pnpm-workspace.yaml +2 -0
- package/turbo.json +17 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Express Application Setup
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import express, { type Express } from 'express';
|
|
6
|
+
import cors from 'cors';
|
|
7
|
+
import helmet from 'helmet';
|
|
8
|
+
import rateLimit from 'express-rate-limit';
|
|
9
|
+
import {
|
|
10
|
+
env,
|
|
11
|
+
logger,
|
|
12
|
+
errorHandler,
|
|
13
|
+
notFoundHandler,
|
|
14
|
+
debugEventsRouter,
|
|
15
|
+
} from '@almadar/server';
|
|
16
|
+
import { registerRoutes } from './routes.js';
|
|
17
|
+
|
|
18
|
+
export const app: Express = express();
|
|
19
|
+
|
|
20
|
+
// Middleware
|
|
21
|
+
app.use(helmet());
|
|
22
|
+
// CORS: env-driven allowlist (CORS_ORIGIN) — never reflect arbitrary origins with credentials.
|
|
23
|
+
app.use(cors({ origin: env.CORS_ORIGIN, credentials: true }));
|
|
24
|
+
app.use(express.json({ limit: '1mb' }));
|
|
25
|
+
app.use(express.urlencoded({ extended: true, limit: '1mb' }));
|
|
26
|
+
app.use('/api', rateLimit({ windowMs: 15 * 60 * 1000, max: 300, standardHeaders: true, legacyHeaders: false }));
|
|
27
|
+
|
|
28
|
+
// Health check
|
|
29
|
+
app.get('/health', (_req, res) => {
|
|
30
|
+
res.json({ status: 'ok' });
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
// Debug event bus endpoints (dev-only, no-op in production)
|
|
34
|
+
app.use('/api/debug', debugEventsRouter());
|
|
35
|
+
|
|
36
|
+
// Register generated routes
|
|
37
|
+
registerRoutes(app);
|
|
38
|
+
|
|
39
|
+
// Error handling
|
|
40
|
+
app.use(notFoundHandler);
|
|
41
|
+
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,17 @@
|
|
|
1
|
+
import type { EventPayloadValue } from '@almadar/core';
|
|
2
|
+
|
|
3
|
+
declare global {
|
|
4
|
+
namespace Express {
|
|
5
|
+
interface Request {
|
|
6
|
+
firebaseUser?: {
|
|
7
|
+
uid: string;
|
|
8
|
+
email?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
picture?: string;
|
|
11
|
+
[key: string]: EventPayloadValue;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
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,22 @@
|
|
|
1
|
+
lockfileVersion: '9.0'
|
|
2
|
+
|
|
3
|
+
settings:
|
|
4
|
+
autoInstallPeers: true
|
|
5
|
+
excludeLinksFromLockfile: false
|
|
6
|
+
|
|
7
|
+
importers:
|
|
8
|
+
|
|
9
|
+
.:
|
|
10
|
+
dependencies:
|
|
11
|
+
zod:
|
|
12
|
+
specifier: ^3.22.0
|
|
13
|
+
version: 3.25.76
|
|
14
|
+
|
|
15
|
+
packages:
|
|
16
|
+
|
|
17
|
+
zod@3.25.76:
|
|
18
|
+
resolution: {integrity: sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==}
|
|
19
|
+
|
|
20
|
+
snapshots:
|
|
21
|
+
|
|
22
|
+
zod@3.25.76: {}
|