create-fluxstack 1.8.1 โ†’ 1.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/.env.example +19 -0
  2. package/README.md +6 -3
  3. package/app/client/SIMPLIFICATION.md +140 -0
  4. package/app/client/frontend-only.ts +1 -1
  5. package/app/client/src/App.tsx +148 -283
  6. package/app/client/src/index.css +5 -20
  7. package/app/client/src/lib/eden-api.ts +53 -220
  8. package/app/client/src/main.tsx +2 -3
  9. package/app/server/controllers/users.controller.ts +57 -31
  10. package/app/server/index.ts +5 -2
  11. package/app/server/live/register-components.ts +18 -7
  12. package/app/server/routes/env-test.ts +53 -2
  13. package/app/server/routes/index.ts +1 -8
  14. package/app/server/routes/users.routes.ts +192 -91
  15. package/config/fluxstack.config.ts +2 -2
  16. package/config/plugins.config.ts +22 -1
  17. package/core/build/flux-plugins-generator.ts +5 -5
  18. package/core/build/live-components-generator.ts +15 -12
  19. package/core/cli/command-registry.ts +4 -14
  20. package/core/cli/commands/plugin-deps.ts +8 -8
  21. package/core/cli/generators/component.ts +3 -3
  22. package/core/cli/generators/controller.ts +4 -4
  23. package/core/cli/generators/index.ts +8 -8
  24. package/core/cli/generators/interactive.ts +4 -4
  25. package/core/cli/generators/plugin.ts +3 -3
  26. package/core/cli/generators/prompts.ts +1 -1
  27. package/core/cli/generators/route.ts +27 -11
  28. package/core/cli/generators/service.ts +5 -5
  29. package/core/cli/generators/template-engine.ts +1 -1
  30. package/core/cli/generators/types.ts +1 -1
  31. package/core/cli/index.ts +158 -193
  32. package/core/cli/plugin-discovery.ts +3 -3
  33. package/core/client/hooks/index.ts +2 -2
  34. package/core/client/hooks/state-validator.ts +1 -1
  35. package/core/client/hooks/useAuth.ts +1 -1
  36. package/core/client/hooks/useChunkedUpload.ts +1 -1
  37. package/core/client/hooks/useHybridLiveComponent.ts +1 -1
  38. package/core/client/hooks/useWebSocket.ts +1 -1
  39. package/core/config/env.ts +1 -1
  40. package/core/config/runtime-config.ts +5 -5
  41. package/core/config/schema.ts +9 -0
  42. package/core/framework/server.ts +30 -15
  43. package/core/framework/types.ts +2 -2
  44. package/core/live/ComponentRegistry.ts +1 -1
  45. package/core/plugins/built-in/live-components/commands/create-live-component.ts +1 -1
  46. package/core/plugins/built-in/live-components/index.ts +1 -1
  47. package/core/plugins/built-in/monitoring/index.ts +65 -161
  48. package/core/plugins/built-in/static/index.ts +18 -47
  49. package/core/plugins/built-in/swagger/index.ts +301 -231
  50. package/core/plugins/built-in/vite/index.ts +74 -109
  51. package/core/plugins/config.ts +2 -2
  52. package/core/plugins/dependency-manager.ts +2 -2
  53. package/core/plugins/discovery.ts +1 -1
  54. package/core/plugins/executor.ts +2 -2
  55. package/core/plugins/manager.ts +19 -4
  56. package/core/plugins/module-resolver.ts +1 -1
  57. package/core/plugins/registry.ts +3 -3
  58. package/core/plugins/types.ts +147 -5
  59. package/core/server/framework.ts +2 -2
  60. package/core/server/live/ComponentRegistry.ts +9 -26
  61. package/core/server/live/FileUploadManager.ts +1 -1
  62. package/core/server/live/auto-generated-components.ts +26 -0
  63. package/core/server/live/websocket-plugin.ts +211 -19
  64. package/core/server/middleware/errorHandling.ts +1 -1
  65. package/core/server/middleware/index.ts +4 -4
  66. package/core/server/plugins/database.ts +1 -2
  67. package/core/server/plugins/static-files-plugin.ts +259 -231
  68. package/core/server/plugins/swagger.ts +1 -1
  69. package/core/server/services/BaseService.ts +1 -1
  70. package/core/server/services/ServiceContainer.ts +1 -1
  71. package/core/server/services/index.ts +4 -4
  72. package/core/server/standalone.ts +16 -1
  73. package/core/testing/index.ts +1 -1
  74. package/core/testing/setup.ts +1 -1
  75. package/core/utils/logger/startup-banner.ts +7 -33
  76. package/core/utils/version.ts +6 -6
  77. package/create-fluxstack.ts +68 -25
  78. package/package.json +2 -2
  79. package/plugins/crypto-auth/index.ts +52 -47
  80. package/plugins/crypto-auth/server/AuthMiddleware.ts +1 -1
  81. package/plugins/crypto-auth/server/middlewares/helpers.ts +16 -1
  82. package/vitest.config.ts +11 -2
  83. package/app/client/src/App.css +0 -883
  84. package/app/client/src/components/ErrorBoundary.tsx +0 -107
  85. package/app/client/src/components/ErrorDisplay.css +0 -365
  86. package/app/client/src/components/ErrorDisplay.tsx +0 -258
  87. package/app/client/src/components/FluxStackConfig.tsx +0 -1321
  88. package/app/client/src/components/HybridLiveCounter.tsx +0 -140
  89. package/app/client/src/components/LiveClock.tsx +0 -286
  90. package/app/client/src/components/MainLayout.tsx +0 -388
  91. package/app/client/src/components/SidebarNavigation.tsx +0 -391
  92. package/app/client/src/components/StateDemo.tsx +0 -178
  93. package/app/client/src/components/SystemMonitor.tsx +0 -1044
  94. package/app/client/src/components/UserProfile.tsx +0 -809
  95. package/app/client/src/hooks/useAuth.ts +0 -39
  96. package/app/client/src/hooks/useNotifications.ts +0 -56
  97. package/app/client/src/lib/errors.ts +0 -340
  98. package/app/client/src/lib/hooks/useErrorHandler.ts +0 -258
  99. package/app/client/src/lib/index.ts +0 -45
  100. package/app/client/src/pages/ApiDocs.tsx +0 -182
  101. package/app/client/src/pages/CryptoAuthPage.tsx +0 -394
  102. package/app/client/src/pages/Demo.tsx +0 -174
  103. package/app/client/src/pages/HybridLive.tsx +0 -263
  104. package/app/client/src/pages/Overview.tsx +0 -155
  105. package/app/client/src/store/README.md +0 -43
  106. package/app/client/src/store/index.ts +0 -16
  107. package/app/client/src/store/slices/uiSlice.ts +0 -151
  108. package/app/client/src/store/slices/userSlice.ts +0 -161
  109. package/app/client/src/test/README.md +0 -257
  110. package/app/client/src/test/setup.ts +0 -70
  111. package/app/client/src/test/types.ts +0 -12
  112. package/app/server/live/CounterComponent.ts +0 -191
  113. package/app/server/live/FluxStackConfig.ts +0 -534
  114. package/app/server/live/SidebarNavigation.ts +0 -157
  115. package/app/server/live/SystemMonitor.ts +0 -595
  116. package/app/server/live/SystemMonitorIntegration.ts +0 -151
  117. package/app/server/live/UserProfileComponent.ts +0 -141
  118. package/app/server/middleware/auth.ts +0 -136
  119. package/app/server/middleware/errorHandling.ts +0 -252
  120. package/app/server/middleware/index.ts +0 -10
  121. package/app/server/middleware/rateLimit.ts +0 -193
  122. package/app/server/middleware/requestLogging.ts +0 -215
  123. package/app/server/middleware/validation.ts +0 -270
  124. package/app/server/routes/config.ts +0 -145
  125. package/app/server/routes/crypto-auth-demo.routes.ts +0 -167
  126. package/app/server/routes/example-with-crypto-auth.routes.ts +0 -235
  127. package/app/server/routes/exemplo-posts.routes.ts +0 -161
  128. package/app/server/routes/upload.ts +0 -92
  129. package/app/server/services/NotificationService.ts +0 -302
  130. package/app/server/services/UserService.ts +0 -222
  131. package/app/server/services/index.ts +0 -46
  132. package/app/server/types/index.ts +0 -1
