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.
- package/.dockerignore +82 -0
- package/.env.example +19 -0
- package/Dockerfile +70 -0
- package/README.md +6 -3
- package/app/client/SIMPLIFICATION.md +140 -0
- package/app/client/frontend-only.ts +1 -1
- package/app/client/src/App.tsx +148 -283
- package/app/client/src/index.css +5 -20
- package/app/client/src/lib/eden-api.ts +53 -220
- package/app/client/src/main.tsx +2 -3
- package/app/server/app.ts +20 -5
- package/app/server/backend-only.ts +15 -12
- package/app/server/controllers/users.controller.ts +57 -31
- package/app/server/index.ts +86 -96
- package/app/server/live/register-components.ts +18 -7
- package/app/server/routes/env-test.ts +110 -0
- package/app/server/routes/index.ts +1 -8
- package/app/server/routes/users.routes.ts +192 -91
- package/config/app.config.ts +2 -54
- package/config/client.config.ts +95 -0
- package/config/fluxstack.config.ts +2 -2
- package/config/index.ts +57 -22
- package/config/monitoring.config.ts +114 -0
- package/config/plugins.config.ts +80 -0
- package/config/runtime.config.ts +0 -17
- package/config/server.config.ts +50 -30
- package/core/build/bundler.ts +17 -16
- package/core/build/flux-plugins-generator.ts +34 -23
- package/core/build/index.ts +32 -31
- package/core/build/live-components-generator.ts +44 -30
- package/core/build/optimizer.ts +37 -17
- package/core/cli/command-registry.ts +4 -14
- package/core/cli/commands/plugin-deps.ts +8 -8
- package/core/cli/generators/component.ts +3 -3
- package/core/cli/generators/controller.ts +4 -4
- package/core/cli/generators/index.ts +8 -8
- package/core/cli/generators/interactive.ts +4 -4
- package/core/cli/generators/plugin.ts +3 -3
- package/core/cli/generators/prompts.ts +1 -1
- package/core/cli/generators/route.ts +27 -11
- package/core/cli/generators/service.ts +5 -5
- package/core/cli/generators/template-engine.ts +1 -1
- package/core/cli/generators/types.ts +1 -1
- package/core/cli/index.ts +158 -189
- package/core/cli/plugin-discovery.ts +3 -3
- package/core/client/hooks/index.ts +2 -2
- package/core/client/hooks/state-validator.ts +1 -1
- package/core/client/hooks/useAuth.ts +1 -1
- package/core/client/hooks/useChunkedUpload.ts +1 -1
- package/core/client/hooks/useHybridLiveComponent.ts +1 -1
- package/core/client/hooks/useWebSocket.ts +1 -1
- package/core/config/env.ts +5 -1
- package/core/config/runtime-config.ts +12 -10
- package/core/config/schema.ts +33 -2
- package/core/framework/server.ts +30 -14
- package/core/framework/types.ts +2 -2
- package/core/index.ts +31 -23
- package/core/live/ComponentRegistry.ts +1 -1
- package/core/plugins/built-in/live-components/commands/create-live-component.ts +1 -1
- package/core/plugins/built-in/live-components/index.ts +1 -1
- package/core/plugins/built-in/monitoring/index.ts +65 -161
- package/core/plugins/built-in/static/index.ts +75 -277
- package/core/plugins/built-in/swagger/index.ts +301 -231
- package/core/plugins/built-in/vite/index.ts +342 -377
- package/core/plugins/config.ts +2 -2
- package/core/plugins/dependency-manager.ts +2 -2
- package/core/plugins/discovery.ts +1 -1
- package/core/plugins/executor.ts +2 -2
- package/core/plugins/manager.ts +19 -4
- package/core/plugins/module-resolver.ts +1 -1
- package/core/plugins/registry.ts +25 -21
- package/core/plugins/types.ts +147 -5
- package/core/server/backend-entry.ts +51 -0
- package/core/server/framework.ts +2 -2
- package/core/server/live/ComponentRegistry.ts +9 -26
- package/core/server/live/FileUploadManager.ts +1 -1
- package/core/server/live/auto-generated-components.ts +26 -0
- package/core/server/live/websocket-plugin.ts +211 -19
- package/core/server/middleware/errorHandling.ts +1 -1
- package/core/server/middleware/index.ts +4 -4
- package/core/server/plugins/database.ts +1 -2
- package/core/server/plugins/static-files-plugin.ts +259 -231
- package/core/server/plugins/swagger.ts +1 -1
- package/core/server/services/BaseService.ts +1 -1
- package/core/server/services/ServiceContainer.ts +1 -1
- package/core/server/services/index.ts +4 -4
- package/core/server/standalone.ts +16 -1
- package/core/testing/index.ts +1 -1
- package/core/testing/setup.ts +1 -1
- package/core/types/plugin.ts +6 -0
- package/core/utils/build-logger.ts +324 -0
- package/core/utils/config-schema.ts +2 -6
- package/core/utils/helpers.ts +14 -9
- package/core/utils/logger/startup-banner.ts +7 -33
- package/core/utils/regenerate-files.ts +69 -0
- package/core/utils/version.ts +6 -6
- package/create-fluxstack.ts +68 -25
- package/fluxstack.config.ts +138 -252
- package/package.json +3 -18
- package/plugins/crypto-auth/index.ts +52 -47
- package/plugins/crypto-auth/server/AuthMiddleware.ts +1 -1
- package/plugins/crypto-auth/server/middlewares/helpers.ts +16 -1
- package/vitest.config.ts +17 -26
- package/app/client/src/App.css +0 -883
- package/app/client/src/components/ErrorBoundary.tsx +0 -107
- package/app/client/src/components/ErrorDisplay.css +0 -365
- package/app/client/src/components/ErrorDisplay.tsx +0 -258
- package/app/client/src/components/FluxStackConfig.tsx +0 -1321
- package/app/client/src/components/HybridLiveCounter.tsx +0 -140
- package/app/client/src/components/LiveClock.tsx +0 -286
- package/app/client/src/components/MainLayout.tsx +0 -388
- package/app/client/src/components/SidebarNavigation.tsx +0 -391
- package/app/client/src/components/StateDemo.tsx +0 -178
- package/app/client/src/components/SystemMonitor.tsx +0 -1044
- package/app/client/src/components/UserProfile.tsx +0 -809
- package/app/client/src/hooks/useAuth.ts +0 -39
- package/app/client/src/hooks/useNotifications.ts +0 -56
- package/app/client/src/lib/errors.ts +0 -340
- package/app/client/src/lib/hooks/useErrorHandler.ts +0 -258
- package/app/client/src/lib/index.ts +0 -45
- package/app/client/src/pages/ApiDocs.tsx +0 -182
- package/app/client/src/pages/CryptoAuthPage.tsx +0 -394
- package/app/client/src/pages/Demo.tsx +0 -174
- package/app/client/src/pages/HybridLive.tsx +0 -263
- package/app/client/src/pages/Overview.tsx +0 -155
- package/app/client/src/store/README.md +0 -43
- package/app/client/src/store/index.ts +0 -16
- package/app/client/src/store/slices/uiSlice.ts +0 -151
- package/app/client/src/store/slices/userSlice.ts +0 -161
- package/app/client/src/test/README.md +0 -257
- package/app/client/src/test/setup.ts +0 -70
- package/app/client/src/test/types.ts +0 -12
- package/app/server/live/CounterComponent.ts +0 -191
- package/app/server/live/FluxStackConfig.ts +0 -534
- package/app/server/live/SidebarNavigation.ts +0 -157
- package/app/server/live/SystemMonitor.ts +0 -595
- package/app/server/live/SystemMonitorIntegration.ts +0 -151
- package/app/server/live/UserProfileComponent.ts +0 -141
- package/app/server/middleware/auth.ts +0 -136
- package/app/server/middleware/errorHandling.ts +0 -252
- package/app/server/middleware/index.ts +0 -10
- package/app/server/middleware/rateLimit.ts +0 -193
- package/app/server/middleware/requestLogging.ts +0 -215
- package/app/server/middleware/validation.ts +0 -270
- package/app/server/routes/config.ts +0 -145
- package/app/server/routes/crypto-auth-demo.routes.ts +0 -167
- package/app/server/routes/example-with-crypto-auth.routes.ts +0 -235
- package/app/server/routes/exemplo-posts.routes.ts +0 -161
- package/app/server/routes/upload.ts +0 -92
- package/app/server/services/NotificationService.ts +0 -302
- package/app/server/services/UserService.ts +0 -222
- package/app/server/services/index.ts +0 -46
- package/app/server/types/index.ts +0 -1
- 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
|
-
}
|