create-fluxstack 1.12.1 → 1.14.0

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 (116) hide show
  1. package/LLMD/INDEX.md +8 -1
  2. package/LLMD/agent.md +867 -0
  3. package/LLMD/config/environment-vars.md +30 -0
  4. package/LLMD/patterns/anti-patterns.md +100 -0
  5. package/LLMD/reference/routing.md +39 -39
  6. package/LLMD/resources/live-auth.md +465 -0
  7. package/LLMD/resources/live-components.md +168 -26
  8. package/LLMD/resources/live-logging.md +220 -0
  9. package/LLMD/resources/live-upload.md +59 -8
  10. package/LLMD/resources/rest-auth.md +290 -0
  11. package/README.md +520 -340
  12. package/app/client/index.html +2 -2
  13. package/app/client/public/favicon.svg +46 -0
  14. package/app/client/src/App.tsx +13 -1
  15. package/app/client/src/assets/fluxstack-static.svg +46 -0
  16. package/app/client/src/assets/fluxstack.svg +183 -0
  17. package/app/client/src/components/AppLayout.tsx +139 -9
  18. package/app/client/src/components/BackButton.tsx +13 -13
  19. package/app/client/src/components/DemoPage.tsx +4 -4
  20. package/app/client/src/live/AuthDemo.tsx +334 -0
  21. package/app/client/src/live/ChatDemo.tsx +2 -2
  22. package/app/client/src/live/CounterDemo.tsx +12 -12
  23. package/app/client/src/live/FormDemo.tsx +2 -2
  24. package/app/client/src/live/LiveDebuggerPanel.tsx +779 -0
  25. package/app/client/src/live/RoomChatDemo.tsx +24 -16
  26. package/app/client/src/main.tsx +13 -13
  27. package/app/client/src/pages/ApiTestPage.tsx +6 -6
  28. package/app/client/src/pages/HomePage.tsx +80 -52
  29. package/app/server/auth/AuthManager.ts +213 -0
  30. package/app/server/auth/DevAuthProvider.ts +66 -0
  31. package/app/server/auth/HashManager.ts +123 -0
  32. package/app/server/auth/JWTAuthProvider.example.ts +101 -0
  33. package/app/server/auth/RateLimiter.ts +106 -0
  34. package/app/server/auth/contracts.ts +192 -0
  35. package/app/server/auth/guards/SessionGuard.ts +167 -0
  36. package/app/server/auth/guards/TokenGuard.ts +202 -0
  37. package/app/server/auth/index.ts +174 -0
  38. package/app/server/auth/middleware.ts +163 -0
  39. package/app/server/auth/providers/InMemoryProvider.ts +162 -0
  40. package/app/server/auth/sessions/SessionManager.ts +164 -0
  41. package/app/server/cache/CacheManager.ts +81 -0
  42. package/app/server/cache/MemoryDriver.ts +112 -0
  43. package/app/server/cache/contracts.ts +49 -0
  44. package/app/server/cache/index.ts +42 -0
  45. package/app/server/index.ts +14 -0
  46. package/app/server/live/LiveAdminPanel.ts +174 -0
  47. package/app/server/live/LiveChat.ts +78 -77
  48. package/app/server/live/LiveCounter.ts +1 -0
  49. package/app/server/live/LiveForm.ts +1 -0
  50. package/app/server/live/LiveLocalCounter.ts +38 -32
  51. package/app/server/live/LiveProtectedChat.ts +151 -0
  52. package/app/server/live/LiveRoomChat.ts +1 -0
  53. package/app/server/live/LiveUpload.ts +1 -0
  54. package/app/server/live/register-components.ts +19 -19
  55. package/app/server/routes/auth.routes.ts +278 -0
  56. package/app/server/routes/index.ts +2 -0
  57. package/config/index.ts +8 -0
  58. package/config/system/auth.config.ts +49 -0
  59. package/config/system/runtime.config.ts +4 -0
  60. package/config/system/session.config.ts +33 -0
  61. package/core/build/optimizer.ts +235 -235
  62. package/core/client/LiveComponentsProvider.tsx +76 -5
  63. package/core/client/components/Live.tsx +17 -10
  64. package/core/client/components/LiveDebugger.tsx +1324 -0
  65. package/core/client/hooks/AdaptiveChunkSizer.ts +215 -215
  66. package/core/client/hooks/useLiveComponent.ts +58 -5
  67. package/core/client/hooks/useLiveDebugger.ts +392 -0
  68. package/core/client/index.ts +16 -1
  69. package/core/framework/server.ts +36 -4
  70. package/core/plugins/built-in/index.ts +134 -134
  71. package/core/plugins/built-in/live-components/commands/create-live-component.ts +19 -8
  72. package/core/plugins/built-in/monitoring/index.ts +10 -3
  73. package/core/plugins/built-in/vite/index.ts +151 -20
  74. package/core/plugins/config.ts +5 -4
  75. package/core/plugins/discovery.ts +11 -2
  76. package/core/plugins/manager.ts +11 -5
  77. package/core/plugins/module-resolver.ts +1 -1
  78. package/core/plugins/registry.ts +53 -25
  79. package/core/server/index.ts +15 -15
  80. package/core/server/live/ComponentRegistry.ts +134 -50
  81. package/core/server/live/FileUploadManager.ts +188 -24
  82. package/core/server/live/LiveComponentPerformanceMonitor.ts +9 -8
  83. package/core/server/live/LiveDebugger.ts +462 -0
  84. package/core/server/live/LiveLogger.ts +144 -0
  85. package/core/server/live/LiveRoomManager.ts +22 -5
  86. package/core/server/live/StateSignature.ts +704 -643
  87. package/core/server/live/WebSocketConnectionManager.ts +11 -10
  88. package/core/server/live/auth/LiveAuthContext.ts +71 -0
  89. package/core/server/live/auth/LiveAuthManager.ts +304 -0
  90. package/core/server/live/auth/index.ts +19 -0
  91. package/core/server/live/auth/types.ts +179 -0
  92. package/core/server/live/auto-generated-components.ts +8 -2
  93. package/core/server/live/index.ts +16 -0
  94. package/core/server/live/websocket-plugin.ts +323 -22
  95. package/core/server/plugins/static-files-plugin.ts +179 -69
  96. package/core/templates/create-project.ts +0 -3
  97. package/core/types/build.ts +219 -219
  98. package/core/types/plugin.ts +107 -107
  99. package/core/types/types.ts +278 -22
  100. package/core/utils/index.ts +17 -17
  101. package/core/utils/logger/index.ts +5 -2
  102. package/core/utils/logger/startup-banner.ts +82 -82
  103. package/core/utils/version.ts +6 -6
  104. package/package.json +1 -8
  105. package/plugins/crypto-auth/index.ts +6 -0
  106. package/plugins/crypto-auth/server/CryptoAuthLiveProvider.ts +58 -0
  107. package/plugins/crypto-auth/server/index.ts +24 -21
  108. package/rest-tests/README.md +57 -0
  109. package/rest-tests/auth-token.http +113 -0
  110. package/rest-tests/auth.http +112 -0
  111. package/rest-tests/rooms-token.http +69 -0
  112. package/rest-tests/users-token.http +62 -0
  113. package/.dockerignore +0 -81
  114. package/Dockerfile +0 -70
  115. package/LIVE_COMPONENTS_REVIEW.md +0 -781
  116. package/app/client/src/assets/react.svg +0 -1