package/.env.example CHANGED
@@ -28,6 +28,25 @@ CORS_HEADERS=Content-Type,Authorization
28
28
  # Logging
29
29
  LOG_LEVEL=info
30
30
 
31
+ # Swagger Documentation
32
+ SWAGGER_ENABLED=true
33
+ SWAGGER_TITLE=FluxStack API
34
+ SWAGGER_VERSION=1.8.2
35
+ SWAGGER_DESCRIPTION=API documentation for FluxStack application
36
+ SWAGGER_PATH=/swagger
37
+ # SWAGGER_EXCLUDE_PATHS=/internal,/admin
38
+ # SWAGGER_SERVERS=https://api.myapp.com|Production,https://staging.myapp.com|Staging
39
+ SWAGGER_PERSIST_AUTH=true
40
+ SWAGGER_DISPLAY_DURATION=true
41
+ SWAGGER_ENABLE_FILTER=true
42
+ SWAGGER_SHOW_EXTENSIONS=true
43
+ SWAGGER_TRY_IT_OUT=true
44
+
45
+ # Swagger Authentication (Basic Auth)
46
+ SWAGGER_AUTH_ENABLED=false
47
+ SWAGGER_AUTH_USERNAME=admin
48
+ # SWAGGER_AUTH_PASSWORD=your-secure-password-here
49
+
31
50
  # Build Configuration
