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,174 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
FaFire, FaRocket, FaCheckCircle, FaTimesCircle, FaSpinner, FaSync, FaUsers, FaPlus, FaTrash
|
|
4
|
-
} from 'react-icons/fa';
|
|
5
|
-
|
|
6
|
-
// This component will receive a lot of props from App.tsx initially.
|
|
7
|
-
// A good next step would be to move this state to a shared context.
|
|
8
|
-
export function DemoPage({
|
|
9
|
-
users,
|
|
10
|
-
apiStatus,
|
|
11
|
-
loading,
|
|
12
|
-
submitting,
|
|
13
|
-
name,
|
|
14
|
-
email,
|
|
15
|
-
setName,
|
|
16
|
-
setEmail,
|
|
17
|
-
handleSubmit,
|
|
18
|
-
handleDelete,
|
|
19
|
-
loadUsers,
|
|
20
|
-
getInitials
|
|
21
|
-
}) {
|
|
22
|
-
return (
|
|
23
|
-
<div className="space-y-8">
|
|
24
|
-
{/* Header */}
|
|
25
|
-
<div className="text-center">
|
|
26
|
-
<div className="flex items-center justify-center gap-3 mb-4">
|
|
27
|
-
<FaFire className="text-3xl text-orange-500" />
|
|
28
|
-
<h2 className="text-3xl font-bold text-gray-900">Demo Interativo</h2>
|
|
29
|
-
</div>
|
|
30
|
-
<div className="flex items-center justify-center gap-2">
|
|
31
|
-
<p className="text-lg text-gray-600 max-w-2xl mx-auto">
|
|
32
|
-
Teste a API em tempo real com hot reload coordenado e Eden Treaty
|
|
33
|
-
</p>
|
|
34
|
-
<FaRocket className="text-lg text-blue-500" />
|
|
35
|
-
</div>
|
|
36
|
-
</div>
|
|
37
|
-
|
|
38
|
-
{/* Stats Cards */}
|
|
39
|
-
<div className="grid grid-cols-1 md:grid-cols-3 gap-6">
|
|
40
|
-
<div className="bg-gradient-to-br from-blue-50 to-blue-100 border border-blue-200 rounded-2xl p-6 text-center">
|
|
41
|
-
<div className="text-4xl font-bold text-blue-600 mb-2">{users.length}</div>
|
|
42
|
-
<div className="text-sm font-medium text-blue-700 uppercase tracking-wide">Usuários</div>
|
|
43
|
-
</div>
|
|
44
|
-
<div className={`bg-gradient-to-br ${apiStatus === 'online' ? 'from-emerald-50 to-emerald-100 border-emerald-200' : 'from-red-50 to-red-100 border-red-200'} border rounded-2xl p-6 text-center`}>
|
|
45
|
-
<div className="text-4xl mb-2">
|
|
46
|
-
{apiStatus === 'online' ? (
|
|
47
|
-
<FaCheckCircle className="text-emerald-500 mx-auto" />
|
|
48
|
-
) : (
|
|
49
|
-
<FaTimesCircle className="text-red-500 mx-auto" />
|
|
50
|
-
)}
|
|
51
|
-
</div>
|
|
52
|
-
<div className={`text-sm font-medium uppercase tracking-wide ${apiStatus === 'online' ? 'text-emerald-700' : 'text-red-700'}`}>
|
|
53
|
-
API {apiStatus === 'online' ? 'Online' : 'Offline'}
|
|
54
|
-
</div>
|
|
55
|
-
</div>
|
|
56
|
-
<div className="bg-gradient-to-br from-purple-50 to-purple-100 border border-purple-200 rounded-2xl p-6 text-center">
|
|
57
|
-
<div className="text-4xl mb-2">
|
|
58
|
-
<FaRocket className="text-purple-500 mx-auto" />
|
|
59
|
-
</div>
|
|
60
|
-
<div className="text-sm font-medium text-purple-700 uppercase tracking-wide">Eden Treaty</div>
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
|
|
64
|
-
{/* Add User Form */}
|
|
65
|
-
<div className="bg-white rounded-2xl shadow-lg border border-gray-200 overflow-hidden">
|
|
66
|
-
<div className="bg-gradient-to-r from-gray-50 to-slate-100 px-6 py-4 border-b border-gray-200">
|
|
67
|
-
<h3 className="text-lg font-semibold text-gray-900">Adicionar Usuário</h3>
|
|
68
|
-
</div>
|
|
69
|
-
<div className="p-6">
|
|
70
|
-
<form onSubmit={handleSubmit} className="grid grid-cols-1 md:grid-cols-2 gap-4 md:gap-6">
|
|
71
|
-
<div className="space-y-2">
|
|
72
|
-
<label className="block text-sm font-medium text-gray-700">Nome</label>
|
|
73
|
-
<input
|
|
74
|
-
type="text"
|
|
75
|
-
className="w-full px-4 py-3 border border-gray-300 rounded-xl focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all duration-200 placeholder-gray-400"
|
|
76
|
-
value={name}
|
|
77
|
-
onChange={(e) => setName(e.target.value)}
|
|
78
|
-
placeholder="Nome completo"
|
|
79
|
-
required
|
|
80
|
-
/>
|
|
81
|
-
</div>
|
|
82
|
-
<div className="space-y-2">
|
|
83
|
-
<label className="block text-sm font-medium text-gray-700">Email</label>
|
|
84
|
-
<input
|
|
85
|
-
type="email"
|
|
86
|
-
className="w-full px-4 py-3 border border-gray-300 rounded-xl focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all duration-200 placeholder-gray-400"
|
|
87
|
-
value={email}
|
|
88
|
-
onChange={(e) => setEmail(e.target.value)}
|
|
89
|
-
placeholder="email@exemplo.com"
|
|
90
|
-
required
|
|
91
|
-
/>
|
|
92
|
-
</div>
|
|
93
|
-
<div className="md:col-span-2">
|
|
94
|
-
<button
|
|
95
|
-
type="submit"
|
|
96
|
-
className="w-full md:w-auto px-8 py-3 bg-gradient-to-r from-blue-600 to-blue-700 text-white font-medium rounded-xl hover:from-blue-700 hover:to-blue-800 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed transition-all duration-200 shadow-lg hover:shadow-xl"
|
|
97
|
-
disabled={submitting || !name.trim() || !email.trim()}
|
|
98
|
-
>
|
|
99
|
-
{submitting ? (
|
|
100
|
-
<span className="flex items-center gap-2">
|
|
101
|
-
<FaSpinner className="w-4 h-4 animate-spin" />
|
|
102
|
-
Adicionando...
|
|
103
|
-
</span>
|
|
104
|
-
) : (
|
|
105
|
-
<span className="flex items-center gap-2">
|
|
106
|
-
<FaPlus className="w-4 h-4" />
|
|
107
|
-
Adicionar Usuário
|
|
108
|
-
</span>
|
|
109
|
-
)}
|
|
110
|
-
</button>
|
|
111
|
-
</div>
|
|
112
|
-
</form>
|
|
113
|
-
</div>
|
|
114
|
-
</div>
|
|
115
|
-
|
|
116
|
-
{/* Users List */}
|
|
117
|
-
<div className="bg-white rounded-2xl shadow-lg border border-gray-200 overflow-hidden">
|
|
118
|
-
<div className="bg-gradient-to-r from-gray-50 to-slate-100 px-6 py-4 border-b border-gray-200 flex justify-between items-center">
|
|
119
|
-
<h3 className="text-lg font-semibold text-gray-900">Usuários ({users.length})</h3>
|
|
120
|
-
<button
|
|
121
|
-
className="flex items-center gap-2 px-4 py-2 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 disabled:opacity-50 transition-all duration-200"
|
|
122
|
-
onClick={loadUsers}
|
|
123
|
-
disabled={loading}
|
|
124
|
-
>
|
|
125
|
-
{loading ? (
|
|
126
|
-
<FaSpinner className="w-4 h-4 animate-spin" />
|
|
127
|
-
) : (
|
|
128
|
-
<FaSync className="w-4 h-4" />
|
|
129
|
-
)}
|
|
130
|
-
Atualizar
|
|
131
|
-
</button>
|
|
132
|
-
</div>
|
|
133
|
-
|
|
134
|
-
<div className="p-6">
|
|
135
|
-
{loading ? (
|
|
136
|
-
<div className="text-center py-12">
|
|
137
|
-
<FaSpinner className="w-8 h-8 text-blue-600 animate-spin mx-auto mb-4" />
|
|
138
|
-
<p className="text-gray-600">Carregando usuários...</p>
|
|
139
|
-
</div>
|
|
140
|
-
) : users.length === 0 ? (
|
|
141
|
-
<div className="text-center py-12">
|
|
142
|
-
<FaUsers className="text-6xl text-gray-400 mx-auto mb-4" />
|
|
143
|
-
<h4 className="text-lg font-medium text-gray-900 mb-2">Nenhum usuário encontrado</h4>
|
|
144
|
-
<p className="text-gray-600">Adicione o primeiro usuário usando o formulário acima</p>
|
|
145
|
-
</div>
|
|
146
|
-
) : (
|
|
147
|
-
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
|
148
|
-
{users.map(user => (
|
|
149
|
-
<div key={user.id} className="group bg-gray-50 border border-gray-200 rounded-xl p-4 hover:shadow-lg hover:border-blue-300 transition-all duration-200">
|
|
150
|
-
<div className="flex items-start gap-3">
|
|
151
|
-
<div className="w-12 h-12 bg-gradient-to-br from-blue-500 to-purple-600 rounded-full flex items-center justify-center text-white font-bold text-sm flex-shrink-0">
|
|
152
|
-
{getInitials(user.name)}
|
|
153
|
-
</div>
|
|
154
|
-
<div className="flex-1 min-w-0">
|
|
155
|
-
<h4 className="font-medium text-gray-900 truncate">{user.name}</h4>
|
|
156
|
-
<p className="text-sm text-gray-600 truncate">{user.email}</p>
|
|
157
|
-
<button
|
|
158
|
-
className="mt-3 w-full px-3 py-2 bg-red-50 text-red-700 border border-red-200 rounded-lg hover:bg-red-100 hover:border-red-300 focus:ring-2 focus:ring-red-500 focus:ring-offset-2 transition-all duration-200 text-sm font-medium flex items-center justify-center gap-2"
|
|
159
|
-
onClick={() => handleDelete(user.id, user.name)}
|
|
160
|
-
>
|
|
161
|
-
<FaTrash className="w-3 h-3" />
|
|
162
|
-
Remover
|
|
163
|
-
</button>
|
|
164
|
-
</div>
|
|
165
|
-
</div>
|
|
166
|
-
</div>
|
|
167
|
-
))}
|
|
168
|
-
</div>
|
|
169
|
-
)}
|
|
170
|
-
</div>
|
|
171
|
-
</div>
|
|
172
|
-
</div>
|
|
173
|
-
);
|
|
174
|
-
}
|
|
@@ -1,263 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,155 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
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
|
|
@@ -1,16 +0,0 @@
|
|
|
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'
|