@@ -0,0 +1,69 @@
1
+ @base = http://localhost:3000/api
2
+
3
+ # =============================================
4
+ # Rooms API - Bearer Token Guard
5
+ # =============================================
6
+ # Requer: AUTH_DEFAULT_GUARD=token no .env
7
+ # Execute o login antes para obter o token
8
+ # =============================================
9
+
10
+ ### ===== Login (obter token) =====
11
+ # @name login
12
+
13
+ POST {{base}}/auth/login
14
+ Content-Type: application/json
15
+
16
+ {
17
+ "email": "john@example.com",
18
+ "password": "secret123"
19
+ }
20
+
21
+ ### ===== Enviar mensagem para sala =====
22
+
23
+ POST {{base}}/rooms/geral/messages
24
+ Content-Type: application/json
25
+ Authorization: Bearer {{login.response.body.token}}
26
+
27
+ {
28
+ "user": "John",
29
+ "text": "Hello from REST Client!"
30
+ }
31
+
32
+ ### ===== Enviar mensagem para outra sala =====
33
+
34
+ POST {{base}}/rooms/tech/messages
35
+ Content-Type: application/json
36
+ Authorization: Bearer {{login.response.body.token}}
37
+
38
+ {
39
+ "user": "John",
40
+ "text": "Discussing tech topics"
41
+ }
42
+
43
+ ### ===== Emitir evento customizado =====
44
+
45
+ POST {{base}}/rooms/geral/emit
46
+ Content-Type: application/json
47
+ Authorization: Bearer {{login.response.body.token}}
48
+
49
+ {
50
+ "event": "notification",
51
+ "data": {
52
+ "type": "alert",
53
+ "message": "System update scheduled"
54
+ }
55
+ }
56
+
57
+ ### ===== Emitir evento de typing =====
58
+
59
+ POST {{base}}/rooms/geral/emit
60
+ Content-Type: application/json
61
+ Authorization: Bearer {{login.response.body.token}}
62
+
63
+ {
64
+ "event": "user:typing",
65
+ "data": {
66
+ "user": "John",
67
+ "typing": true
68
+ }
69
+ }
@@ -0,0 +1,62 @@
1
+ @base = http://localhost:3000/api
2
+
3
+ # =============================================
4
+ # Users CRUD - Bearer Token Guard
5
+ # =============================================
6
+ # Requer: AUTH_DEFAULT_GUARD=token no .env
7
+ # Execute o login antes para obter o token
8
+ # =============================================
9
+
10
+ ### ===== Login (obter token) =====
11
+ # @name login
12
+
13
+ POST {{base}}/auth/login
14
+ Content-Type: application/json
15
+
16
+ {
17
+ "email": "john@example.com",
18
+ "password": "secret123"
19
+ }
20
+
21
+ ### ===== Listar usuários =====
22
+
23
+ GET {{base}}/users
24
+ Authorization: Bearer {{login.response.body.token}}
25
+
26
+ ### ===== Criar usuário =====
27
+ # @name createUser
28
+
29
+ POST {{base}}/users
30
+ Content-Type: application/json
31
+ Authorization: Bearer {{login.response.body.token}}
32
+
33
+ {
34
+ "name": "New User",
35
+ "email": "new@example.com"
36
+ }
37
+
38
+ ### ===== Buscar usuário por ID =====
39
+
40
+ GET {{base}}/users/1
41
+ Authorization: Bearer {{login.response.body.token}}
42
+
43
+ ### ===== Atualizar usuário =====
44
+
45
+ PUT {{base}}/users/1
46
+ Content-Type: application/json
47
+ Authorization: Bearer {{login.response.body.token}}
48
+
49
+ {
50
+ "name": "John Updated",
51
+ "email": "john.updated@example.com"
52
+ }
53
+
54
+ ### ===== Deletar usuário =====
55
+
56
+ DELETE {{base}}/users/1
57
+ Authorization: Bearer {{login.response.body.token}}
58
+
59
+ ### ===== Listar após delete =====
60
+
61
+ GET {{base}}/users
62
+ Authorization: Bearer {{login.response.body.token}}
package/.dockerignore DELETED
@@ -1,81 +0,0 @@
1
- # =====================================
2
- # FluxStack Docker Ignore
3
- # =====================================
4
-
5
- # Node modules (will be installed in container)
6
- node_modules/
7
- **/node_modules/
8
-
9
- # Build artifacts (will be built in container)
10
- dist/
11
- **/dist/
12
-
13
- # Development files
14
- .git/
15
- .github/
16
- .vscode/
17
- .idea/
18
-
19
- # Environment files
20
- .env
21
- .env.*
22
- !.env.example
23
-
24
- # Logs
25
- logs/
26
- *.log
27
- npm-debug.log*
28
- yarn-debug.log*
29
- yarn-error.log*
30
- bun-debug.log*
31
- lerna-debug.log*
32
-
33
- # Testing
34
- coverage/
35
- .nyc_output/
36
- **/__tests__/
37
- **/*.test.ts
38
- **/*.test.tsx
39
- **/*.spec.ts
40
- **/*.spec.tsx
41
-
42
- # Documentation
43
- *.md
44
- !README.md
45
- ai-context/
46
- docs/
47
-
48
- # Development tools
49
- .eslintrc*
50
- .prettierrc*
51
- vitest.config.ts
52
- # Note: tsconfig.json is needed for Bun path alias resolution during build
53
-
54
- # OS files
55
- .DS_Store
56
- Thumbs.db
57
-
58
- # Temporary files
59
- tmp/
60
- temp/
61
- *.tmp
62
- *.swp
63
- *.swo
64
- *~
65
-
66
- # Lock files (exclude other package managers, keep bun.lock)
67
- package-lock.json
68
- yarn.lock
69
- pnpm-lock.yaml
70
-
71
- # CI/CD
72
- .github/
73
-
74
- # Editor directories
75
- .vscode/
76
- .idea/
77
- *.suo
78
- *.ntvs*
79
- *.njsproj
80
- *.sln
81
- *.sw?
package/Dockerfile DELETED
@@ -1,70 +0,0 @@
1
- # FluxStack Production Dockerfile
2
- # Multi-stage build for optimized production image
3
-
4
- # =====================================
5
- # Stage 1: Dependencies
6
- # =====================================
7
- FROM oven/bun:1.2-alpine AS deps
8
-
9
- WORKDIR /app
10
-
11
- # Copy package files
12
- COPY package.json bun.lock ./
13
-
14
- # Install production dependencies only
15
- RUN bun install --production --frozen-lockfile
16
-
17
- # =====================================
18
- # Stage 2: Builder
19
- # =====================================
20
- FROM oven/bun:1.2-alpine AS builder
21
-
22
- WORKDIR /app
23
-
24
- # Copy package files and install all dependencies (including dev)
25
- COPY package.json bun.lock ./
26
- RUN bun install --frozen-lockfile
27
-
28
- # Copy source code
29
- COPY . .
30
-
31
- # Build the application
32
- RUN bun run build
33
-
34
- # =====================================
35
- # Stage 3: Production Runner
36
- # =====================================
37
- FROM oven/bun:1.2-alpine AS runner
38
-
39
- WORKDIR /app
40
-
41
- # Set production environment
42
- ENV NODE_ENV=production
43
- ENV PORT=3000
44
-
45
- # Create non-root user for security
46
- RUN addgroup -g 1001 -S fluxstack && \
47
- adduser -S fluxstack -u 1001
48
-
49
- # Copy production dependencies from deps stage
50
- COPY --from=deps --chown=fluxstack:fluxstack /app/node_modules ./node_modules
51
-
52
- # Copy built application from builder stage
53
- COPY --from=builder --chown=fluxstack:fluxstack /app/dist ./dist
54
- COPY --from=builder --chown=fluxstack:fluxstack /app/package.json ./
55
-
56
- # Copy config directory (required for runtime configuration)
57
- COPY --from=builder --chown=fluxstack:fluxstack /app/config ./config
58
-
59
- # Switch to non-root user
60
- USER fluxstack
61
-
62
- # Expose application port
63
- EXPOSE 3000
64
-
65
- # Health check for container orchestrators
66
- HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
67
- CMD bun -e 'fetch("http://localhost:3000/api/health").then(r => r.ok ? process.exit(0) : process.exit(1)).catch(() => process.exit(1))'
68
-
69
- # Start the application
70
- CMD ["bun", "dist/index.js"]