32
51
  BUILD_TARGET=bun
33
52
  BUILD_OUTDIR=dist
package/README.md CHANGED
@@ -10,12 +10,15 @@ Create modern full-stack TypeScript applications with zero configuration.
10
10
  ## Quick Start
11
11
 
12
12
  ```bash
13
- # scaffold a new FluxStack app
13
+ # Create a new FluxStack app
14
14
  bunx create-fluxstack my-awesome-app
15
-
16
- # enter the project and start developing
17
15
  cd my-awesome-app
18
16
  bun run dev
17
+
18
+ # OR create in current directory
19
+ mkdir my-app && cd my-app
20
+ bunx create-fluxstack .
21
+ bun run dev
19
22
  ```
20
23
 
21
24
  Your development environment will be available at:
@@ -0,0 +1,140 @@
1
+ # ๐ŸŽจ FluxStack Client - Simplified Version
2
+
3
+ This is a **simplified, single-page version** of the FluxStack client, inspired by the clean and modern design of Vite's landing page.
4
+
5
+ ## ๐Ÿš€ What Changed?
6
+
7
+ ### โœ… **Kept (Essential)**
8
+ - โœ… **Eden Treaty** - Core type-safe API client
9
+ - โœ… **React 19** - Modern React with hooks
10
+ - โœ… **Vite 7** - Lightning-fast dev server
11
+ - โœ… **TailwindCSS** - Utility-first styling
12
+ - โœ… **TypeScript** - Full type safety
13
+ - โœ… **react-icons** - Icon library
14
+
15
+ ### โŒ **Removed (Complexity)**
16
+ - โŒ **React Router** - No more multi-page routing
17
+ - โŒ **Zustand** - Removed complex state management (using simple `useState`)
18
+ - โŒ **Multiple Pages** - Consolidated into single page (Overview, Demo, HybridLive, ApiDocs, CryptoAuth)
19
+ - โŒ **Complex Error System** - Simplified error handling
20
+ - โŒ **Navigation System** - No more tabs and complex navigation
21
+ - โŒ **Detailed API Status Section** - Replaced with simple badge
22
+ - โŒ **Complex Live Component UIs** - Simplified to minimal clock display
23
+
24
+ ### โœ… **Kept (Advanced Features)**
25
+ - โœ… **LiveComponents** - Live Clock provido via LiveComponent
26
+ - โœ… **LiveComponentsProvider** - Full real-time capabilities maintained
27
+ - โœ… **Hybrid Live Component** - Clock synced with server in real-time
28
+
29
+ ## ๐Ÿ“Š Comparison
30
+
31
+ | Metric | Before | After | Reduction |
32
+ |--------|--------|-------|-----------|
33
+ | **Files** | 43 | ~10 | **-76%** |
34
+ | **Components** | 11 | 2 | **-82%** |
35
+ | **Pages** | 5 | 1 | **-80%** |
36
+ | **Dependencies** | 27 | 19 | **-30%** |
37
+ | **Lines in App.tsx** | 331 | 213 | **-36%** |
38
+ | **Live Components** | 6 complex | 1 minimal | **-83%** |
39
+
40
+ ## ๐ŸŽฏ What Does It Show?
41
+
42
+ The simplified client demonstrates:
43
+
44
+ 1. **๐ŸŽจ Minimalist Design** - Clean, centered design inspired by Next.js, React, and Vite
45
+ 2. **โšก Simple API Status** - Single badge showing API online/offline
46
+ 3. **๐Ÿš€ Core Features** - 4 feature cards highlighting main capabilities
47
+ 4. **๐Ÿ• Live Clock** - Real LiveComponent synced with server in real-time
48
+ 5. **๐Ÿ“– Quick Actions** - Direct links to API Docs, GitHub, and API Demo
49
+ 6. **๐Ÿ”ฅ Clean but Powerful** - Minimalist UI with full real-time capabilities
50
+
51
+ ## ๐Ÿ“ Structure
52
+
53
+ ```
54
+ app/client/src/
55
+ โ”œโ”€โ”€ App.tsx # Single-page application (213 lines)
56
+ โ”‚ # - AppContent component (main UI)
57
+ โ”‚ # - MinimalLiveClock component (LiveComponent)
58
+ โ”‚ # - LiveComponentsProvider wrapper
59
+ โ”œโ”€โ”€ main.tsx # Entry point (simplified)
60
+ โ”œโ”€โ”€ index.css # Minimal global styles
61
+ โ”œโ”€โ”€ vite-env.d.ts # Vite type definitions
62
+ โ”œโ”€โ”€ assets/ # Static assets
63
+ โ”‚ โ””โ”€โ”€ react.svg # React logo
64
+ โ””โ”€โ”€ lib/ # Core utilities
65
+ โ”œโ”€โ”€ eden-api.ts # Eden Treaty API client
66
+ โ””โ”€โ”€ errors.ts # Error handling utilities
67
+ ```
68
+
69
+ **Total files in src/**: 6 core files (vs 43+ before)
70
+
71
+ ## ๐ŸŽจ Design Philosophy
72
+
73
+ Inspired by **Next.js, React, and Vite landing pages**:
74
+ - Everything centered vertically and horizontally
75
+ - Large animated logo (fire icon with pulse animation)
76
+ - Minimal text, maximum impact
77
+ - Simple API status badge (online/offline)
78
+ - 4 feature cards in responsive grid
79
+ - **Live Clock via LiveComponent** - Real-time sync with server
80
+ - Clean action buttons at bottom
81
+ - No background blob animations (clean and fast)
82
+ - Mobile-first responsive design
83
+ - **Full Live Components support** - Maintains advanced real-time features
84
+
85
+ ## ๐Ÿ”ง How to Use
86
+
87
+ ```bash
88
+ # Start development server (backend + frontend)
89
+ bun run dev
90
+
91
+ # Frontend only
92
+ bun run dev:frontend
93
+
94
+ # Backend only
95
+ bun run dev:backend
96
+ ```
97
+
98
+ The page will automatically show:
99
+ - โœ… **Green badge** - Backend is running and healthy
100
+ - โš ๏ธ **Yellow badge** - Checking backend status
101
+ - โŒ **Red badge** - Backend is offline
102
+
103
+ ## ๐ŸŽฏ When to Use This Version?
104
+
105
+ **Use this ultra-simplified version when:**
106
+ - You want the cleanest possible presentation
107
+ - You're showcasing FluxStack to newcomers or investors
108
+ - You need a professional landing page
109
+ - You want maximum simplicity (like Next.js/React/Vite)
110
+ - You prefer minimalism over features
111
+ - You want fast loading and minimal JavaScript
112
+
113
+ **Use the full version when:**
114
+ - You need multiple pages/routes
115
+ - You require complex state management
116
+ - You want real-time features (WebSocket)
117
+ - You need complete demos (CRUD, Auth, etc.)
118
+ - You're building a full application with all features
119
+
120
+ ## ๐Ÿ’ก Future Enhancements (Optional)
121
+
122
+ If you want to extend this simplified version, consider adding:
123
+ - [ ] Simple counter demo using Eden Treaty
124
+ - [ ] User CRUD with minimal UI
125
+ - [ ] Dark/Light theme toggle
126
+ - [ ] Smooth scroll to sections
127
+ - [ ] More feature cards
128
+
129
+ ## ๐Ÿ“š References
130
+
131
+ - [FluxStack Documentation](../../ai-context/)
132
+ - [Eden Treaty Guide](../../ai-context/development/eden-treaty-guide.md)
133
+ - [Vite Documentation](https://vite.dev)
134
+ - [React Documentation](https://react.dev)
135
+
136
+ ---
137
+
138
+ **๐ŸŽฏ Goal**: Provide a clean, simple, and beautiful client that showcases FluxStack's core value proposition without overwhelming complexity.
139
+
140
+ **Made with โค๏ธ by FluxStack Team**
@@ -1,5 +1,5 @@
1
1
  // Frontend standalone entry point
2
- import { startFrontendOnly } from "../../core/client/standalone"
2
+ import { startFrontendOnly } from "@/core/client/standalone"
3
3
 
4
4
  // Configuraรงรฃo para frontend standalone
5
5
  const frontendConfig = {
@@ -1,319 +1,184 @@
1
1
  import { useState, useEffect } from 'react'
2
- import { api, getErrorMessage } from './lib/eden-api'
3
- import {
4
- FaRocket,
5
- FaCheckCircle, FaTimesCircle, FaBook, FaShieldAlt, FaBolt,
6
- FaClipboardList, FaFire, FaFlask as FaTest,
7
- } from 'react-icons/fa'
8
- import { Routes, Route, Link } from 'react-router-dom'
9
-
10
- // Live Components Provider - Singleton WebSocket Connection for All Live Components
11
- import { LiveComponentsProvider } from '@/core/client'
12
-
13
- // Import page components
14
- import { OverviewPage } from './pages/Overview'
15
- import { DemoPage } from './pages/Demo'
16
- import { HybridLivePage } from './pages/HybridLive'
17
- import { ApiDocsPage } from './pages/ApiDocs'
18
- import { CryptoAuthPage } from './pages/CryptoAuthPage'
19
- import { MainLayout } from './components/MainLayout'
20
-
21
- // State management is now handled by Zustand stores directly
22
-
23
- interface User {
24
- id: number
25
- name: string
26
- email: string
27
- createdAt: string | Date
2
+ import { api } from './lib/eden-api'
3
+ import { FaFire, FaBook, FaGithub, FaClock } from 'react-icons/fa'
4
+ import { LiveComponentsProvider, useHybridLiveComponent } from '@/core/client'
5
+
6
+ interface LiveClockState {
7
+ currentTime: string
8
+ timeZone: string
9
+ format: '12h' | '24h'
10
+ showSeconds: boolean
11
+ showDate: boolean
12
+ lastSync: Date
13
+ serverUptime: number
28
14
  }
29
15
 
30
- interface UsersResponse {
31
- users: User[]
16
+ const initialClockState: LiveClockState = {
17
+ currentTime: "Loading...",
18
+ timeZone: "America/Sao_Paulo",
19
+ format: "24h",
20
+ showSeconds: true,
21
+ showDate: true,
22
+ lastSync: new Date(),
23
+ serverUptime: 0,
32
24
  }
33
25
 
34
- interface UserCreateResponse {
35
- success: boolean
36
- user?: User
37
- message?: string
38
- }
26
+ // Minimal Live Clock Component
27
+ function MinimalLiveClock() {
28
+ const { state } = useHybridLiveComponent<LiveClockState>(
29
+ 'LiveClock',
30
+ initialClockState
31
+ )
39
32
 
40
- interface UserDeleteResponse {
41
- success: boolean
42
- message?: string
33
+ return (
34
+ <div className="bg-gradient-to-br from-blue-500/10 to-purple-500/10 rounded-xl p-4 border border-blue-400/20">
35
+ <div className="text-4xl font-mono font-bold text-white text-center tracking-wider">
36
+ {state.currentTime}
37
+ </div>
38
+ <div className="text-center mt-2">
39
+ <span className="text-xs text-gray-400">{state.timeZone}</span>
40
+ </div>
41
+ </div>
42
+ )
43
43
  }
44
44
 
45
45
  function AppContent() {
46
- const [users, setUsers] = useState<User[]>([])
47
- const [loading, setLoading] = useState(false)
48
- const [apiStatus, setApiStatus] = useState<'online' | 'offline'>('offline')
49
- const [name, setName] = useState('')
50
- const [email, setEmail] = useState('')
51
- const [submitting, setSubmitting] = useState(false)
52
- const [message, setMessage] = useState<{ type: 'success' | 'error', text: string } | null>(null)
46
+ const [apiStatus, setApiStatus] = useState<'checking' | 'online' | 'offline'>('checking')
53
47
 
54
48
  useEffect(() => {
55
49
  checkApiStatus()
56
- loadUsers()
57
- }, []) // eslint-disable-line react-hooks/exhaustive-deps
50
+ }, [])
58
51
 
59
52
  const checkApiStatus = async () => {
60
53
  try {
61
54
  const { error } = await api.health.get()
62
- if (error) {
63
- setApiStatus('offline')
64
- } else {
65
- setApiStatus('online')
66
- }
55
+ setApiStatus(error ? 'offline' : 'online')
67
56
  } catch {
68
57
  setApiStatus('offline')
69
58
  }
70
59
  }
71
60
 
72
- const loadUsers = async () => {
73
- try {
74
- setLoading(true)
75
- const { data, error } = await api.users.get()
76
-
77
- if (error) {
78
- showMessage('error', `Erro ao carregar usuรกrios: ${error.status}`)
79
- return
80
- }
81
-
82
- setUsers((data as UsersResponse).users || [])
83
- } catch (error) {
84
- showMessage('error', getErrorMessage(error))
85
- } finally {
86
- setLoading(false)
87
- }
88
- }
89
-
90
- const handleSubmit = async (e: React.FormEvent) => {
91
- e.preventDefault()
92
- if (!name.trim() || !email.trim()) return
93
-
94
- try {
95
- setSubmitting(true)
96
- const { data: result, error } = await api.users.post({
97
- name: name.trim(),
98
- email: email.trim()
99
- })
100
-
101
- if (error) {
102
- showMessage('error', `Erro ao criar usuรกrio: ${error.status}`)
103
- return
104
- }
105
-
106
- const createResult = result as UserCreateResponse
107
- if (createResult.success && createResult.user) {
108
- setUsers(prev => [...prev, createResult.user!])
109
- setName('')
110
- setEmail('')
111
- showMessage('success', `Usuรกrio ${name} adicionado com sucesso!`)
112
- } else {
113
- showMessage('error', createResult.message || 'Erro ao criar usuรกrio')
114
- }
115
- } catch (error) {
116
- showMessage('error', getErrorMessage(error))
117
- } finally {
118
- setSubmitting(false)
119
- }
120
- }
121
-
122
- const handleDelete = async (userId: number, userName: string) => {
123
- if (!confirm(`Tem certeza que deseja remover ${userName}?`)) return
124
-
125
- try {
126
- const { data: result, error } = await api.users({ id: userId }).delete()
127
-
128
- if (error) {
129
- showMessage('error', `Erro ao deletar usuรกrio: ${error.status}`)
130
- return
131
- }
132
-
133
- const deleteResult = result as UserDeleteResponse
134
- if (deleteResult.success) {
135
- setUsers(prev => prev.filter(user => user.id !== userId))
136
- showMessage('success', `Usuรกrio ${userName} removido com sucesso!`)
137
- } else {
138
- showMessage('error', deleteResult.message || 'Erro ao deletar usuรกrio')
139
- }
140
- } catch (error) {
141
- showMessage('error', getErrorMessage(error))
142
- }
143
- }
61
+ return (
62
+ <div className="min-h-screen bg-gradient-to-br from-slate-900 via-purple-900 to-slate-900">
63
+ <div className="flex flex-col items-center justify-center min-h-screen px-6 text-center">
64
+ {/* Logo */}
65
+ <div className="mb-8 animate-pulse-slow">
66
+ <FaFire className="text-8xl text-orange-500 drop-shadow-2xl" />
67
+ </div>
144
68
 
