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.
Files changed (154) hide show
  1. package/.dockerignore +82 -0
  2. package/.env.example +19 -0
  3. package/Dockerfile +70 -0
  4. package/README.md +6 -3
  5. package/app/client/SIMPLIFICATION.md +140 -0
  6. package/app/client/frontend-only.ts +1 -1
  7. package/app/client/src/App.tsx +148 -283
  8. package/app/client/src/index.css +5 -20
  9. package/app/client/src/lib/eden-api.ts +53 -220
  10. package/app/client/src/main.tsx +2 -3
  11. package/app/server/app.ts +20 -5
  12. package/app/server/backend-only.ts +15 -12
  13. package/app/server/controllers/users.controller.ts +57 -31
  14. package/app/server/index.ts +86 -96
  15. package/app/server/live/register-components.ts +18 -7
  16. package/app/server/routes/env-test.ts +110 -0
  17. package/app/server/routes/index.ts +1 -8
  18. package/app/server/routes/users.routes.ts +192 -91
  19. package/config/app.config.ts +2 -54
  20. package/config/client.config.ts +95 -0
  21. package/config/fluxstack.config.ts +2 -2
  22. package/config/index.ts +57 -22
  23. package/config/monitoring.config.ts +114 -0
  24. package/config/plugins.config.ts +80 -0
  25. package/config/runtime.config.ts +0 -17
  26. package/config/server.config.ts +50 -30
  27. package/core/build/bundler.ts +17 -16
  28. package/core/build/flux-plugins-generator.ts +34 -23
  29. package/core/build/index.ts +32 -31
  30. package/core/build/live-components-generator.ts +44 -30
  31. package/core/build/optimizer.ts +37 -17
  32. package/core/cli/command-registry.ts +4 -14
  33. package/core/cli/commands/plugin-deps.ts +8 -8
  34. package/core/cli/generators/component.ts +3 -3
  35. package/core/cli/generators/controller.ts +4 -4
  36. package/core/cli/generators/index.ts +8 -8
  37. package/core/cli/generators/interactive.ts +4 -4
  38. package/core/cli/generators/plugin.ts +3 -3
  39. package/core/cli/generators/prompts.ts +1 -1
  40. package/core/cli/generators/route.ts +27 -11
  41. package/core/cli/generators/service.ts +5 -5
  42. package/core/cli/generators/template-engine.ts +1 -1
  43. package/core/cli/generators/types.ts +1 -1
  44. package/core/cli/index.ts +158 -189
  45. package/core/cli/plugin-discovery.ts +3 -3
  46. package/core/client/hooks/index.ts +2 -2
  47. package/core/client/hooks/state-validator.ts +1 -1
  48. package/core/client/hooks/useAuth.ts +1 -1
  49. package/core/client/hooks/useChunkedUpload.ts +1 -1
  50. package/core/client/hooks/useHybridLiveComponent.ts +1 -1
  51. package/core/client/hooks/useWebSocket.ts +1 -1
  52. package/core/config/env.ts +5 -1
  53. package/core/config/runtime-config.ts +12 -10
  54. package/core/config/schema.ts +33 -2
  55. package/core/framework/server.ts +30 -14
  56. package/core/framework/types.ts +2 -2
  57. package/core/index.ts +31 -23
  58. package/core/live/ComponentRegistry.ts +1 -1
  59. package/core/plugins/built-in/live-components/commands/create-live-component.ts +1 -1
  60. package/core/plugins/built-in/live-components/index.ts +1 -1
  61. package/core/plugins/built-in/monitoring/index.ts +65 -161
  62. package/core/plugins/built-in/static/index.ts +75 -277
  63. package/core/plugins/built-in/swagger/index.ts +301 -231
  64. package/core/plugins/built-in/vite/index.ts +342 -377
  65. package/core/plugins/config.ts +2 -2
  66. package/core/plugins/dependency-manager.ts +2 -2
  67. package/core/plugins/discovery.ts +1 -1
  68. package/core/plugins/executor.ts +2 -2
  69. package/core/plugins/manager.ts +19 -4
  70. package/core/plugins/module-resolver.ts +1 -1
  71. package/core/plugins/registry.ts +25 -21
  72. package/core/plugins/types.ts +147 -5
  73. package/core/server/backend-entry.ts +51 -0
  74. package/core/server/framework.ts +2 -2
  75. package/core/server/live/ComponentRegistry.ts +9 -26
  76. package/core/server/live/FileUploadManager.ts +1 -1
  77. package/core/server/live/auto-generated-components.ts +26 -0
  78. package/core/server/live/websocket-plugin.ts +211 -19
  79. package/core/server/middleware/errorHandling.ts +1 -1
  80. package/core/server/middleware/index.ts +4 -4
  81. package/core/server/plugins/database.ts +1 -2
  82. package/core/server/plugins/static-files-plugin.ts +259 -231
  83. package/core/server/plugins/swagger.ts +1 -1
  84. package/core/server/services/BaseService.ts +1 -1
  85. package/core/server/services/ServiceContainer.ts +1 -1
  86. package/core/server/services/index.ts +4 -4
  87. package/core/server/standalone.ts +16 -1
  88. package/core/testing/index.ts +1 -1
  89. package/core/testing/setup.ts +1 -1
  90. package/core/types/plugin.ts +6 -0
  91. package/core/utils/build-logger.ts +324 -0
  92. package/core/utils/config-schema.ts +2 -6
  93. package/core/utils/helpers.ts +14 -9
  94. package/core/utils/logger/startup-banner.ts +7 -33
  95. package/core/utils/regenerate-files.ts +69 -0
  96. package/core/utils/version.ts +6 -6
  97. package/create-fluxstack.ts +68 -25
  98. package/fluxstack.config.ts +138 -252
  99. package/package.json +3 -18
  100. package/plugins/crypto-auth/index.ts +52 -47
  101. package/plugins/crypto-auth/server/AuthMiddleware.ts +1 -1
  102. package/plugins/crypto-auth/server/middlewares/helpers.ts +16 -1
  103. package/vitest.config.ts +17 -26
  104. package/app/client/src/App.css +0 -883
  105. package/app/client/src/components/ErrorBoundary.tsx +0 -107
  106. package/app/client/src/components/ErrorDisplay.css +0 -365
  107. package/app/client/src/components/ErrorDisplay.tsx +0 -258
  108. package/app/client/src/components/FluxStackConfig.tsx +0 -1321
  109. package/app/client/src/components/HybridLiveCounter.tsx +0 -140
  110. package/app/client/src/components/LiveClock.tsx +0 -286
  111. package/app/client/src/components/MainLayout.tsx +0 -388
  112. package/app/client/src/components/SidebarNavigation.tsx +0 -391
  113. package/app/client/src/components/StateDemo.tsx +0 -178
  114. package/app/client/src/components/SystemMonitor.tsx +0 -1044
  115. package/app/client/src/components/UserProfile.tsx +0 -809
  116. package/app/client/src/hooks/useAuth.ts +0 -39
  117. package/app/client/src/hooks/useNotifications.ts +0 -56
  118. package/app/client/src/lib/errors.ts +0 -340
  119. package/app/client/src/lib/hooks/useErrorHandler.ts +0 -258
  120. package/app/client/src/lib/index.ts +0 -45
  121. package/app/client/src/pages/ApiDocs.tsx +0 -182
  122. package/app/client/src/pages/CryptoAuthPage.tsx +0 -394
  123. package/app/client/src/pages/Demo.tsx +0 -174
  124. package/app/client/src/pages/HybridLive.tsx +0 -263
  125. package/app/client/src/pages/Overview.tsx +0 -155
  126. package/app/client/src/store/README.md +0 -43
  127. package/app/client/src/store/index.ts +0 -16
  128. package/app/client/src/store/slices/uiSlice.ts +0 -151
  129. package/app/client/src/store/slices/userSlice.ts +0 -161
  130. package/app/client/src/test/README.md +0 -257
  131. package/app/client/src/test/setup.ts +0 -70
  132. package/app/client/src/test/types.ts +0 -12
  133. package/app/server/live/CounterComponent.ts +0 -191
  134. package/app/server/live/FluxStackConfig.ts +0 -534
  135. package/app/server/live/SidebarNavigation.ts +0 -157
  136. package/app/server/live/SystemMonitor.ts +0 -595
  137. package/app/server/live/SystemMonitorIntegration.ts +0 -151
  138. package/app/server/live/UserProfileComponent.ts +0 -141
  139. package/app/server/middleware/auth.ts +0 -136
  140. package/app/server/middleware/errorHandling.ts +0 -252
  141. package/app/server/middleware/index.ts +0 -10
  142. package/app/server/middleware/rateLimit.ts +0 -193
  143. package/app/server/middleware/requestLogging.ts +0 -215
  144. package/app/server/middleware/validation.ts +0 -270
  145. package/app/server/routes/config.ts +0 -145
  146. package/app/server/routes/crypto-auth-demo.routes.ts +0 -167
  147. package/app/server/routes/example-with-crypto-auth.routes.ts +0 -235
  148. package/app/server/routes/exemplo-posts.routes.ts +0 -161
  149. package/app/server/routes/upload.ts +0 -92
  150. package/app/server/services/NotificationService.ts +0 -302
  151. package/app/server/services/UserService.ts +0 -222
  152. package/app/server/services/index.ts +0 -46
  153. package/app/server/types/index.ts +0 -1
  154. package/config/build.config.ts +0 -24
