create-fluxstack 1.0.13 → 1.0.14

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 (214) hide show
  1. package/.env.example +29 -29
  2. package/app/client/README.md +69 -69
  3. package/app/client/index.html +14 -13
  4. package/app/client/src/App.tsx +157 -524
  5. package/app/client/src/components/ErrorBoundary.tsx +107 -0
  6. package/app/client/src/components/ErrorDisplay.css +365 -0
  7. package/app/client/src/components/ErrorDisplay.tsx +258 -0
  8. package/app/client/src/components/FluxStackConfig.tsx +1321 -0
  9. package/app/client/src/components/HybridLiveCounter.tsx +140 -0
  10. package/app/client/src/components/LiveClock.tsx +286 -0
  11. package/app/client/src/components/MainLayout.tsx +390 -0
  12. package/app/client/src/components/SidebarNavigation.tsx +391 -0
  13. package/app/client/src/components/StateDemo.tsx +178 -0
  14. package/app/client/src/components/SystemMonitor.tsx +1038 -0
  15. package/app/client/src/components/Teste.tsx +104 -0
  16. package/app/client/src/components/UserProfile.tsx +809 -0
  17. package/app/client/src/hooks/useAuth.ts +39 -0
  18. package/app/client/src/hooks/useNotifications.ts +56 -0
  19. package/app/client/src/lib/eden-api.ts +189 -53
  20. package/app/client/src/lib/errors.ts +340 -0
  21. package/app/client/src/lib/hooks/useErrorHandler.ts +258 -0
  22. package/app/client/src/lib/index.ts +45 -0
  23. package/app/client/src/main.tsx +3 -2
  24. package/app/client/src/pages/ApiDocs.tsx +182 -0
  25. package/app/client/src/pages/Demo.tsx +174 -0
  26. package/app/client/src/pages/HybridLive.tsx +263 -0
  27. package/app/client/src/pages/Overview.tsx +155 -0
  28. package/app/client/src/store/README.md +43 -0
  29. package/app/client/src/store/index.ts +16 -0
  30. package/app/client/src/store/slices/uiSlice.ts +151 -0
  31. package/app/client/src/store/slices/userSlice.ts +161 -0
  32. package/app/client/src/test/README.md +257 -0
  33. package/app/client/src/test/setup.ts +70 -0
  34. package/app/client/src/test/types.ts +12 -0
  35. package/app/client/src/vite-env.d.ts +1 -1
  36. package/app/client/tsconfig.app.json +44 -43
  37. package/app/client/tsconfig.json +7 -7
  38. package/app/client/tsconfig.node.json +25 -25
  39. package/app/client/zustand-setup.md +65 -0
  40. package/app/server/controllers/users.controller.ts +68 -68
  41. package/app/server/index.ts +9 -1
  42. package/app/server/live/CounterComponent.ts +191 -0
  43. package/app/server/live/FluxStackConfig.ts +529 -0
  44. package/app/server/live/LiveClockComponent.ts +214 -0
  45. package/app/server/live/SidebarNavigation.ts +156 -0
  46. package/app/server/live/SystemMonitor.ts +594 -0
  47. package/app/server/live/SystemMonitorIntegration.ts +151 -0
  48. package/app/server/live/TesteComponent.ts +87 -0
  49. package/app/server/live/UserProfileComponent.ts +135 -0
  50. package/app/server/live/register-components.ts +28 -0
  51. package/app/server/middleware/auth.ts +136 -0
  52. package/app/server/middleware/errorHandling.ts +250 -0
  53. package/app/server/middleware/index.ts +10 -0
  54. package/app/server/middleware/rateLimit.ts +193 -0
  55. package/app/server/middleware/requestLogging.ts +215 -0
  56. package/app/server/middleware/validation.ts +270 -0
  57. package/app/server/routes/index.ts +14 -2
  58. package/app/server/routes/upload.ts +92 -0
  59. package/app/server/routes/users.routes.ts +2 -9
  60. package/app/server/services/NotificationService.ts +302 -0
  61. package/app/server/services/UserService.ts +222 -0
  62. package/app/server/services/index.ts +46 -0
  63. package/core/cli/commands/plugin-deps.ts +263 -0
  64. package/core/cli/generators/README.md +339 -0
  65. package/core/cli/generators/component.ts +770 -0
  66. package/core/cli/generators/controller.ts +299 -0
  67. package/core/cli/generators/index.ts +144 -0
  68. package/core/cli/generators/interactive.ts +228 -0
  69. package/core/cli/generators/prompts.ts +83 -0
  70. package/core/cli/generators/route.ts +513 -0
  71. package/core/cli/generators/service.ts +465 -0
  72. package/core/cli/generators/template-engine.ts +154 -0
  73. package/core/cli/generators/types.ts +71 -0
  74. package/core/cli/generators/utils.ts +192 -0
  75. package/core/cli/index.ts +69 -0
  76. package/core/cli/plugin-discovery.ts +16 -85
  77. package/core/client/fluxstack.ts +17 -0
  78. package/core/client/hooks/index.ts +7 -0
  79. package/core/client/hooks/state-validator.ts +130 -0
  80. package/core/client/hooks/useAuth.ts +49 -0
  81. package/core/client/hooks/useChunkedUpload.ts +258 -0
  82. package/core/client/hooks/useHybridLiveComponent.ts +967 -0
  83. package/core/client/hooks/useWebSocket.ts +373 -0
  84. package/core/client/index.ts +47 -0
  85. package/core/client/state/createStore.ts +193 -0
  86. package/core/client/state/index.ts +15 -0
  87. package/core/config/env-dynamic.ts +1 -1
  88. package/core/config/env.ts +2 -1
  89. package/core/config/runtime-config.ts +3 -3
  90. package/core/config/schema.ts +84 -49
  91. package/core/framework/server.ts +30 -0
  92. package/core/index.ts +25 -0
  93. package/core/live/ComponentRegistry.ts +399 -0
  94. package/core/live/types.ts +164 -0
  95. package/core/plugins/built-in/live-components/commands/create-live-component.ts +1201 -0
  96. package/core/plugins/built-in/live-components/index.ts +27 -0
  97. package/core/plugins/built-in/logger/index.ts +1 -1
  98. package/core/plugins/built-in/monitoring/index.ts +1 -1
  99. package/core/plugins/built-in/static/index.ts +1 -1
  100. package/core/plugins/built-in/swagger/index.ts +1 -1
  101. package/core/plugins/built-in/vite/index.ts +1 -1
  102. package/core/plugins/dependency-manager.ts +384 -0
  103. package/core/plugins/index.ts +5 -1
  104. package/core/plugins/manager.ts +7 -3
  105. package/core/plugins/registry.ts +88 -10
  106. package/core/plugins/types.ts +11 -11
  107. package/core/server/framework.ts +43 -0
  108. package/core/server/index.ts +11 -1
  109. package/core/server/live/ComponentRegistry.ts +1017 -0
  110. package/core/server/live/FileUploadManager.ts +272 -0
  111. package/core/server/live/LiveComponentPerformanceMonitor.ts +930 -0
  112. package/core/server/live/SingleConnectionManager.ts +0 -0
  113. package/core/server/live/StateSignature.ts +644 -0
  114. package/core/server/live/WebSocketConnectionManager.ts +688 -0
  115. package/core/server/live/websocket-plugin.ts +435 -0
  116. package/core/server/middleware/errorHandling.ts +141 -0
  117. package/core/server/middleware/index.ts +16 -0
  118. package/core/server/plugins/static-files-plugin.ts +232 -0
  119. package/core/server/services/BaseService.ts +95 -0
  120. package/core/server/services/ServiceContainer.ts +144 -0
  121. package/core/server/services/index.ts +9 -0
  122. package/core/templates/create-project.ts +46 -2
  123. package/core/testing/index.ts +10 -0
  124. package/core/testing/setup.ts +74 -0
  125. package/core/types/build.ts +38 -14
  126. package/core/types/types.ts +319 -0
  127. package/core/utils/env-runtime.ts +7 -0
  128. package/core/utils/errors/handlers.ts +264 -39
  129. package/core/utils/errors/index.ts +528 -18
  130. package/core/utils/errors/middleware.ts +114 -0
  131. package/core/utils/logger/formatters.ts +222 -0
  132. package/core/utils/logger/index.ts +167 -48
  133. package/core/utils/logger/middleware.ts +253 -0
  134. package/core/utils/logger/performance.ts +384 -0
  135. package/core/utils/logger/transports.ts +365 -0
  136. package/create-fluxstack.ts +296 -296
  137. package/fluxstack.config.ts +17 -1
  138. package/package-template.json +66 -66
  139. package/package.json +31 -6
  140. package/public/README.md +16 -0
  141. package/vite.config.ts +29 -14
  142. package/.claude/settings.local.json +0 -74
  143. package/.github/workflows/ci-build-tests.yml +0 -480
  144. package/.github/workflows/dependency-management.yml +0 -324
  145. package/.github/workflows/release-validation.yml +0 -355
  146. package/.kiro/specs/fluxstack-architecture-optimization/design.md +0 -700
  147. package/.kiro/specs/fluxstack-architecture-optimization/requirements.md +0 -127
  148. package/.kiro/specs/fluxstack-architecture-optimization/tasks.md +0 -330
  149. package/CLAUDE.md +0 -200
  150. package/Dockerfile +0 -58
  151. package/Dockerfile.backend +0 -52
  152. package/Dockerfile.frontend +0 -54
  153. package/README-Docker.md +0 -85
  154. package/ai-context/00-QUICK-START.md +0 -86
  155. package/ai-context/README.md +0 -88
  156. package/ai-context/development/eden-treaty-guide.md +0 -362
  157. package/ai-context/development/patterns.md +0 -382
  158. package/ai-context/development/plugins-guide.md +0 -572
  159. package/ai-context/examples/crud-complete.md +0 -626
  160. package/ai-context/project/architecture.md +0 -399
  161. package/ai-context/project/overview.md +0 -213
  162. package/ai-context/recent-changes/eden-treaty-refactor.md +0 -281
  163. package/ai-context/recent-changes/type-inference-fix.md +0 -223
  164. package/ai-context/reference/environment-vars.md +0 -384
  165. package/ai-context/reference/troubleshooting.md +0 -407
  166. package/app/client/src/components/TestPage.tsx +0 -453
  167. package/bun.lock +0 -1063
  168. package/bunfig.toml +0 -16
  169. package/core/__tests__/integration.test.ts +0 -227
  170. package/core/build/index.ts +0 -186
  171. package/core/config/__tests__/config-loader.test.ts +0 -554
  172. package/core/config/__tests__/config-merger.test.ts +0 -657
  173. package/core/config/__tests__/env-converter.test.ts +0 -372
  174. package/core/config/__tests__/env-processor.test.ts +0 -431
  175. package/core/config/__tests__/env.test.ts +0 -452
  176. package/core/config/__tests__/integration.test.ts +0 -418
  177. package/core/config/__tests__/loader.test.ts +0 -331
  178. package/core/config/__tests__/schema.test.ts +0 -129
  179. package/core/config/__tests__/validator.test.ts +0 -318
  180. package/core/framework/__tests__/server.test.ts +0 -233
  181. package/core/plugins/__tests__/built-in.test.ts.disabled +0 -366
  182. package/core/plugins/__tests__/manager.test.ts +0 -398
  183. package/core/plugins/__tests__/monitoring.test.ts +0 -401
  184. package/core/plugins/__tests__/registry.test.ts +0 -335
  185. package/core/utils/__tests__/errors.test.ts +0 -139
  186. package/core/utils/__tests__/helpers.test.ts +0 -297
  187. package/core/utils/__tests__/logger.test.ts +0 -141
  188. package/create-test-app.ts +0 -156
  189. package/docker-compose.microservices.yml +0 -75
  190. package/docker-compose.simple.yml +0 -57
  191. package/docker-compose.yml +0 -71
  192. package/eslint.config.js +0 -23
  193. package/flux-cli.ts +0 -214
  194. package/nginx-lb.conf +0 -37
  195. package/publish.sh +0 -63
  196. package/run-clean.ts +0 -26
  197. package/run-env-tests.ts +0 -313
  198. package/tailwind.config.js +0 -34
  199. package/tests/__mocks__/api.ts +0 -56
  200. package/tests/fixtures/users.ts +0 -69
  201. package/tests/integration/api/users.routes.test.ts +0 -221
  202. package/tests/setup.ts +0 -29
  203. package/tests/unit/app/client/App-simple.test.tsx +0 -56
  204. package/tests/unit/app/client/App.test.tsx.skip +0 -237
  205. package/tests/unit/app/client/eden-api.test.ts +0 -186
  206. package/tests/unit/app/client/simple.test.tsx +0 -23
  207. package/tests/unit/app/controllers/users.controller.test.ts +0 -150
  208. package/tests/unit/core/create-project.test.ts.skip +0 -95
  209. package/tests/unit/core/framework.test.ts +0 -144
  210. package/tests/unit/core/plugins/logger.test.ts.skip +0 -268
  211. package/tests/unit/core/plugins/vite.test.ts.disabled +0 -188
  212. package/tests/utils/test-helpers.ts +0 -61
  213. package/vitest.config.ts +0 -50
  214. package/workspace.json +0 -6