145
- const showMessage = (type: 'success' | 'error', text: string) => {
146
- setMessage({ type, text })
147
- setTimeout(() => setMessage(null), 5000)
148
- }
69
+ {/* Title */}
70
+ <h1 className="text-6xl md:text-7xl font-bold mb-4 bg-gradient-to-r from-blue-400 via-purple-400 to-pink-400 bg-clip-text text-transparent">
71
+ FluxStack
72
+ </h1>
73
+
74
+ {/* Subtitle */}
75
+ <p className="text-xl md:text-2xl text-gray-300 mb-8 max-w-2xl">
76
+ Full-stack TypeScript framework with{' '}
77
+ <span className="text-purple-400 font-semibold">Bun</span>,{' '}
78
+ <span className="text-blue-400 font-semibold">Elysia</span>, and{' '}
79
+ <span className="text-cyan-400 font-semibold">React</span>
80
+ </p>
81
+
82
+ {/* API Status Badge */}
83
+ <div className="mb-12">
84
+ <div className={`inline-flex items-center gap-2 px-4 py-2 rounded-full text-sm font-medium transition-all ${
85
+ apiStatus === 'online'
86
+ ? 'bg-emerald-500/20 text-emerald-300 border border-emerald-500/30'
87
+ : apiStatus === 'offline'
88
+ ? 'bg-red-500/20 text-red-300 border border-red-500/30'
89
+ : 'bg-yellow-500/20 text-yellow-300 border border-yellow-500/30'
90
+ }`}>
91
+ <div className={`w-2 h-2 rounded-full ${
92
+ apiStatus === 'online' ? 'bg-emerald-400' : apiStatus === 'offline' ? 'bg-red-400' : 'bg-yellow-400'
93
+ }`}></div>
94
+ <span>{apiStatus === 'checking' ? 'Checking API...' : apiStatus === 'online' ? 'API Online' : 'API Offline'}</span>
95
+ </div>
96
+ </div>
149
97
 