package/.dockerignore ADDED
@@ -0,0 +1,82 @@
1
+ # =====================================
2
+ # FluxStack Docker Ignore
3
+ # =====================================
4
+
5
+ # Node modules (will be installed in container)
6
+ node_modules/
7
+ **/node_modules/
8
+
9
+ # Build artifacts (will be built in container)
10
+ dist/
11
+ **/dist/
12
+
13
+ # Development files
14
+ .git/
15
+ .github/
16
+ .vscode/
17
+ .idea/
18
+
19
+ # Environment files
20
+ .env
21
+ .env.*
22
+ !.env.example
23
+
24
+ # Logs
25
+ logs/
26
+ *.log
27
+ npm-debug.log*
28
+ yarn-debug.log*
29
+ yarn-error.log*
30
+ bun-debug.log*
31
+ lerna-debug.log*
32
+
33
+ # Testing
34
+ coverage/
35
+ .nyc_output/
36
+ **/__tests__/
37
+ **/*.test.ts
38
+ **/*.test.tsx
39
+ **/*.spec.ts
40
+ **/*.spec.tsx
41
+
42
+ # Documentation
43
+ *.md
44
+ !README.md
45
+ ai-context/
46
+ docs/
47
+
48
+ # Development tools
49
+ .eslintrc*
50
+ .prettierrc*
51
+ tsconfig*.json
52
+ vitest.config.ts
53
+ vite.config.ts
54
+
55
+ # OS files
56
+ .DS_Store
57
+ Thumbs.db
58
+
59
+ # Temporary files
60
+ tmp/
61
+ temp/
62
+ *.tmp
63
+ *.swp
64
+ *.swo
65
+ *~
66
+
67
+ # Lock files (exclude other package managers, keep bun.lock)
68
+ package-lock.json
69
+ yarn.lock
70
+ pnpm-lock.yaml
71
+
72
+ # CI/CD
73
+ .github/
74
+
75
+ # Editor directories
76
+ .vscode/
77
+ .idea/
78
+ *.suo
79
+ *.ntvs*
80
+ *.njsproj
81
+ *.sln
82
+ *.sw?
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/Dockerfile ADDED
@@ -0,0 +1,70 @@
1
+ # 🐳 FluxStack Production Dockerfile
2
+ # Multi-stage build for optimized production image
3
+
4
+ # =====================================
5
+ # Stage 1: Dependencies
6
+ # =====================================
7
+ FROM oven/bun:1.1.34-alpine AS deps
8
+
9
+ WORKDIR /app
10
+
11
+ # Copy package files
12
+ COPY package.json bun.lock ./
13
+
14
+ # Install production dependencies only
15
+ RUN bun install --production --frozen-lockfile
16
+
17
+ # =====================================
18
+ # Stage 2: Builder
19
+ # =====================================
20
+ FROM oven/bun:1.1.34-alpine AS builder
21
+
22
+ WORKDIR /app
23
+
24
+ # Copy package files and install all dependencies (including dev)
25
+ COPY package.json bun.lock ./
26
+ RUN bun install --frozen-lockfile
27
+
28
+ # Copy source code
29
+ COPY . .
30
+
31
+ # Build the application
32
+ RUN bun run build
33
+
34
+ # =====================================
35
+ # Stage 3: Production Runner
36
+ # =====================================
37
+ FROM oven/bun:1.1.34-alpine AS runner
38
+
39
+ WORKDIR /app
40
+
41
+ # Set production environment
42
+ ENV NODE_ENV=production
43
+ ENV PORT=3000
44
+
45
+ # Create non-root user for security
46
+ RUN addgroup -g 1001 -S fluxstack && \
47
+ adduser -S fluxstack -u 1001
48
+
49
+ # Copy production dependencies from deps stage
50
+ COPY --from=deps --chown=fluxstack:fluxstack /app/node_modules ./node_modules
51
+
52
+ # Copy built application from builder stage
53
+ COPY --from=builder --chown=fluxstack:fluxstack /app/dist ./dist
54
+ COPY --from=builder --chown=fluxstack:fluxstack /app/package.json ./
55
+
56
+ # Copy config directory (required for runtime configuration)
57
+ COPY --from=builder --chown=fluxstack:fluxstack /app/config ./config
58
+
59
+ # Switch to non-root user
60
+ USER fluxstack
61
+
62
+ # Expose application port
63
+ EXPOSE 3000
64
+
65
+ # Health check disabled for now
66
+ # HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
67
+ # CMD bun run -e 'fetch("http://localhost:3000/api/health").then(r => r.ok ? process.exit(0) : process.exit(1))' || exit 1
68
+
69
+ # Start the application
70
+ CMD ["bun", "run", "start"]
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 = {