@almadar/shell 2.16.1 → 2.16.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 (54) hide show
  1. package/.env.example +17 -0
  2. package/.gitignore +31 -0
  3. package/locales/en.json +120 -0
  4. package/package.json +31 -9
  5. package/packages/client/eslint.config.cjs +56 -0
  6. package/packages/client/index.html +13 -0
  7. package/packages/client/node_modules/.bin/autoprefixer +21 -0
  8. package/packages/client/node_modules/.bin/eslint +21 -0
  9. package/packages/client/node_modules/.bin/tailwind +21 -0
  10. package/packages/client/node_modules/.bin/tailwindcss +21 -0
  11. package/packages/client/node_modules/.bin/tsc +21 -0
  12. package/packages/client/node_modules/.bin/tsserver +21 -0
  13. package/packages/client/node_modules/.bin/vite +21 -0
  14. package/packages/client/node_modules/.bin/vitest +21 -0
  15. package/packages/client/package.json +63 -0
  16. package/packages/client/postcss.config.js +6 -0
  17. package/packages/client/src/App.tsx +81 -0
  18. package/packages/client/src/config/firebase.ts +37 -0
  19. package/packages/client/src/features/auth/AuthContext.tsx +139 -0
  20. package/packages/client/src/features/auth/authService.ts +83 -0
  21. package/packages/client/src/features/auth/components/Login.tsx +218 -0
  22. package/packages/client/src/features/auth/components/ProtectedRoute.tsx +27 -0
  23. package/packages/client/src/features/auth/components/UserProfile.tsx +68 -0
  24. package/packages/client/src/features/auth/components/index.ts +3 -0
  25. package/packages/client/src/features/auth/index.ts +13 -0
  26. package/packages/client/src/features/auth/types.ts +24 -0
  27. package/packages/client/src/generated/index.ts +13 -0
  28. package/packages/client/src/index.css +19 -0
  29. package/packages/client/src/main.tsx +8 -0
  30. package/packages/client/src/navigation/index.ts +55 -0
  31. package/packages/client/src/pages/index.ts +12 -0
  32. package/packages/client/tailwind-preset.cjs +259 -0
  33. package/packages/client/tailwind.config.js +31 -0
  34. package/packages/client/tsconfig.json +33 -0
  35. package/packages/client/vite.config.ts +50 -0
  36. package/packages/server/eslint.config.cjs +23 -0
  37. package/packages/server/node_modules/.bin/esbuild +21 -0
  38. package/packages/server/node_modules/.bin/eslint +21 -0
  39. package/packages/server/node_modules/.bin/tsc +21 -0
  40. package/packages/server/node_modules/.bin/tsserver +21 -0
  41. package/packages/server/node_modules/.bin/tsx +21 -0
  42. package/packages/server/node_modules/.bin/vitest +21 -0
  43. package/packages/server/package.json +42 -0
  44. package/packages/server/pnpm-lock.yaml +4723 -0
  45. package/packages/server/src/app.ts +41 -0
  46. package/packages/server/src/index.ts +30 -0
  47. package/packages/server/src/routes.ts +11 -0
  48. package/packages/server/src/types/express.d.ts +17 -0
  49. package/packages/server/tsconfig.json +23 -0
  50. package/packages/shared/package.json +11 -0
  51. package/packages/shared/pnpm-lock.yaml +22 -0
  52. package/packages/shared/src/index.ts +2 -0
  53. package/pnpm-workspace.yaml +2 -0
  54. 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,11 @@
1
+ /**
2
+ * Route Registration
3
+ *
4
+ * Compiler generates route registration code here.
5
+ */
6
+
7
+ import type { Express } from 'express';
8
+
9
+ export function registerRoutes(app: Express): void {
10
+ // {{GENERATED_ROUTE_REGISTRATION}}
11
+ }
@@ -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,11 @@
1
+ {
2
+ "name": "@app/shared",
3
+ "version": "1.0.0",
4
+ "private": true,
5
+ "main": "src/index.ts",
6
+ "types": "src/index.ts",
7
+ "dependencies": {
8
+ "@almadar/core": "^7.14.3",
9
+ "zod": "^3.22.0"
10
+ }
11
+ }
@@ -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: {}
@@ -0,0 +1,2 @@
1
+ // Placeholder — the compiler generates actual shared types here.
2
+ export {};
@@ -0,0 +1,2 @@
1
+ packages:
2
+ - 'packages/*'
package/turbo.json ADDED
@@ -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
+ }