150
- const getInitials = (name: string) => {
151
- return name.split(' ').map(n => n[0]).join('').toUpperCase().slice(0, 2)
152
- }
98
+ {/* Feature Cards */}
99
+ <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-12 max-w-6xl">
100
+ <div className="bg-white/5 backdrop-blur-sm border border-white/10 rounded-2xl p-6 hover:bg-white/10 transition-all">
101
+ <div className="text-3xl mb-3">โšก</div>
102
+ <h3 className="text-lg font-semibold text-white mb-2">Ultra Rรกpido</h3>
103
+ <p className="text-gray-400 text-sm">Bun runtime 3x mais rรกpido que Node.js</p>
104
+ </div>
153
105
 
154
- return (
155
- <div>
156
- <Routes>
157
- {/* Full-screen Live App Route */}
158
- <Route path="/live-app" element={<MainLayout />} />
159
-
160
- {/* Regular routes with header and layout */}
161
- <Route path="*" element={
162
- <div className="min-h-screen bg-gradient-to-br from-slate-50 via-blue-50 to-indigo-100">
163
- {/* Header */}
164
- <header className="bg-white/80 backdrop-blur-sm border-b border-gray-200 sticky top-0 z-50">
165
- <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
166
- <div className="flex justify-between items-center h-16">
167
- {/* Logo and Navigation */}
168
- <div className="flex items-center space-x-8">
169
- <div className="flex items-center space-x-3">
170
- <div className="flex items-center gap-2">
171
- <FaFire className="text-2xl text-orange-500" />
172
- <div className="text-2xl font-bold bg-gradient-to-r from-blue-600 via-purple-600 to-indigo-600 bg-clip-text text-transparent">
173
- FluxStack
174
- </div>
175
- </div>
176
- <span className="px-2 py-1 text-xs font-medium bg-blue-100 text-blue-800 rounded-full">
177
- v1.4.0
178
- </span>
179
- </div>
180
-
181
- {/* Navigation Tabs */}
182
- <nav className="hidden md:flex space-x-1">
183
- {[
184
- { id: 'overview', label: 'Visรฃo Geral', icon: <FaClipboardList />, path: '/' },
185
- { id: 'demo', label: 'Demo', icon: <FaRocket />, path: '/demo' },
186
- { id: 'crypto-auth', label: 'Crypto Auth', icon: <FaShieldAlt />, path: '/crypto-auth' },
187
- { id: 'hybrid-live', label: 'Hybrid Live', icon: <FaBolt />, path: '/hybrid-live' },
188
- { id: 'live-app', label: 'Live App', icon: <FaFire />, path: '/live-app' },
189
- { id: 'api-docs', label: 'API Docs', icon: <FaBook />, path: '/api-docs' },
190
- { id: 'tests', label: 'Testes', icon: <FaTest />, path: '/tests' }
191
- ].map(tab => (
192
- <Link
193
- key={tab.id}
194
- to={tab.path}
195
- className={`px-4 py-2 text-sm font-medium rounded-lg transition-all duration-200 ${
196
- location.pathname === tab.path
197
- ? 'bg-blue-100 text-blue-700 shadow-sm'
198
- : 'text-gray-600 hover:text-gray-900 hover:bg-gray-100'
199
- }`}
200
- >
201
- <div className="flex items-center gap-2">
202
- {tab.icon}
203
- {tab.label}
204
- </div>
205
- </Link>
206
- ))}
207
- </nav>
208
- </div>
106
+ <div className="bg-white/5 backdrop-blur-sm border border-white/10 rounded-2xl p-6 hover:bg-white/10 transition-all">
107
+ <div className="text-3xl mb-3">๐Ÿ”’</div>
108
+ <h3 className="text-lg font-semibold text-white mb-2">Type Safe</h3>
109
+ <p className="text-gray-400 text-sm">Eden Treaty com inferรชncia automรกtica</p>
110
+ </div>
209
111
 
210
- {/* Status Badge */}
211
- <div className={`flex items-center space-x-2 px-3 py-2 rounded-full text-sm font-medium ${
212
- apiStatus === 'online'
213
- ? 'bg-emerald-100 text-emerald-700'
214
- : 'bg-red-100 text-red-700'
215
- }`}>
216
- <div className={`w-2 h-2 rounded-full ${
217
- apiStatus === 'online' ? 'bg-emerald-400' : 'bg-red-400'
218
- }`}></div>
219
- <span>API {apiStatus === 'online' ? 'Online' : 'Offline'}</span>
220
- </div>
221
- </div>
112
+ <div className="bg-white/5 backdrop-blur-sm border border-white/10 rounded-2xl p-6 hover:bg-white/10 transition-all">
113
+ <div className="text-3xl mb-3">๐ŸŽจ</div>
114
+ <h3 className="text-lg font-semibold text-white mb-2">Moderno</h3>
115
+ <p className="text-gray-400 text-sm">React 19 + Vite + Tailwind CSS</p>
116
+ </div>
222
117
 
223
- {/* Mobile Navigation */}
224
- <div className="md:hidden pb-3">
225
- <nav className="flex space-x-1">
226
- {[
227
- { id: 'overview', label: 'Visรฃo', icon: <FaClipboardList />, path: '/' },
228
- { id: 'demo', label: 'Demo', icon: <FaRocket />, path: '/demo' },
229
- { id: 'crypto-auth', label: 'Crypto', icon: <FaShieldAlt />, path: '/crypto-auth' },
230
- { id: 'hybrid-live', label: 'Hybrid', icon: <FaBolt />, path: '/hybrid-live' },
231
- { id: 'api-docs', label: 'Docs', icon: <FaBook />, path: '/api-docs' },
232
- { id: 'tests', label: 'Testes', icon: <FaTest />, path: '/tests' }
233
- ].map(tab => (
234
- <Link
235
- key={tab.id}
236
- to={tab.path}
237
- className={`flex-1 px-3 py-2 text-xs font-medium rounded-lg transition-all duration-200 ${
238
- location.pathname === tab.path
239
- ? 'bg-blue-100 text-blue-700'
240
- : 'text-gray-600 hover:text-gray-900 hover:bg-gray-100'
241
- }`}
242
- >
243
- <div className="flex flex-col items-center gap-1">
244
- {tab.icon}
245
- <span>{tab.label}</span>
246
- </div>
247
- </Link>
248
- ))}
249
- </nav>
250
- </div>
118
+ {/* Live Clock Card */}
119
+ <div className="bg-white/5 backdrop-blur-sm border border-white/10 rounded-2xl p-6 hover:bg-white/10 transition-all">
120
+ <div className="flex items-center gap-3 mb-3">
121
+ <FaClock className="text-2xl text-emerald-400" />
122
+ <div>
123
+ <h3 className="text-lg font-semibold text-white">Live Clock</h3>
124
+ <p className="text-gray-400 text-sm">Provido via LiveComponent</p>
251
125
  </div>
252
- </header>
253
-
254
- {/* Main Content */}
255
- <main className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
256
- <Routes>
257
- <Route path="/" element={<OverviewPage />} />
258
- <Route
259
- path="/demo"
260
- element={
261
- <DemoPage
262
- users={users}
263
- apiStatus={apiStatus}
264
- loading={loading}
265
- submitting={submitting}
266
- name={name}
267
- email={email}
268
- setName={setName}
269
- setEmail={setEmail}
270
- handleSubmit={handleSubmit}
271
- handleDelete={handleDelete}
272
- loadUsers={loadUsers}
273
- getInitials={getInitials}
274
- />
275
- }
276
- />
277
- <Route path="/crypto-auth" element={<CryptoAuthPage />} />
278
- <Route path="/hybrid-live" element={<HybridLivePage />} />
279
- <Route path="/api-docs" element={<ApiDocsPage />} />
280
- <Route path="/tests" element={
281
- <div className="p-6">
282
- <h2 className="text-2xl font-bold mb-4">๐Ÿงช Tests</h2>
283
- <p className="text-gray-600">Test suite functionality will be available here.</p>
284
- </div>
285
- } />
286
- </Routes>
287
- </main>
126
+ </div>
127
+ <MinimalLiveClock />
288
128
  </div>
289
- } />
290
- </Routes>
129
+ </div>
291
130
 
292
- {/* Toast Notification */}
293
- {message && (
294
- <div
295
- className={`fixed top-4 right-4 z-50 px-6 py-4 rounded-xl shadow-lg cursor-pointer transform transition-all duration-300 max-w-sm ${
296
- message.type === 'success'
297
- ? 'bg-emerald-500 text-white'
298
- : 'bg-red-500 text-white'
299
- }`}
300
- onClick={() => setMessage(null)}
301
- >
302
- <div className="flex items-center space-x-2">
303
- {message.type === 'success' ? (
304
- <FaCheckCircle className="text-lg" />
305
- ) : (
306
- <FaTimesCircle className="text-lg" />
307
- )}
308
- <span className="font-medium">{message.text}</span>
309
- </div>
131
+ {/* Action Buttons */}
132
+ <div className="flex flex-wrap gap-4 justify-center">
133
+ <a
134
+ href="http://localhost:3000/swagger"
135
+ target="_blank"
136
+ rel="noopener noreferrer"
137
+ className="inline-flex items-center gap-2 px-6 py-3 bg-gradient-to-r from-blue-500 to-purple-600 text-white rounded-xl font-medium hover:shadow-lg hover:shadow-purple-500/50 transition-all"
138
+ >
139
+ <FaBook />
140
+ API Docs
141
+ </a>
142
+ <a
143
+ href="https://github.com/MarcosBrendonDePaula/FluxStack"
144
+ target="_blank"
145
+ rel="noopener noreferrer"
146
+ className="inline-flex items-center gap-2 px-6 py-3 bg-white/10 backdrop-blur-sm border border-white/20 text-white rounded-xl font-medium hover:bg-white/20 transition-all"
147
+ >
148
+ <FaGithub />
149
+ GitHub
150
+ </a>
151
+ <a
152
+ href="http://localhost:3000/api"
153
+ target="_blank"
154
+ rel="noopener noreferrer"
155
+ className="inline-flex items-center gap-2 px-6 py-3 bg-white/10 backdrop-blur-sm border border-white/20 text-white rounded-xl font-medium hover:bg-white/20 transition-all"
156
+ >
157
+ ๐Ÿš€ API Root
158
+ </a>
159
+ </div>
160
+
161
+ {/* Footer */}
162
+ <div className="mt-16 text-gray-500 text-sm">
163
+ <p>Desenvolvido com โค๏ธ usando TypeScript</p>
310
164
  </div>
311
- )}
165
+ </div>
166
+
167
+ {/* Animations */}
168
+ <style>{`
169
+ @keyframes pulse-slow {
170
+ 0%, 100% { opacity: 1; }
171
+ 50% { opacity: 0.8; }
172
+ }
173
+ .animate-pulse-slow {
174
+ animation: pulse-slow 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
175
+ }
176
+ `}</style>
312
177
  </div>
313
178
  )
314
179
  }
315
180
 
316
- // Main App component - Wrapped with LiveComponentsProvider for single WebSocket connection
181
+ // Main App with LiveComponentsProvider
317
182
  function App() {
318
183
  return (
319
184
  <LiveComponentsProvider
@@ -328,4 +193,4 @@ function App() {
328
193
  )
329
194
  }
330
195
 
331
- export default App
196
+ export default App