@@ -0,0 +1,214 @@
1
+ // 🔥 LiveClock - Real-time Clock Live Component
2
+ import { LiveComponent } from "@/core/types/types";
3
+
4
+ interface LiveClockState {
5
+ currentTime: string;
6
+ timeZone: string;
7
+ format: '12h' | '24h';
8
+ showSeconds: boolean;
9
+ showDate: boolean;
10
+ lastSync: Date;
11
+ serverUptime: number;
12
+ }
13
+
14
+ export class LiveClockComponent extends LiveComponent<LiveClockState> {
15
+ private clockInterval: NodeJS.Timeout | null = null;
16
+ private startTime: Date;
17
+
18
+ constructor(initialState: LiveClockState, ws: any, options?: { room?: string; userId?: string }) {
19
+ const now = new Date();
20
+ super({
21
+ currentTime: now.toLocaleTimeString('pt-BR'),
22
+ timeZone: 'America/Sao_Paulo',
23
+ format: '24h',
24
+ showSeconds: true,
25
+ showDate: true,
26
+ lastSync: now,
27
+ serverUptime: 0,
28
+ ...initialState
29
+ }, ws, options);
30
+
31
+ this.startTime = now;
32
+ console.log(`🕐 ${this.constructor.name} created: ${this.id}`);
33
+
34
+ // Start the real-time clock immediately
35
+ this.startClock();
36
+ }
37
+
38
+ private startClock() {
39
+ // Clear any existing interval
40
+ if (this.clockInterval) {
41
+ clearInterval(this.clockInterval);
42
+ }
43
+
44
+ // Update clock every second
45
+ this.clockInterval = setInterval(() => {
46
+ this.updateClock();
47
+ }, 1000);
48
+
49
+ // Initial update
50
+ this.updateClock();
51
+ }
52
+
53
+ private updateClock() {
54
+ const now = new Date();
55
+ const uptimeMs = now.getTime() - this.startTime.getTime();
56
+
57
+ let timeString;
58
+ if (this.state.format === '12h') {
59
+ timeString = now.toLocaleTimeString('en-US', {
60
+ hour12: true,
61
+ hour: 'numeric',
62
+ minute: '2-digit',
63
+ second: this.state.showSeconds ? '2-digit' : undefined
64
+ });
65
+ } else {
66
+ timeString = now.toLocaleTimeString('pt-BR', {
67
+ hour12: false,
68
+ hour: '2-digit',
69
+ minute: '2-digit',
70
+ second: this.state.showSeconds ? '2-digit' : undefined
71
+ });
72
+ }
73
+
74
+ this.setState({
75
+ currentTime: timeString,
76
+ lastSync: now,
77
+ serverUptime: Math.floor(uptimeMs / 1000)
78
+ });
79
+
80
+ // Broadcast time update to all connected clients
81
+ if (this.room) {
82
+ this.broadcast('CLOCK_TICK', {
83
+ currentTime: timeString,
84
+ timestamp: now.toISOString(),
85
+ serverUptime: Math.floor(uptimeMs / 1000)
86
+ });
87
+ }
88
+ }
89
+
90
+ async setTimeFormat(payload: { format: '12h' | '24h' }) {
91
+ const { format } = payload;
92
+
93
+ if (format !== '12h' && format !== '24h') {
94
+ throw new Error('Invalid time format. Use "12h" or "24h"');
95
+ }
96
+
97
+ this.setState({
98
+ format,
99
+ lastSync: new Date()
100
+ });
101
+
102
+ // Immediately update the clock display with new format
103
+ this.updateClock();
104
+
105
+ console.log(`🕐 Time format changed to: ${format}`);
106
+ return { success: true, format };
107
+ }
108
+
109
+ async toggleSeconds(payload?: { showSeconds?: boolean }) {
110
+ const showSeconds = payload?.showSeconds ?? !this.state.showSeconds;
111
+
112
+ this.setState({
113
+ showSeconds,
114
+ lastSync: new Date()
115
+ });
116
+
117
+ // Update clock display immediately
118
+ this.updateClock();
119
+
120
+ console.log(`🕐 Seconds display: ${showSeconds ? 'ON' : 'OFF'}`);
121
+ return { success: true, showSeconds };
122
+ }
123
+
124
+ async toggleDate(payload?: { showDate?: boolean }) {
125
+ const showDate = payload?.showDate ?? !this.state.showDate;
126
+
127
+ this.setState({
128
+ showDate,
129
+ lastSync: new Date()
130
+ });
131
+
132
+ console.log(`🕐 Date display: ${showDate ? 'ON' : 'OFF'}`);
133
+ return { success: true, showDate };
134
+ }
135
+
136
+ async setTimeZone(payload: { timeZone: string }) {
137
+ const { timeZone } = payload;
138
+
139
+ // Basic timezone validation
140
+ try {
141
+ new Date().toLocaleString('en-US', { timeZone });
142
+ } catch (error) {
143
+ throw new Error(`Invalid timezone: ${timeZone}`);
144
+ }
145
+
146
+ this.setState({
147
+ timeZone,
148
+ lastSync: new Date()
149
+ });
150
+
151
+ console.log(`🕐 Timezone changed to: ${timeZone}`);
152
+ return { success: true, timeZone };
153
+ }
154
+
155
+ async getServerInfo() {
156
+ console.log(`🕐 getServerInfo called for component: ${this.id}`);
157
+
158
+ const now = new Date();
159
+ const uptimeMs = now.getTime() - this.startTime.getTime();
160
+
161
+ const result = {
162
+ success: true,
163
+ info: {
164
+ serverTime: now.toISOString(),
165
+ localTime: now.toLocaleString('pt-BR'),
166
+ uptime: Math.floor(uptimeMs / 1000),
167
+ uptimeFormatted: this.formatUptime(Math.floor(uptimeMs / 1000)),
168
+ timezone: this.state.timeZone,
169
+ componentId: this.id,
170
+ startTime: this.startTime.toISOString()
171
+ }
172
+ };
173
+
174
+ console.log(`🕐 getServerInfo result:`, result);
175
+ return result;
176
+ }
177
+
178
+ async syncTime() {
179
+ // Force a manual time sync
180
+ this.updateClock();
181
+
182
+ console.log(`🕐 Manual time sync performed`);
183
+ return {
184
+ success: true,
185
+ syncTime: new Date().toISOString(),
186
+ currentTime: this.state.currentTime
187
+ };
188
+ }
189
+
190
+ private formatUptime(seconds: number): string {
191
+ const hours = Math.floor(seconds / 3600);
192
+ const minutes = Math.floor((seconds % 3600) / 60);
193
+ const secs = seconds % 60;
194
+
195
+ if (hours > 0) {
196
+ return `${hours}h ${minutes}m ${secs}s`;
197
+ } else if (minutes > 0) {
198
+ return `${minutes}m ${secs}s`;
199
+ } else {
200
+ return `${secs}s`;
201
+ }
202
+ }
203
+
204
+ public destroy() {
205
+ // Clean up the interval when component is destroyed
206
+ if (this.clockInterval) {
207
+ clearInterval(this.clockInterval);
208
+ this.clockInterval = null;
209
+ console.log(`🕐 Clock interval cleared for component: ${this.id}`);
210
+ }
211
+
212
+ super.destroy();
213
+ }
214
+ }
@@ -0,0 +1,156 @@
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
+ }
137
+ })
138
+
139
+ this.emit('NOTIFICATIONS_CLEARED', {
140
+ timestamp: Date.now()
141
+ })
142
+
143
+ console.log(`🔕 Notifications: All cleared`)
144
+ }
145
+
146
+ // Get navigation history (mock for now)
147
+ async getNavigationHistory() {
148
+ // In a real app, this would fetch from database
149
+ return {
150
+ history: [
151
+ { page: this.state.currentPage, timestamp: this.state.lastNavigation }
152
+ ],
153
+ timestamp: Date.now()
154
+ }
155
+ }
156
+ }