create-fluxstack 1.0.13 → 1.0.15

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 +196 -33
  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,263 @@
1
+ import React from 'react';
2
+ import {
3
+ FaBolt, FaRocket, FaSync, FaCheckCircle, FaCog, FaFire,
4
+ FaEye,
5
+ FaBullseye,
6
+ FaTimesCircle
7
+ } from 'react-icons/fa';
8
+ import { HybridLiveCounter } from '../components/HybridLiveCounter';
9
+ import { UserProfile } from '../components/UserProfile';
10
+ import { LiveClock } from '../components/LiveClock';
11
+
12
+ export function HybridLivePage() {
13
+ return (
14
+ <div className="space-y-8">
15
+ {/* Header */}
16
+ <div className="text-center">
17
+ <div className="flex items-center justify-center gap-3 mb-4">
18
+ <FaBolt className="text-3xl text-yellow-500" />
19
+ <h2 className="text-3xl font-bold text-gray-900">Hybrid Live Components</h2>
20
+ </div>
21
+ <div className="flex items-center justify-center gap-2">
22
+ <p className="text-lg text-gray-600 max-w-3xl mx-auto">
23
+ Sistema híbrido combinando <strong>Zustand (cliente)</strong> + <strong>Live Components (servidor)</strong>
24
+ para máxima performance com fallback offline e validação de estado!
25
+ </p>
26
+ <FaRocket className="text-lg text-blue-500" />
27
+ </div>
28
+ </div>
29
+
30
+ {/* Architecture Info Cards */}
31
+ <div className="grid grid-cols-1 md:grid-cols-4 gap-4">
32
+ <div className="bg-gradient-to-br from-blue-50 to-blue-100 border border-blue-200 rounded-2xl p-4 text-center">
33
+ <div className="text-3xl mb-2">
34
+ <FaBolt className="text-blue-500 mx-auto" />
35
+ </div>
36
+ <div className="text-sm font-medium text-blue-700 uppercase tracking-wide">Zustand</div>
37
+ <div className="text-xs text-blue-600 mt-1">Client State</div>
38
+ </div>
39
+ <div className="bg-gradient-to-br from-purple-50 to-purple-100 border border-purple-200 rounded-2xl p-4 text-center">
40
+ <div className="text-3xl mb-2">
41
+ <FaSync className="text-purple-500 mx-auto" />
42
+ </div>
43
+ <div className="text-sm font-medium text-purple-700 uppercase tracking-wide">Sync</div>
44
+ <div className="text-xs text-purple-600 mt-1">Real-time</div>
45
+ </div>
46
+ <div className="bg-gradient-to-br from-orange-50 to-orange-100 border border-orange-200 rounded-2xl p-4 text-center">
47
+ <div className="text-3xl mb-2">
48
+ <FaCheckCircle className="text-orange-500 mx-auto" />
49
+ </div>
50
+ <div className="text-sm font-medium text-orange-700 uppercase tracking-wide">Validation</div>
51
+ <div className="text-xs text-orange-600 mt-1">State Integrity</div>
52
+ </div>
53
+ <div className="bg-gradient-to-br from-green-50 to-green-100 border border-green-200 rounded-2xl p-4 text-center">
54
+ <div className="text-3xl mb-2">
55
+ <FaEye className="text-green-500 mx-auto" />
56
+ </div>
57
+ <div className="text-sm font-medium text-green-700 uppercase tracking-wide">Offline</div>
58
+ <div className="text-xs text-green-600 mt-1">Fallback Ready</div>
59
+ </div>
60
+ </div>
61
+
62
+ {/* Hybrid Counter Demo */}
63
+ <div className="bg-gradient-to-br from-slate-50 to-purple-50 rounded-2xl p-8 border-2 border-purple-200">
64
+ <div className="grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-6">
65
+ {/* Default Counter */}
66
+ <HybridLiveCounter />
67
+
68
+ {/* Customized Counter */}
69
+ <HybridLiveCounter
70
+ initialCount={10}
71
+ title="Custom Counter"
72
+ step={5}
73
+ room="demo-room"
74
+ userId="user-123"
75
+ />
76
+ <UserProfile />
77
+
78
+ {/* Live Clock Component */}
79
+ <LiveClock />
80
+ </div>
81
+
82
+ <div className="mt-6 p-4 bg-blue-50 rounded-lg">
83
+ <div className="flex items-center gap-2 mb-2">
84
+ <FaBullseye className="text-blue-800" />
85
+ <h4 className="font-semibold text-blue-800">Configurable via Props:</h4>
86
+ </div>
87
+ <code className="text-sm text-blue-700">
88
+ {`<HybridLiveCounter
89
+ initialCount={10}
90
+ title="Custom Counter"
91
+ step={5}
92
+ room="demo-room"
93
+ userId="user-123"
94
+ />`}
95
+ </code>
96
+ </div>
97
+ </div>
98
+
99
+ {/* Features Comparison */}
100
+ <div className="bg-white rounded-2xl shadow-lg border border-gray-200 overflow-hidden">
101
+ <div className="bg-gradient-to-r from-purple-50 to-blue-100 px-6 py-4 border-b border-gray-200">
102
+ <div className="flex items-center gap-2">
103
+ <FaEye className="text-gray-900" />
104
+ <h3 className="text-lg font-semibold text-gray-900">Live vs Hybrid Comparison</h3>
105
+ </div>
106
+ </div>
107
+ <div className="overflow-x-auto">
108
+ <table className="w-full">
109
+ <thead className="bg-gray-50">
110
+ <tr>
111
+ <th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Feature</th>
112
+ <th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
113
+ <div className="flex items-center gap-2">
114
+ <FaFire className="text-orange-500" />
115
+ Live Components
116
+ </div>
117
+ </th>
118
+ <th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
119
+ <div className="flex items-center gap-2">
120
+ <FaBolt className="text-yellow-500" />
121
+ Hybrid Live
122
+ </div>
123
+ </th>
124
+ </tr>
125
+ </thead>
126
+ <tbody className="bg-white divide-y divide-gray-200">
127
+ <tr>
128
+ <td className="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">State Location</td>
129
+ <td className="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Server Only</td>
130
+ <td className="px-6 py-4 whitespace-nowrap text-sm text-green-600">Client + Server</td>
131
+ </tr>
132
+ <tr className="bg-gray-50">
133
+ <td className="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">Offline Support</td>
134
+ <td className="px-6 py-4 whitespace-nowrap text-sm text-red-500">
135
+ <div className="flex items-center gap-2">
136
+ <FaTimesCircle />
137
+ None
138
+ </div>
139
+ </td>
140
+ <td className="px-6 py-4 whitespace-nowrap text-sm text-green-600">
141
+ <div className="flex items-center gap-2">
142
+ <FaCheckCircle />
143
+ Full Fallback
144
+ </div>
145
+ </td>
146
+ </tr>
147
+ <tr>
148
+ <td className="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">Performance</td>
149
+ <td className="px-6 py-4 whitespace-nowrap text-sm text-yellow-600">
150
+ <div className="flex items-center gap-2">
151
+ <FaEye />
152
+ Network Dependent
153
+ </div>
154
+ </td>
155
+ <td className="px-6 py-4 whitespace-nowrap text-sm text-green-600">
156
+ <div className="flex items-center gap-2">
157
+ <FaRocket />
158
+ Optimistic Updates
159
+ </div>
160
+ </td>
161
+ </tr>
162
+ <tr className="bg-gray-50">
163
+ <td className="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">Conflict Resolution</td>
164
+ <td className="px-6 py-4 whitespace-nowrap text-sm text-yellow-600">
165
+ <div className="flex items-center gap-2">
166
+ <FaCog />
167
+ Manual
168
+ </div>
169
+ </td>
170
+ <td className="px-6 py-4 whitespace-nowrap text-sm text-green-600">
171
+ <div className="flex items-center gap-2">
172
+ <FaSync />
173
+ Auto + Manual
174
+ </div>
175
+ </td>
176
+ </tr>
177
+ <tr>
178
+ <td className="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">State Validation</td>
179
+ <td className="px-6 py-4 whitespace-nowrap text-sm text-yellow-600">
180
+ <div className="flex items-center gap-2">
181
+ <FaCog />
182
+ Basic
183
+ </div>
184
+ </td>
185
+ <td className="px-6 py-4 whitespace-nowrap text-sm text-green-600">
186
+ <div className="flex items-center gap-2">
187
+ <FaCheckCircle />
188
+ Checksum + Version
189
+ </div>
190
+ </td>
191
+ </tr>
192
+ </tbody>
193
+ </table>
194
+ </div>
195
+ </div>
196
+
197
+ {/* Architecture Explanation */}
198
+ <div className="bg-white rounded-2xl shadow-lg border border-gray-200 overflow-hidden">
199
+ <div className="bg-gradient-to-r from-gray-50 to-purple-100 px-6 py-4 border-b border-gray-200">
200
+ <div className="flex items-center gap-2">
201
+ <FaCog className="text-gray-900" />
202
+ <h3 className="text-lg font-semibold text-gray-900">Hybrid Architecture</h3>
203
+ </div>
204
+ </div>
205
+ <div className="p-6 space-y-6">
206
+ <div className="grid grid-cols-1 md:grid-cols-2 gap-6">
207
+ <div>
208
+ <div className="flex items-center gap-2 mb-3">
209
+ <FaCog className="text-gray-900" />
210
+ <h4 className="text-base font-semibold text-gray-900">Frontend (useHybridLiveComponent):</h4>
211
+ </div>
212
+ <pre className="bg-gray-900 text-gray-100 p-4 rounded-xl overflow-x-auto text-sm">
213
+ {`const {
214
+ state, status, conflicts,
215
+ call, sync, resolveConflict
216
+ } = useHybridLiveComponent('Counter', {
217
+ count: 0,
218
+ title: 'Hybrid Counter'
219
+ }, {
220
+ enableValidation: true,
221
+ conflictResolution: 'auto',
222
+ syncStrategy: 'optimistic'
223
+ })`}
224
+ </pre>
225
+ </div>
226
+ <div>
227
+ <div className="flex items-center gap-2 mb-3">
228
+ <FaCog className="text-gray-900" />
229
+ <h4 className="text-base font-semibold text-gray-900">Features:</h4>
230
+ </div>
231
+ <ul className="space-y-2 text-sm text-gray-700">
232
+ <li className="flex items-center">
233
+ <FaCheckCircle className="text-green-500 mr-2" />
234
+ <strong>Estado inicial do frontend</strong> (component props)
235
+ </li>
236
+ <li className="flex items-center">
237
+ <FaCheckCircle className="text-green-500 mr-2" />
238
+ <strong>Zustand store local</strong> (performance + cache)
239
+ </li>
240
+ <li className="flex items-center">
241
+ <FaCheckCircle className="text-green-500 mr-2" />
242
+ <strong>Live Components sync</strong> (servidor autoritativo)
243
+ </li>
244
+ <li className="flex items-center">
245
+ <FaCheckCircle className="text-green-500 mr-2" />
246
+ <strong>Conflict detection</strong> (checksum + versioning)
247
+ </li>
248
+ <li className="flex items-center">
249
+ <FaCheckCircle className="text-green-500 mr-2" />
250
+ <strong>Auto reconnection</strong> (state sync on reconnect)
251
+ </li>
252
+ <li className="flex items-center">
253
+ <FaCheckCircle className="text-green-500 mr-2" />
254
+ <strong>Optimistic updates</strong> (immediate UI feedback)
255
+ </li>
256
+ </ul>
257
+ </div>
258
+ </div>
259
+ </div>
260
+ </div>
261
+ </div>
262
+ );
263
+ }
@@ -0,0 +1,155 @@
1
+ import React from 'react';
2
+ import {
3
+ FaRocket, FaReact, FaLink, FaDocker, FaFlask, FaPalette, FaFire, FaEye,
4
+ FaBolt
5
+ } from 'react-icons/fa';
6
+
7
+ export function OverviewPage() {
8
+ return (
9
+ <div className="relative">
10
+ {/* Hero Section with gradient background */}
11
+ <div className="relative overflow-hidden bg-gradient-to-br from-slate-900 via-purple-900 to-slate-900 rounded-3xl mb-12">
12
+ <div className="absolute inset-0 bg-gradient-to-r from-blue-900/20 to-purple-900/20"></div>
13
+ <div className="relative px-8 py-16 text-center">
14
+ <div className="mx-auto max-w-4xl">
15
+ <div className="flex items-center justify-center gap-4 mb-6">
16
+ <FaFire className="text-5xl text-orange-400" />
17
+ <h1 className="text-5xl font-bold text-white bg-gradient-to-r from-blue-400 via-purple-400 to-emerald-400 bg-clip-text text-transparent">
18
+ FluxStack v1.4.0
19
+ </h1>
20
+ <FaBolt className="text-5xl text-yellow-400" />
21
+ </div>
22
+ <div className="flex items-center justify-center gap-2 mb-8">
23
+ <p className="text-xl text-slate-300 max-w-2xl mx-auto leading-relaxed">
24
+ Framework full-stack TypeScript moderno com hot reload coordenado e Tailwind CSS 4!
25
+ </p>
26
+ <FaRocket className="text-xl text-blue-400" />
27
+ </div>
28
+ <div className="flex flex-wrap justify-center gap-3 mb-8">
29
+ <span className="px-4 py-2 bg-blue-500/20 text-blue-300 rounded-full text-sm font-medium border border-blue-500/30">
30
+ TypeScript
31
+ </span>
32
+ <span className="px-4 py-2 bg-purple-500/20 text-purple-300 rounded-full text-sm font-medium border border-purple-500/30">
33
+ Elysia.js
34
+ </span>
35
+ <span className="px-4 py-2 bg-emerald-500/20 text-emerald-300 rounded-full text-sm font-medium border border-emerald-500/30">
36
+ React 19
37
+ </span>
38
+ <span className="px-4 py-2 bg-orange-500/20 text-orange-300 rounded-full text-sm font-medium border border-orange-500/30">
39
+ Tailwind CSS 4
40
+ </span>
41
+ </div>
42
+ </div>
43
+ </div>
44
+ </div>
45
+
46
+ {/* Features Grid */}
47
+ <div className="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-6 mb-12">
48
+ {[
49
+ {
50
+ icon: <FaRocket className="text-blue-500" />,
51
+ title: "Elysia.js",
52
+ description: "Backend rápido e type-safe com Bun runtime",
53
+ color: "from-blue-500 to-cyan-500"
54
+ },
55
+ {
56
+ icon: <FaReact className="text-purple-500" />,
57
+ title: "React + Vite",
58
+ description: "Frontend moderno com hot-reload ultrarrápido",
59
+ color: "from-purple-500 to-pink-500"
60
+ },
61
+ {
62
+ icon: <FaLink className="text-emerald-500" />,
63
+ title: "Eden Treaty",
64
+ description: "API type-safe com inferência automática de tipos",
65
+ color: "from-emerald-500 to-teal-500"
66
+ },
67
+ {
68
+ icon: <FaDocker className="text-indigo-500" />,
69
+ title: "Docker Ready",
70
+ description: "Deploy fácil com configurações otimizadas",
71
+ color: "from-indigo-500 to-purple-500"
72
+ },
73
+ {
74
+ icon: <FaFlask className="text-orange-500" />,
75
+ title: "Testing",
76
+ description: "Vitest + Testing Library configurados",
77
+ color: "from-orange-500 to-red-500"
78
+ },
79
+ {
80
+ icon: <FaPalette className="text-teal-500" />,
81
+ title: "Tailwind CSS 4",
82
+ description: "Styling moderno e responsivo",
83
+ color: "from-teal-500 to-green-500"
84
+ }
85
+ ].map((feature, index) => (
86
+ <div
87
+ key={index}
88
+ className="group relative bg-white rounded-2xl p-6 shadow-lg hover:shadow-xl transition-all duration-300 hover:-translate-y-1 border border-gray-200"
89
+ >
90
+ <div className={`absolute inset-0 bg-gradient-to-r ${feature.color} opacity-0 group-hover:opacity-5 rounded-2xl transition-opacity duration-300`}></div>
91
+ <div className="relative">
92
+ <div className="text-4xl mb-4">{feature.icon}</div>
93
+ <h3 className="text-xl font-semibold text-gray-900 mb-2">{feature.title}</h3>
94
+ <p className="text-gray-600 leading-relaxed">{feature.description}</p>
95
+ </div>
96
+ </div>
97
+ ))}
98
+ </div>
99
+
100
+ {/* Tech Stack Section */}
101
+ <div className="bg-white rounded-2xl shadow-lg border border-gray-200 overflow-hidden">
102
+ <div className="bg-gradient-to-r from-gray-50 to-slate-100 px-8 py-6 border-b border-gray-200">
103
+ <h2 className="text-2xl font-bold text-gray-900 text-center">Stack Tecnológica</h2>
104
+ </div>
105
+ <div className="p-8">
106
+ <div className="grid grid-cols-1 md:grid-cols-3 gap-8">
107
+ {[
108
+ {
109
+ title: "Backend",
110
+ color: "blue",
111
+ items: [
112
+ "Elysia.js - Web framework",
113
+ "Bun - Runtime & package manager",
114
+ "TypeScript - Type safety"
115
+ ]
116
+ },
117
+ {
118
+ title: "Frontend",
119
+ color: "purple",
120
+ items: [
121
+ "React 19 - UI library",
122
+ "Vite - Build tool",
123
+ "Tailwind CSS 4 - Styling"
124
+ ]
125
+ },
126
+ {
127
+ title: "Comunicação",
128
+ color: "emerald",
129
+ items: [
130
+ "Eden Treaty - Type-safe API",
131
+ "End-to-end TypeScript",
132
+ "Automatic type inference"
133
+ ]
134
+ }
135
+ ].map((category, index) => (
136
+ <div key={index} className="space-y-4">
137
+ <h3 className={`text-lg font-semibold text-${category.color}-600 pb-2 border-b-2 border-${category.color}-100`}>
138
+ {category.title}
139
+ </h3>
140
+ <ul className="space-y-3">
141
+ {category.items.map((item, itemIndex) => (
142
+ <li key={itemIndex} className="flex items-start gap-3 text-gray-600">
143
+ <div className={`w-2 h-2 rounded-full bg-${category.color}-400 flex-shrink-0 mt-2`}></div>
144
+ <span>{item}</span>
145
+ </li>
146
+ ))}
147
+ </ul>
148
+ </div>
149
+ ))}
150
+ </div>
151
+ </div>
152
+ </div>
153
+ </div>
154
+ );
155
+ }
@@ -0,0 +1,43 @@
1
+ # FluxStack State Management
2
+
3
+ This directory contains your application's state management using FluxStack's core state utilities.
4
+
5
+ ## Using FluxStack Core State
6
+
7
+ FluxStack provides core utilities for state management that are protected from accidental modification:
8
+
9
+ ```typescript
10
+ // Import from core
11
+ import { createUserStore, createFluxStore } from '../../../core/client/state/index.js'
12
+
13
+ // Create stores using FluxStack conventions
14
+ export const useUserStore = createUserStore({
15
+ name: 'user-store',
16
+ persist: true
17
+ })
18
+
19
+ // Create custom stores
20
+ export const useAppStore = createFluxStore(
21
+ (set, get) => ({
22
+ // Your app-specific state
23
+ }),
24
+ {
25
+ name: 'app-store',
26
+ persist: false
27
+ }
28
+ )
29
+ ```
30
+
31
+ ## Available Core Features
32
+
33
+ - **createUserStore()**: Pre-built user authentication store
34
+ - **createFluxStore()**: Factory for custom stores with persistence
35
+ - **createAuthHook()**: Authentication hook factory
36
+
37
+ ## Benefits
38
+
39
+ - ✅ **Protected Core**: Framework code is safe from accidental changes
40
+ - ✅ **Consistent API**: All stores follow FluxStack conventions
41
+ - ✅ **Built-in Features**: Persistence, logging, error handling
42
+ - ✅ **Type Safety**: Full TypeScript support
43
+ - ✅ **Extensible**: Easy to customize for your needs
@@ -0,0 +1,16 @@
1
+ /**
2
+ * FluxStack Store Index
3
+ * Re-exports all Zustand stores and utilities
4
+ */
5
+
6
+ // Stores
7
+ export { useUserStore } from './slices/userSlice'
8
+ export { useUIStore } from './slices/uiSlice'
9
+
10
+ // Types
11
+ export type { User, LoginCredentials, RegisterData } from './slices/userSlice'
12
+ export type { Notification, Modal } from './slices/uiSlice'
13
+
14
+ // Utility hooks
15
+ export { useAuth } from '../hooks/useAuth'
16
+ export { useNotifications } from '../hooks/useNotifications'
@@ -0,0 +1,151 @@
1
+ /**
2
+ * UI Store with Zustand
3
+ * Manages global UI state like modals, notifications, theme, etc.
4
+ */
5
+
6
+ import { create } from 'zustand'
7
+ import { persist } from 'zustand/middleware'
8
+
9
+ export interface Notification {
10
+ id: string
11
+ type: 'success' | 'error' | 'warning' | 'info'
12
+ title: string
13
+ message: string
14
+ duration?: number
15
+ timestamp: number
16
+ }
17
+
18
+ export interface Modal {
19
+ id: string
20
+ component: string
21
+ props?: Record<string, any>
22
+ closable?: boolean
23
+ }
24
+
25
+ interface UIState {
26
+ // State
27
+ theme: 'light' | 'dark' | 'system'
28
+ sidebarOpen: boolean
29
+ notifications: Notification[]
30
+ modals: Modal[]
31
+ loading: {
32
+ global: boolean
33
+ operations: Record<string, boolean>
34
+ }
35
+
36
+ // Actions
37
+ setTheme: (theme: 'light' | 'dark' | 'system') => void
38
+ toggleSidebar: () => void
39
+ setSidebarOpen: (open: boolean) => void
40
+
41
+ // Notifications
42
+ addNotification: (notification: Omit<Notification, 'id' | 'timestamp'>) => void
43
+ removeNotification: (id: string) => void
44
+ clearNotifications: () => void
45
+
46
+ // Modals
47
+ openModal: (modal: Omit<Modal, 'id'>) => void
48
+ closeModal: (id: string) => void
49
+ closeAllModals: () => void
50
+
51
+ // Loading
52
+ setGlobalLoading: (loading: boolean) => void
53
+ setOperationLoading: (operation: string, loading: boolean) => void
54
+ clearOperationLoading: (operation: string) => void
55
+ }
56
+
57
+ export const useUIStore = create<UIState>()(
58
+ persist(
59
+ (set, get) => ({
60
+ // Initial state
61
+ theme: 'system',
62
+ sidebarOpen: true,
63
+ notifications: [],
64
+ modals: [],
65
+ loading: {
66
+ global: false,
67
+ operations: {}
68
+ },
69
+
70
+ // Theme actions
71
+ setTheme: (theme) => set({ theme }),
72
+
73
+ // Sidebar actions
74
+ toggleSidebar: () => set((state) => ({ sidebarOpen: !state.sidebarOpen })),
75
+ setSidebarOpen: (open) => set({ sidebarOpen: open }),
76
+
77
+ // Notification actions
78
+ addNotification: (notification) => {
79
+ const newNotification: Notification = {
80
+ ...notification,
81
+ id: Math.random().toString(36).substr(2, 9),
82
+ timestamp: Date.now()
83
+ }
84
+
85
+ set((state) => ({
86
+ notifications: [...state.notifications, newNotification]
87
+ }))
88
+
89
+ // Auto-remove notification after duration
90
+ if (notification.duration !== 0) {
91
+ setTimeout(() => {
92
+ get().removeNotification(newNotification.id)
93
+ }, notification.duration || 5000)
94
+ }
95
+ },
96
+
97
+ removeNotification: (id) => set((state) => ({
98
+ notifications: state.notifications.filter(n => n.id !== id)
99
+ })),
100
+
101
+ clearNotifications: () => set({ notifications: [] }),
102
+
103
+ // Modal actions
104
+ openModal: (modal) => {
105
+ const newModal: Modal = {
106
+ ...modal,
107
+ id: Math.random().toString(36).substr(2, 9)
108
+ }
109
+
110
+ set((state) => ({
111
+ modals: [...state.modals, newModal]
112
+ }))
113
+ },
114
+
115
+ closeModal: (id) => set((state) => ({
116
+ modals: state.modals.filter(m => m.id !== id)
117
+ })),
118
+
119
+ closeAllModals: () => set({ modals: [] }),
120
+
121
+ // Loading actions
122
+ setGlobalLoading: (loading) => set((state) => ({
123
+ loading: { ...state.loading, global: loading }
124
+ })),
125
+
126
+ setOperationLoading: (operation, loading) => set((state) => ({
127
+ loading: {
128
+ ...state.loading,
129
+ operations: {
130
+ ...state.loading.operations,
131
+ [operation]: loading
132
+ }
133
+ }
134
+ })),
135
+
136
+ clearOperationLoading: (operation) => set((state) => {
137
+ const { [operation]: _, ...operations } = state.loading.operations
138
+ return {
139
+ loading: { ...state.loading, operations }
140
+ }
141
+ })
142
+ }),
143
+ {
144
+ name: 'ui-store',
145
+ partialize: (state) => ({
146
+ theme: state.theme,
147
+ sidebarOpen: state.sidebarOpen
148
+ })
149
+ }
150
+ )
151
+ )