create-fluxstack 1.7.5 → 1.8.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.
Files changed (154) hide show
  1. package/.dockerignore +82 -0
  2. package/.env.example +19 -0
  3. package/Dockerfile +70 -0
  4. package/README.md +6 -3
  5. package/app/client/SIMPLIFICATION.md +140 -0
  6. package/app/client/frontend-only.ts +1 -1
  7. package/app/client/src/App.tsx +148 -283
  8. package/app/client/src/index.css +5 -20
  9. package/app/client/src/lib/eden-api.ts +53 -220
  10. package/app/client/src/main.tsx +2 -3
  11. package/app/server/app.ts +20 -5
  12. package/app/server/backend-only.ts +15 -12
  13. package/app/server/controllers/users.controller.ts +57 -31
  14. package/app/server/index.ts +86 -96
  15. package/app/server/live/register-components.ts +18 -7
  16. package/app/server/routes/env-test.ts +110 -0
  17. package/app/server/routes/index.ts +1 -8
  18. package/app/server/routes/users.routes.ts +192 -91
  19. package/config/app.config.ts +2 -54
  20. package/config/client.config.ts +95 -0
  21. package/config/fluxstack.config.ts +2 -2
  22. package/config/index.ts +57 -22
  23. package/config/monitoring.config.ts +114 -0
  24. package/config/plugins.config.ts +80 -0
  25. package/config/runtime.config.ts +0 -17
  26. package/config/server.config.ts +50 -30
  27. package/core/build/bundler.ts +17 -16
  28. package/core/build/flux-plugins-generator.ts +34 -23
  29. package/core/build/index.ts +32 -31
  30. package/core/build/live-components-generator.ts +44 -30
  31. package/core/build/optimizer.ts +37 -17
  32. package/core/cli/command-registry.ts +4 -14
  33. package/core/cli/commands/plugin-deps.ts +8 -8
  34. package/core/cli/generators/component.ts +3 -3
  35. package/core/cli/generators/controller.ts +4 -4
  36. package/core/cli/generators/index.ts +8 -8
  37. package/core/cli/generators/interactive.ts +4 -4
  38. package/core/cli/generators/plugin.ts +3 -3
  39. package/core/cli/generators/prompts.ts +1 -1
  40. package/core/cli/generators/route.ts +27 -11
  41. package/core/cli/generators/service.ts +5 -5
  42. package/core/cli/generators/template-engine.ts +1 -1
  43. package/core/cli/generators/types.ts +1 -1
  44. package/core/cli/index.ts +158 -189
  45. package/core/cli/plugin-discovery.ts +3 -3
  46. package/core/client/hooks/index.ts +2 -2
  47. package/core/client/hooks/state-validator.ts +1 -1
  48. package/core/client/hooks/useAuth.ts +1 -1
  49. package/core/client/hooks/useChunkedUpload.ts +1 -1
  50. package/core/client/hooks/useHybridLiveComponent.ts +1 -1
  51. package/core/client/hooks/useWebSocket.ts +1 -1
  52. package/core/config/env.ts +5 -1
  53. package/core/config/runtime-config.ts +12 -10
  54. package/core/config/schema.ts +33 -2
  55. package/core/framework/server.ts +30 -14
  56. package/core/framework/types.ts +2 -2
  57. package/core/index.ts +31 -23
  58. package/core/live/ComponentRegistry.ts +1 -1
  59. package/core/plugins/built-in/live-components/commands/create-live-component.ts +1 -1
  60. package/core/plugins/built-in/live-components/index.ts +1 -1
  61. package/core/plugins/built-in/monitoring/index.ts +65 -161
  62. package/core/plugins/built-in/static/index.ts +75 -277
  63. package/core/plugins/built-in/swagger/index.ts +301 -231
  64. package/core/plugins/built-in/vite/index.ts +342 -377
  65. package/core/plugins/config.ts +2 -2
  66. package/core/plugins/dependency-manager.ts +2 -2
  67. package/core/plugins/discovery.ts +1 -1
  68. package/core/plugins/executor.ts +2 -2
  69. package/core/plugins/manager.ts +19 -4
  70. package/core/plugins/module-resolver.ts +1 -1
  71. package/core/plugins/registry.ts +25 -21
  72. package/core/plugins/types.ts +147 -5
  73. package/core/server/backend-entry.ts +51 -0
  74. package/core/server/framework.ts +2 -2
  75. package/core/server/live/ComponentRegistry.ts +9 -26
  76. package/core/server/live/FileUploadManager.ts +1 -1
  77. package/core/server/live/auto-generated-components.ts +26 -0
  78. package/core/server/live/websocket-plugin.ts +211 -19
  79. package/core/server/middleware/errorHandling.ts +1 -1
  80. package/core/server/middleware/index.ts +4 -4
  81. package/core/server/plugins/database.ts +1 -2
  82. package/core/server/plugins/static-files-plugin.ts +259 -231
  83. package/core/server/plugins/swagger.ts +1 -1
  84. package/core/server/services/BaseService.ts +1 -1
  85. package/core/server/services/ServiceContainer.ts +1 -1
  86. package/core/server/services/index.ts +4 -4
  87. package/core/server/standalone.ts +16 -1
  88. package/core/testing/index.ts +1 -1
  89. package/core/testing/setup.ts +1 -1
  90. package/core/types/plugin.ts +6 -0
  91. package/core/utils/build-logger.ts +324 -0
  92. package/core/utils/config-schema.ts +2 -6
  93. package/core/utils/helpers.ts +14 -9
  94. package/core/utils/logger/startup-banner.ts +7 -33
  95. package/core/utils/regenerate-files.ts +69 -0
  96. package/core/utils/version.ts +6 -6
  97. package/create-fluxstack.ts +68 -25
  98. package/fluxstack.config.ts +138 -252
  99. package/package.json +3 -18
  100. package/plugins/crypto-auth/index.ts +52 -47
  101. package/plugins/crypto-auth/server/AuthMiddleware.ts +1 -1
  102. package/plugins/crypto-auth/server/middlewares/helpers.ts +16 -1
  103. package/vitest.config.ts +17 -26
  104. package/app/client/src/App.css +0 -883
  105. package/app/client/src/components/ErrorBoundary.tsx +0 -107
  106. package/app/client/src/components/ErrorDisplay.css +0 -365
  107. package/app/client/src/components/ErrorDisplay.tsx +0 -258
  108. package/app/client/src/components/FluxStackConfig.tsx +0 -1321
  109. package/app/client/src/components/HybridLiveCounter.tsx +0 -140
  110. package/app/client/src/components/LiveClock.tsx +0 -286
  111. package/app/client/src/components/MainLayout.tsx +0 -388
  112. package/app/client/src/components/SidebarNavigation.tsx +0 -391
  113. package/app/client/src/components/StateDemo.tsx +0 -178
  114. package/app/client/src/components/SystemMonitor.tsx +0 -1044
  115. package/app/client/src/components/UserProfile.tsx +0 -809
  116. package/app/client/src/hooks/useAuth.ts +0 -39
  117. package/app/client/src/hooks/useNotifications.ts +0 -56
  118. package/app/client/src/lib/errors.ts +0 -340
  119. package/app/client/src/lib/hooks/useErrorHandler.ts +0 -258
  120. package/app/client/src/lib/index.ts +0 -45
  121. package/app/client/src/pages/ApiDocs.tsx +0 -182
  122. package/app/client/src/pages/CryptoAuthPage.tsx +0 -394
  123. package/app/client/src/pages/Demo.tsx +0 -174
  124. package/app/client/src/pages/HybridLive.tsx +0 -263
  125. package/app/client/src/pages/Overview.tsx +0 -155
  126. package/app/client/src/store/README.md +0 -43
  127. package/app/client/src/store/index.ts +0 -16
  128. package/app/client/src/store/slices/uiSlice.ts +0 -151
  129. package/app/client/src/store/slices/userSlice.ts +0 -161
  130. package/app/client/src/test/README.md +0 -257
  131. package/app/client/src/test/setup.ts +0 -70
  132. package/app/client/src/test/types.ts +0 -12
  133. package/app/server/live/CounterComponent.ts +0 -191
  134. package/app/server/live/FluxStackConfig.ts +0 -534
  135. package/app/server/live/SidebarNavigation.ts +0 -157
  136. package/app/server/live/SystemMonitor.ts +0 -595
  137. package/app/server/live/SystemMonitorIntegration.ts +0 -151
  138. package/app/server/live/UserProfileComponent.ts +0 -141
  139. package/app/server/middleware/auth.ts +0 -136
  140. package/app/server/middleware/errorHandling.ts +0 -252
  141. package/app/server/middleware/index.ts +0 -10
  142. package/app/server/middleware/rateLimit.ts +0 -193
  143. package/app/server/middleware/requestLogging.ts +0 -215
  144. package/app/server/middleware/validation.ts +0 -270
  145. package/app/server/routes/config.ts +0 -145
  146. package/app/server/routes/crypto-auth-demo.routes.ts +0 -167
  147. package/app/server/routes/example-with-crypto-auth.routes.ts +0 -235
  148. package/app/server/routes/exemplo-posts.routes.ts +0 -161
  149. package/app/server/routes/upload.ts +0 -92
  150. package/app/server/services/NotificationService.ts +0 -302
  151. package/app/server/services/UserService.ts +0 -222
  152. package/app/server/services/index.ts +0 -46
  153. package/app/server/types/index.ts +0 -1
  154. package/config/build.config.ts +0 -24
@@ -1,157 +0,0 @@
1
- // 🔥 Sidebar Navigation Live Component
2
-
3
- import { LiveComponent } from '@/core/types/types'
4
-
5
- export interface SidebarNavigationState {
6
- currentPage: 'dashboard' | 'profile' | 'settings' | 'files' | 'analytics' | 'config'
7
- isCollapsed: boolean
8
- theme: 'light' | 'dark'
9
- notifications: {
10
- profile: number
11
- settings: number
12
- files: number
13
- analytics: number
14
- config: number
15
- }
16
- lastNavigation: number
17
- }
18
-
19
- export class SidebarNavigation extends LiveComponent<SidebarNavigationState> {
20
- constructor(initialState: SidebarNavigationState, ws: any, options?: any) {
21
- super(initialState, ws, options)
22
-
23
- // Set default state if needed
24
- this.state = {
25
- currentPage: 'dashboard',
26
- isCollapsed: false,
27
- theme: 'light',
28
- notifications: {
29
- profile: 0,
30
- settings: 0,
31
- files: 0,
32
- analytics: 0,
33
- config: 0
34
- },
35
- lastNavigation: Date.now(),
36
- ...initialState
37
- }
38
- }
39
-
40
- // Navigate to a different page
41
- async navigateTo(data: { page: string }) {
42
- const validPages = ['dashboard', 'profile', 'settings', 'files', 'analytics', 'config']
43
-
44
- if (!validPages.includes(data.page)) {
45
- throw new Error(`Invalid page: ${data.page}`)
46
- }
47
-
48
- this.setState({
49
- currentPage: data.page as any,
50
- lastNavigation: Date.now()
51
- })
52
-
53
- // Clear notification for the page we're navigating to
54
- this.setState({
55
- notifications: {
56
- ...this.state.notifications,
57
- [data.page]: 0
58
- }
59
- })
60
-
61
- this.emit('PAGE_CHANGED', {
62
- page: data.page,
63
- timestamp: Date.now()
64
- })
65
-
66
- console.log(`📍 Navigation: Changed to ${data.page}`)
67
- }
68
-
69
- // Toggle sidebar collapsed state
70
- async toggleSidebar() {
71
- this.setState({
72
- isCollapsed: !this.state.isCollapsed
73
- })
74
-
75
- this.emit('SIDEBAR_TOGGLED', {
76
- collapsed: this.state.isCollapsed,
77
- timestamp: Date.now()
78
- })
79
-
80
- console.log(`📱 Sidebar: ${this.state.isCollapsed ? 'Collapsed' : 'Expanded'}`)
81
- }
82
-
83
- // Change theme
84
- async setTheme(data: { theme: 'light' | 'dark' }) {
85
- if (!['light', 'dark'].includes(data.theme)) {
86
- throw new Error(`Invalid theme: ${data.theme}`)
87
- }
88
-
89
- this.setState({
90
- theme: data.theme
91
- })
92
-
93
- this.emit('THEME_CHANGED', {
94
- theme: data.theme,
95
- timestamp: Date.now()
96
- })
97
-
98
- console.log(`🎨 Theme: Changed to ${data.theme}`)
99
- }
100
-
101
- // Add notification to a page
102
- async addNotification(data: { page: string; count?: number }) {
103
- const validPages = ['profile', 'settings', 'files', 'analytics']
104
-
105
- if (!validPages.includes(data.page)) {
106
- throw new Error(`Invalid notification page: ${data.page}`)
107
- }
108
-
109
- const currentCount = this.state.notifications[data.page as keyof typeof this.state.notifications] || 0
110
- const incrementBy = data.count || 1
111
-
112
- this.setState({
113
- notifications: {
114
- ...this.state.notifications,
115
- [data.page]: currentCount + incrementBy
116
- }
117
- })
118
-
119
- this.emit('NOTIFICATION_ADDED', {
120
- page: data.page,
121
- count: currentCount + incrementBy,
122
- timestamp: Date.now()
123
- })
124
-
125
- console.log(`🔔 Notification: Added ${incrementBy} to ${data.page} (total: ${currentCount + incrementBy})`)
126
- }
127
-
128
- // Clear all notifications
129
- async clearAllNotifications() {
130
- this.setState({
131
- notifications: {
132
- profile: 0,
133
- settings: 0,
134
- files: 0,
135
- analytics: 0,
136
- config: 0
137
- }
138
- })
139
-
140
- this.emit('NOTIFICATIONS_CLEARED', {
141
- timestamp: Date.now()
142
- })
143
-
144
- console.log(`🔕 Notifications: All cleared`)
145
- }
146
-
147
- // Get navigation history (mock for now)
148
- async getNavigationHistory() {
149
- // In a real app, this would fetch from database
150
- return {
151
- history: [
152
- { page: this.state.currentPage, timestamp: this.state.lastNavigation }
153
- ],
154
- timestamp: Date.now()
155
- }
156
- }
157
- }