create-fluxstack 1.8.1 → 1.9.1

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 (136) hide show
  1. package/.env.example +19 -0
  2. package/README.md +653 -272
  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/bundler.ts +199 -55
  18. package/core/build/flux-plugins-generator.ts +5 -5
  19. package/core/build/index.ts +4 -0
  20. package/core/build/live-components-generator.ts +15 -12
  21. package/core/cli/command-registry.ts +4 -14
  22. package/core/cli/commands/plugin-deps.ts +8 -8
  23. package/core/cli/generators/component.ts +3 -3
  24. package/core/cli/generators/controller.ts +4 -4
  25. package/core/cli/generators/index.ts +8 -8
  26. package/core/cli/generators/interactive.ts +4 -4
  27. package/core/cli/generators/plugin.ts +9 -9
  28. package/core/cli/generators/prompts.ts +1 -1
  29. package/core/cli/generators/route.ts +27 -11
  30. package/core/cli/generators/service.ts +5 -5
  31. package/core/cli/generators/template-engine.ts +1 -1
  32. package/core/cli/generators/types.ts +1 -1
  33. package/core/cli/index.ts +258 -193
  34. package/core/cli/plugin-discovery.ts +3 -3
  35. package/core/client/hooks/index.ts +2 -2
  36. package/core/client/hooks/state-validator.ts +1 -1
  37. package/core/client/hooks/useAuth.ts +1 -1
  38. package/core/client/hooks/useChunkedUpload.ts +1 -1
  39. package/core/client/hooks/useHybridLiveComponent.ts +1 -1
  40. package/core/client/hooks/useWebSocket.ts +1 -1
  41. package/core/config/env.ts +1 -1
  42. package/core/config/runtime-config.ts +5 -5
  43. package/core/config/schema.ts +9 -0
  44. package/core/framework/server.ts +30 -15
  45. package/core/framework/types.ts +2 -2
  46. package/core/live/ComponentRegistry.ts +1 -1
  47. package/core/plugins/built-in/live-components/commands/create-live-component.ts +1 -1
  48. package/core/plugins/built-in/live-components/index.ts +1 -1
  49. package/core/plugins/built-in/monitoring/index.ts +65 -161
  50. package/core/plugins/built-in/static/index.ts +18 -47
  51. package/core/plugins/built-in/swagger/index.ts +301 -231
  52. package/core/plugins/built-in/vite/index.ts +74 -109
  53. package/core/plugins/config.ts +2 -2
  54. package/core/plugins/dependency-manager.ts +2 -2
  55. package/core/plugins/discovery.ts +1 -1
  56. package/core/plugins/executor.ts +2 -2
  57. package/core/plugins/manager.ts +19 -4
  58. package/core/plugins/module-resolver.ts +1 -1
  59. package/core/plugins/registry.ts +3 -3
  60. package/core/plugins/types.ts +147 -5
  61. package/core/server/framework.ts +2 -2
  62. package/core/server/live/ComponentRegistry.ts +9 -26
  63. package/core/server/live/FileUploadManager.ts +1 -1
  64. package/core/server/live/auto-generated-components.ts +26 -0
  65. package/core/server/live/websocket-plugin.ts +211 -19
  66. package/core/server/middleware/errorHandling.ts +1 -1
  67. package/core/server/middleware/index.ts +4 -4
  68. package/core/server/plugins/database.ts +1 -2
  69. package/core/server/plugins/static-files-plugin.ts +259 -231
  70. package/core/server/plugins/swagger.ts +1 -1
  71. package/core/server/services/BaseService.ts +1 -1
  72. package/core/server/services/ServiceContainer.ts +1 -1
  73. package/core/server/services/index.ts +4 -4
  74. package/core/server/standalone.ts +16 -1
  75. package/core/testing/index.ts +1 -1
  76. package/core/testing/setup.ts +1 -1
  77. package/core/types/build.ts +21 -0
  78. package/core/utils/logger/startup-banner.ts +7 -33
  79. package/core/utils/version.ts +1 -1
  80. package/create-fluxstack.ts +73 -30
  81. package/package.json +3 -2
  82. package/plugins/crypto-auth/index.ts +52 -47
  83. package/plugins/crypto-auth/server/AuthMiddleware.ts +1 -1
  84. package/plugins/crypto-auth/server/middlewares/helpers.ts +16 -1
  85. package/tsconfig.json +2 -1
  86. package/vitest.config.ts +11 -2
  87. package/app/client/src/App.css +0 -883
  88. package/app/client/src/components/ErrorBoundary.tsx +0 -107
  89. package/app/client/src/components/ErrorDisplay.css +0 -365
  90. package/app/client/src/components/ErrorDisplay.tsx +0 -258
  91. package/app/client/src/components/FluxStackConfig.tsx +0 -1321
  92. package/app/client/src/components/HybridLiveCounter.tsx +0 -140
  93. package/app/client/src/components/LiveClock.tsx +0 -286
  94. package/app/client/src/components/MainLayout.tsx +0 -388
  95. package/app/client/src/components/SidebarNavigation.tsx +0 -391
  96. package/app/client/src/components/StateDemo.tsx +0 -178
  97. package/app/client/src/components/SystemMonitor.tsx +0 -1044
  98. package/app/client/src/components/UserProfile.tsx +0 -809
  99. package/app/client/src/hooks/useAuth.ts +0 -39
  100. package/app/client/src/hooks/useNotifications.ts +0 -56
  101. package/app/client/src/lib/errors.ts +0 -340
  102. package/app/client/src/lib/hooks/useErrorHandler.ts +0 -258
  103. package/app/client/src/lib/index.ts +0 -45
  104. package/app/client/src/pages/ApiDocs.tsx +0 -182
  105. package/app/client/src/pages/CryptoAuthPage.tsx +0 -394
  106. package/app/client/src/pages/Demo.tsx +0 -174
  107. package/app/client/src/pages/HybridLive.tsx +0 -263
  108. package/app/client/src/pages/Overview.tsx +0 -155
  109. package/app/client/src/store/README.md +0 -43
  110. package/app/client/src/store/index.ts +0 -16
  111. package/app/client/src/store/slices/uiSlice.ts +0 -151
  112. package/app/client/src/store/slices/userSlice.ts +0 -161
  113. package/app/client/src/test/README.md +0 -257
  114. package/app/client/src/test/setup.ts +0 -70
  115. package/app/client/src/test/types.ts +0 -12
  116. package/app/server/live/CounterComponent.ts +0 -191
  117. package/app/server/live/FluxStackConfig.ts +0 -534
  118. package/app/server/live/SidebarNavigation.ts +0 -157
  119. package/app/server/live/SystemMonitor.ts +0 -595
  120. package/app/server/live/SystemMonitorIntegration.ts +0 -151
  121. package/app/server/live/UserProfileComponent.ts +0 -141
  122. package/app/server/middleware/auth.ts +0 -136
  123. package/app/server/middleware/errorHandling.ts +0 -252
  124. package/app/server/middleware/index.ts +0 -10
  125. package/app/server/middleware/rateLimit.ts +0 -193
  126. package/app/server/middleware/requestLogging.ts +0 -215
  127. package/app/server/middleware/validation.ts +0 -270
  128. package/app/server/routes/config.ts +0 -145
  129. package/app/server/routes/crypto-auth-demo.routes.ts +0 -167
  130. package/app/server/routes/example-with-crypto-auth.routes.ts +0 -235
  131. package/app/server/routes/exemplo-posts.routes.ts +0 -161
  132. package/app/server/routes/upload.ts +0 -92
  133. package/app/server/services/NotificationService.ts +0 -302
  134. package/app/server/services/UserService.ts +0 -222
  135. package/app/server/services/index.ts +0 -46
  136. package/app/server/types/index.ts +0 -1
package/README.md CHANGED
@@ -1,272 +1,653 @@
1
- # create-fluxstack
2
-
3
- Create modern full-stack TypeScript applications with zero configuration.
4
-
5
- [![npm version](https://badge.fury.io/js/create-fluxstack.svg)](https://www.npmjs.com/package/create-fluxstack)
6
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
-
8
- ---
9
-
10
- ## Quick Start
11
-
12
- ```bash
13
- # scaffold a new FluxStack app
14
- bunx create-fluxstack my-awesome-app
15
-
16
- # enter the project and start developing
17
- cd my-awesome-app
18
- bun run dev
19
- ```
20
-
21
- Your development environment will be available at:
22
-
23
- - **Backend**: http://localhost:3000
24
- - **Frontend (proxied)**: http://localhost:3000/
25
- - **API Docs**: http://localhost:3000/swagger
26
-
27
- ---
28
-
29
- ## What You Get
30
-
31
- ### Modern Tech Stack
32
- - Bun runtime (3x faster than Node.js)
33
- - Elysia.js backend
34
- - React 19 + Vite 7 frontend
35
- - Tailwind CSS v4 styling
36
- - TypeScript 5 end-to-end typing
37
-
38
- ### Zero-Config Features
39
- - Automatic Eden Treaty type inference
40
- - Coordinated hot reload (backend + frontend)
41
- - Swagger documentation out of the box
42
- - Production-ready build scripts and Docker templates
43
- - AI-focused documentation (`ai-context/`)
44
-
45
- ---
46
-
47
- ## Architecture Overview
48
-
49
- ```
50
- ┌─────────────────────────────────────────────────────────────┐
51
- │ FluxStack Monorepo │
52
- ├─────────────────────────────────────────────────────────────┤
53
- app/ │
54
- │ ├─ Frontend (React + Vite) │
55
- │ ├─ Backend (Elysia + Bun) │
56
- │ └─ Shared Types / Utils │
57
- ├─────────────────────────────────────────────────────────────┤
58
- │ core/ │
59
- │ ├─ Server Framework │
60
- │ ├─ Plugin System │
61
- │ └─ Build System │
62
- ├─────────────────────────────────────────────────────────────┤
63
- │ Communication Layer (Eden Treaty, WebSockets) │
64
- ├─────────────────────────────────────────────────────────────┤
65
- │ Configuration Management │
66
- └─────────────────────────────────────────────────────────────┘
67
- ```
68
-
69
- ```
70
- FluxStack/
71
- ├─ core/ # framework internals (read-only)
72
- │ ├─ framework/ # FluxStackFramework (Elysia orchestrator)
73
- │ ├─ plugins/ # built-in plugins (swagger, vite, static, monitoring)
74
- │ ├─ build/ # bundler, optimizer, Docker scaffolding
75
- │ ├─ cli/ # flux CLI commands and generators
76
- │ ├─ config/ # declarative schema helpers
77
- │ └─ utils/ # logging, environment helpers, etc.
78
- ├─ app/ # your editable application code
79
- │ ├─ server/ # API routes, controllers, services, live components
80
- │ │ ├─ controllers/ # business logic
81
- │ │ ├─ routes/ # endpoints + schemas
82
- │ │ ├─ types/ # shared types and App export for Eden Treaty
83
- │ │ └─ live/ # WebSocket live components
84
- │ ├─ client/ # React SPA (components, pages, hooks, store)
85
- │ └─ shared/ # cross-layer types/utilities
86
- ├─ config/ # project-specific config built on the schema
87
- ├─ plugins/ # optional external plugins (e.g. crypto-auth)
88
- ├─ ai-context/ # documentation tailored for assistants
89
- └─ package.json / README.md # project metadata
90
- ```
91
-
92
- ---
93
-
94
- ## Available Scripts
95
-
96
- ```bash
97
- # development
98
- bun run dev # full stack with proxy + vite
99
- bun run dev # logs are automatically filtered in development
100
- bun run dev:frontend # only the frontend (port 5173, no proxy)
101
- bun run dev:backend # only the backend (port 3001)
102
-
103
- # production
104
- bun run build # build backend + frontend + manifest
105
- bun run start # start production bundle
106
-
107
- # utilities
108
- bun run typecheck # run TypeScript type checking
109
- bun run test # execute Vitest suite
110
- ```
111
-
112
- ---
113
-
114
- ## Type-Safe API Development
115
-
116
- FluxStack uses Eden Treaty to eliminate manual DTOs.
117
-
118
- ### Backend Route (Elysia)
119
- ```ts
120
- import { Elysia, t } from 'elysia'
121
-
122
- export const userRoutes = new Elysia({ prefix: '/users' })
123
- .get('/', () => ({ users: listUsers() }))
124
- .post('/', ({ body }) => createUser(body), {
125
- body: t.Object({
126
- name: t.String(),
127
- email: t.String({ format: 'email' })
128
- }),
129
- response: t.Object({
130
- success: t.Boolean(),
131
- user: t.Optional(t.Object({
132
- id: t.Number(),
133
- name: t.String(),
134
- email: t.String(),
135
- createdAt: t.Date()
136
- }))
137
- })
138
- })
139
- ```
140
-
141
- ### Frontend Usage (React)
142
- ```tsx
143
- import { api } from '@/app/client/src/lib/eden-api'
144
-
145
- const { data: response, error } = await api.users.post({
146
- name: 'Ada Lovelace',
147
- email: 'ada@example.com'
148
- })
149
-
150
- if (!error && response?.user) {
151
- console.log(response.user.name)
152
- }
153
- ```
154
-
155
- ---
156
-
157
- ## Customisation Highlights
158
-
159
- ### Add a Route
160
- ```ts
161
- // app/server/routes/posts.ts
162
- import { Elysia, t } from 'elysia'
163
-
164
- export const postRoutes = new Elysia({ prefix: '/posts' })
165
- .get('/', () => ({ posts: [] }))
166
- .post('/', ({ body }) => ({ post: body }), {
167
- body: t.Object({
168
- title: t.String(),
169
- content: t.String()
170
- })
171
- })
172
-
173
- // app/server/index.ts
174
- import { postRoutes } from './routes/posts'
175
- app.use(postRoutes)
176
- ```
177
-
178
- ### Create a Plugin
179
- ```ts
180
- // app/server/plugins/audit.ts
181
- import { Elysia } from 'elysia'
182
-
183
- export const auditPlugin = new Elysia({ name: 'audit' })
184
- .onRequest(({ request }) => {
185
- console.log(`[AUDIT] ${request.method} ${request.url}`)
186
- })
187
- ```
188
-
189
- ---
190
-
191
- ## Documentation & Support
192
-
193
- - Full documentation lives in `ai-context/`.
194
- - Assistant guidelines: `CLAUDE.md`.
195
- - Quick start for AI agents: `ai-context/00-QUICK-START.md`.
196
- - Example apps and guides included in `examples/` and `ai-context/`.
197
-
198
- ---
199
-
200
- ## Community
201
-
202
- - **Issues**: [GitHub Issues](https://github.com/MarcosBrendonDePaula/FluxStack/issues)
203
- - **Docs**: [Repository Docs](https://github.com/MarcosBrendonDePaula/FluxStack)
204
- - **Discussions**: [GitHub Discussions](https://github.com/MarcosBrendonDePaula/FluxStack/discussions)
205
-
206
- ---
207
-
208
- ## Upgrading
209
-
210
- ```bash
211
- # pull the latest scaffold
212
- bunx create-fluxstack@latest my-new-app
213
-
214
- # check current global version
215
- npm list -g create-fluxstack
216
- ```
217
-
218
- ---
219
-
220
- ## Why FluxStack?
221
-
222
- ### Developer Experience
223
- - Zero configuration – start coding immediately.
224
- - Type-safe from controllers to components.
225
- - Hot reload with backend/frontend coordination.
226
- - Swagger documentation generated automatically.
227
-
228
- ### Performance
229
- - Bun runtime for fast startup and low memory.
230
- - Elysia for high-performance API routing.
231
- - Vite for instant dev server and optimized builds.
232
- - React 19 for modern UI primitives.
233
-
234
- ### Production Ready
235
- - Docker multi-stage builds out of the box.
236
- - Declarative configuration with environment overrides.
237
- - Unified error handling and logging support.
238
- - Optional monitoring plugin for metrics/exporters.
239
-
240
- ### Modern Stack
241
- - TypeScript 5, React 19, Tailwind v4, Eden Treaty.
242
- - Shared types everywhere.
243
- - WebSocket live components built in.
244
-
245
- ---
246
-
247
- ## Requirements
248
-
249
- - **Bun** ≥ 1.2.0
250
-
251
- ### Install Bun
252
- ```bash
253
- # macOS / Linux
254
- curl -fsSL https://bun.sh/install | bash
255
-
256
- # Windows
257
- powershell -c "irm bun.sh/install.ps1 | iex"
258
- ```
259
-
260
- > FluxStack targets the Bun runtime. Node.js is not supported.
261
-
262
- ---
263
-
264
- ## Ready to Build?
265
-
266
- ```bash
267
- bunx create-fluxstack my-dream-app
268
- cd my-dream-app
269
- bun run dev
270
- ```
271
-
272
- Welcome to the future of full-stack development.
1
+ <div align="center">
2
+
3
+ # FluxStack
4
+
5
+ ### The Revolutionary Full-Stack TypeScript Framework
6
+
7
+ *Build modern web apps with Bun, Elysia, React, and Eden Treaty*
8
+
9
+ [![npm version](https://badge.fury.io/js/create-fluxstack.svg)](https://www.npmjs.com/package/create-fluxstack)
10
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
11
+ [![Bun](https://img.shields.io/badge/Bun-%23000000.svg?style=flat&logo=bun&logoColor=white)](https://bun.sh)
12
+ [![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?style=flat&logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
13
+ [![React](https://img.shields.io/badge/React-20232A?style=flat&logo=react&logoColor=61DAFB)](https://reactjs.org/)
14
+
15
+ [Quick Start](#-quick-start) • [Features](#-key-features) • [Documentation](#-documentation--support) • [Examples](#-type-safe-api-development)
16
+
17
+ </div>
18
+
19
+ ---
20
+
21
+ ## Key Features
22
+
23
+ <table>
24
+ <tr>
25
+ <td width="50%">
26
+
27
+ ### 🚀 **Blazing Fast**
28
+ - **Bun Runtime** - 3x faster than Node.js
29
+ - **Elysia.js** - High-performance backend
30
+ - **Vite 7** - Lightning-fast HMR
31
+
32
+ </td>
33
+ <td width="50%">
34
+
35
+ ### 🔒 **Type-Safe Everything**
36
+ - **Eden Treaty** - Automatic type inference
37
+ - **End-to-End Types** - Backend to frontend
38
+ - **Zero Manual DTOs** - Types flow naturally
39
+
40
+ </td>
41
+ </tr>
42
+ <tr>
43
+ <td width="50%">
44
+
45
+ ### 🛠️ **Zero Configuration**
46
+ - **One Command Setup** - `bunx create-fluxstack`
47
+ - **Hot Reload Built-in** - Backend + Frontend
48
+ - **Swagger Auto-Generated** - API docs out of the box
49
+
50
+ </td>
51
+ <td width="50%">
52
+
53
+ ### 🎯 **Production Ready**
54
+ - **Docker Multi-Stage** - Optimized containers
55
+ - **Declarative Config** - Environment management
56
+ - **WebSocket Support** - Real-time features
57
+
58
+ </td>
59
+ </tr>
60
+ </table>
61
+
62
+ ---
63
+
64
+ ## 🚀 Quick Start
65
+
66
+ ```bash
67
+ # Create a new FluxStack app
68
+ bunx create-fluxstack my-awesome-app
69
+ cd my-awesome-app
70
+ bun run dev
71
+ ```
72
+
73
+ **That's it!** Your full-stack app is running at:
74
+
75
+ - 🌐 **Frontend & Backend**: http://localhost:3000
76
+ - 📚 **API Documentation**: http://localhost:3000/swagger
77
+ - **Hot Reload**: Automatic on file changes
78
+
79
+ ### Alternative Installation
80
+
81
+ ```bash
82
+ # Create in current directory
83
+ mkdir my-app && cd my-app
84
+ bunx create-fluxstack .
85
+ bun run dev
86
+ ```
87
+
88
+ ---
89
+
90
+ ## 💎 What You Get
91
+
92
+ <details open>
93
+ <summary><b>🎨 Modern Tech Stack (2025)</b></summary>
94
+
95
+ | Layer | Technology | Version | Why? |
96
+ |-------|-----------|---------|------|
97
+ | 🏃 **Runtime** | Bun | 1.2+ | 3x faster than Node.js |
98
+ | ⚙️ **Backend** | Elysia.js | 1.4.6 | Ultra-fast API framework |
99
+ | ⚛️ **Frontend** | React | 19.1 | Latest React features |
100
+ | **Build Tool** | Vite | 7.1.7 | Instant dev server |
101
+ | 💅 **Styling** | Tailwind CSS | 4.1.13 | Utility-first CSS |
102
+ | 📘 **Language** | TypeScript | 5.8.3 | Full type safety |
103
+ | 🔌 **API Client** | Eden Treaty | 1.3.2 | Type-safe API calls |
104
+
105
+ </details>
106
+
107
+ <details open>
108
+ <summary><b>⚙️ Zero-Config Features</b></summary>
109
+
110
+ - ✅ **Automatic Type Inference** - Eden Treaty connects backend types to frontend
111
+ - ✅ **Coordinated Hot Reload** - Backend and frontend reload independently
112
+ - ✅ **Auto-Generated Swagger** - API documentation updates automatically
113
+ - ✅ **Docker Templates** - Production-ready multi-stage builds included
114
+ - ✅ **AI-Focused Docs** - Special documentation for AI assistants (`ai-context/`)
115
+ - ✅ **Declarative Config** - Laravel-inspired configuration system
116
+ - **WebSocket Support** - Real-time features built-in
117
+ - ✅ **Testing Setup** - Vitest + React Testing Library ready
118
+
119
+ </details>
120
+
121
+ ---
122
+
123
+ ## 🏗️ Architecture Overview
124
+
125
+ <div align="center">
126
+
127
+ ```mermaid
128
+ graph TB
129
+ subgraph "🎨 Frontend Layer"
130
+ React[React 19 + Vite]
131
+ Components[Components]
132
+ Hooks[Custom Hooks]
133
+ end
134
+
135
+ subgraph "🔌 Communication Layer"
136
+ Eden[Eden Treaty]
137
+ WS[WebSockets]
138
+ end
139
+
140
+ subgraph "⚙️ Backend Layer"
141
+ Elysia[Elysia.js]
142
+ Routes[API Routes]
143
+ Controllers[Controllers]
144
+ end
145
+
146
+ subgraph "🗄️ Data Layer"
147
+ DB[(Your Database)]
148
+ Cache[(Cache)]
149
+ end
150
+
151
+ React --> Eden
152
+ Eden --> Elysia
153
+ Elysia --> Routes
154
+ Routes --> Controllers
155
+ Controllers --> DB
156
+ React --> WS
157
+ WS --> Elysia
158
+ ```
159
+
160
+ </div>
161
+
162
+ ### 📁 Project Structure
163
+
164
+ <details>
165
+ <summary><b>Click to expand directory structure</b></summary>
166
+
167
+ ```bash
168
+ FluxStack/
169
+ ├── 🔒 core/ # Framework Core (Read-Only)
170
+ │ ├── framework/ # FluxStack orchestrator
171
+ │ ├── plugins/ # Built-in plugins (Swagger, Vite, etc.)
172
+ │ ├── build/ # Build system & Docker scaffolding
173
+ │ ├── cli/ # CLI commands & generators
174
+ │ ├── config/ # Config schema helpers
175
+ │ └── utils/ # Logging, environment, etc.
176
+
177
+ ├── 👨‍💻 app/ # Your Application Code
178
+ │ ├── server/ # Backend (Elysia + Bun)
179
+ │ │ ├── controllers/ # Business logic
180
+ │ │ ├── routes/ # API endpoints + schemas
181
+ │ │ ├── types/ # Shared types & App export
182
+ │ │ └── live/ # WebSocket components
183
+ │ │
184
+ │ ├── client/ # Frontend (React + Vite)
185
+ │ │ ├── src/
186
+ │ │ │ ├── components/ # React components
187
+ │ │ │ ├── hooks/ # Custom React hooks
188
+ │ │ │ ├── lib/ # Eden Treaty client
189
+ │ │ │ └── App.tsx # Main app
190
+ │ │ └── public/ # Static assets
191
+ │ │
192
+ │ └── shared/ # Shared types & utilities
193
+
194
+ ├── ⚙️ config/ # Application Configuration
195
+ │ ├── app.config.ts # App settings
196
+ │ ├── server.config.ts # Server & CORS
197
+ │ ├── logger.config.ts # Logging
198
+ │ └── database.config.ts # Database
199
+
200
+ ├── 🔌 plugins/ # External Plugins
201
+ │ └── crypto-auth/ # Example: Crypto authentication
202
+
203
+ ├── 🤖 ai-context/ # AI Assistant Documentation
204
+ │ ├── 00-QUICK-START.md # Quick start for LLMs
205
+ │ ├── development/ # Development patterns
206
+ │ └── examples/ # Code examples
207
+
208
+ └── 📦 Package Files
209
+ ├── package.json # Dependencies
210
+ ├── tsconfig.json # TypeScript config
211
+ └── README.md # This file
212
+ ```
213
+
214
+ </details>
215
+
216
+ ---
217
+
218
+ ## 📜 Available Scripts
219
+
220
+ <table>
221
+ <tr>
222
+ <td width="50%">
223
+
224
+ ### 🔨 Development
225
+
226
+ ```bash
227
+ # Full-stack development
228
+ bun run dev
229
+
230
+ # Frontend only (port 5173)
231
+ bun run dev:frontend
232
+
233
+ # Backend only (port 3001)
234
+ bun run dev:backend
235
+ ```
236
+
237
+ </td>
238
+ <td width="50%">
239
+
240
+ ### 🚀 Production
241
+
242
+ ```bash
243
+ # Build for production
244
+ bun run build
245
+
246
+ # Start production server
247
+ bun run start
248
+ ```
249
+
250
+ </td>
251
+ </tr>
252
+ <tr>
253
+ <td width="50%">
254
+
255
+ ### 🧪 Testing & Quality
256
+
257
+ ```bash
258
+ # Run tests
259
+ bun run test
260
+
261
+ # Test with UI
262
+ bun run test:ui
263
+
264
+ # Type checking
265
+ bunx tsc --noEmit
266
+ ```
267
+
268
+ </td>
269
+ <td width="50%">
270
+
271
+ ### 🛠️ Utilities
272
+
273
+ ```bash
274
+ # Sync version across files
275
+ bun run sync-version
276
+
277
+ # Run CLI commands
278
+ bun run cli
279
+ ```
280
+
281
+ </td>
282
+ </tr>
283
+ </table>
284
+
285
+ ---
286
+
287
+ ## 🔒 Type-Safe API Development
288
+
289
+ **FluxStack uses Eden Treaty to eliminate manual DTOs and provide automatic type inference from backend to frontend.**
290
+
291
+ ### 📝 Define Backend Route
292
+
293
+ ```typescript
294
+ // app/server/routes/users.ts
295
+ import { Elysia, t } from 'elysia'
296
+
297
+ export const userRoutes = new Elysia({ prefix: '/users' })
298
+ .get('/', () => ({
299
+ users: listUsers()
300
+ }))
301
+ .post('/', ({ body }) => createUser(body), {
302
+ body: t.Object({
303
+ name: t.String(),
304
+ email: t.String({ format: 'email' })
305
+ }),
306
+ response: t.Object({
307
+ success: t.Boolean(),
308
+ user: t.Optional(t.Object({
309
+ id: t.Number(),
310
+ name: t.String(),
311
+ email: t.String(),
312
+ createdAt: t.Date()
313
+ })),
314
+ message: t.Optional(t.String())
315
+ })
316
+ })
317
+ ```
318
+
319
+ ### ✨ Use in Frontend (Fully Typed!)
320
+
321
+ ```typescript
322
+ // app/client/src/App.tsx
323
+ import { api } from '@/app/client/src/lib/eden-api'
324
+
325
+ // ✅ TypeScript knows all types automatically!
326
+ const { data: response, error } = await api.users.post({
327
+ name: 'Ada Lovelace', // ✅ Type: string
328
+ email: 'ada@example.com' // ✅ Type: string (email format)
329
+ })
330
+
331
+ // ✅ response is typed as the exact response schema
332
+ if (!error && response?.user) {
333
+ console.log(response.user.name) // ✅ Type: string
334
+ console.log(response.user.id) // ✅ Type: number
335
+ console.log(response.user.createdAt) // ✅ Type: Date
336
+ }
337
+ ```
338
+
339
+ ### 🎯 Benefits
340
+
341
+ - ✅ **Zero Manual Types** - Types flow automatically from backend to frontend
342
+ - ✅ **Autocomplete** - Full IntelliSense in your IDE
343
+ - ✅ **Type Safety** - Catch errors at compile time, not runtime
344
+ - ✅ **Refactor Friendly** - Change backend schema, frontend updates automatically
345
+
346
+ ---
347
+
348
+ ## 🎨 Customization Examples
349
+
350
+ <details>
351
+ <summary><b>➕ Add a New API Route</b></summary>
352
+
353
+ ```typescript
354
+ // app/server/routes/posts.ts
355
+ import { Elysia, t } from 'elysia'
356
+
357
+ export const postRoutes = new Elysia({ prefix: '/posts' })
358
+ .get('/', () => ({
359
+ posts: getAllPosts()
360
+ }))
361
+ .post('/', ({ body }) => ({
362
+ post: createPost(body)
363
+ }), {
364
+ body: t.Object({
365
+ title: t.String({ minLength: 3 }),
366
+ content: t.String({ minLength: 10 })
367
+ })
368
+ })
369
+ ```
370
+
371
+ **Then register it:**
372
+ ```typescript
373
+ // app/server/index.ts
374
+ import { postRoutes } from './routes/posts'
375
+
376
+ app.use(postRoutes)
377
+ ```
378
+
379
+ </details>
380
+
381
+ <details>
382
+ <summary><b>🔌 Create a Custom Plugin</b></summary>
383
+
384
+ ```typescript
385
+ // app/server/plugins/audit.ts
386
+ import { Elysia } from 'elysia'
387
+
388
+ export const auditPlugin = new Elysia({ name: 'audit' })
389
+ .derive(({ request }) => ({
390
+ timestamp: Date.now(),
391
+ ip: request.headers.get('x-forwarded-for')
392
+ }))
393
+ .onRequest(({ request, timestamp }) => {
394
+ console.log(`[${new Date(timestamp).toISOString()}] ${request.method} ${request.url}`)
395
+ })
396
+ .onResponse(({ request, timestamp }) => {
397
+ const duration = Date.now() - timestamp
398
+ console.log(`[AUDIT] ${request.method} ${request.url} - ${duration}ms`)
399
+ })
400
+ ```
401
+
402
+ **Use it:**
403
+ ```typescript
404
+ import { auditPlugin } from './plugins/audit'
405
+
406
+ app.use(auditPlugin)
407
+ ```
408
+
409
+ </details>
410
+
411
+ <details>
412
+ <summary><b>⚙️ Add Environment Configuration</b></summary>
413
+
414
+ ```typescript
415
+ // config/features.config.ts
416
+ import { defineConfig, config } from '@/core/utils/config-schema'
417
+
418
+ const featuresConfigSchema = {
419
+ enableAnalytics: config.boolean('ENABLE_ANALYTICS', false),
420
+ maxUploadSize: config.number('MAX_UPLOAD_SIZE', 5242880), // 5MB
421
+ allowedOrigins: config.array('ALLOWED_ORIGINS', ['http://localhost:3000'])
422
+ } as const
423
+
424
+ export const featuresConfig = defineConfig(featuresConfigSchema)
425
+ ```
426
+
427
+ **Use it with full type safety:**
428
+ ```typescript
429
+ import { featuresConfig } from '@/config/features.config'
430
+
431
+ if (featuresConfig.enableAnalytics) {
432
+ // Type: boolean (not string!)
433
+ trackEvent('user_action')
434
+ }
435
+ ```
436
+
437
+ </details>
438
+
439
+ ---
440
+
441
+ ## 📚 Documentation & Support
442
+
443
+ <table>
444
+ <tr>
445
+ <td width="33%">
446
+
447
+ ### 📖 **Documentation**
448
+ - [AI Context Docs](./ai-context/)
449
+ - [Quick Start Guide](./ai-context/00-QUICK-START.md)
450
+ - [Development Patterns](./ai-context/development/patterns.md)
451
+ - [CLAUDE.md](./CLAUDE.md)
452
+
453
+ </td>
454
+ <td width="33%">
455
+
456
+ ### 💬 **Community**
457
+ - [GitHub Issues](https://github.com/MarcosBrendonDePaula/FluxStack/issues)
458
+ - [Discussions](https://github.com/MarcosBrendonDePaula/FluxStack/discussions)
459
+ - [Repository](https://github.com/MarcosBrendonDePaula/FluxStack)
460
+
461
+ </td>
462
+ <td width="33%">
463
+
464
+ ### 🔄 **Upgrading**
465
+ ```bash
466
+ bunx create-fluxstack@latest
467
+
468
+ # Check version
469
+ npm list -g create-fluxstack
470
+ ```
471
+
472
+ </td>
473
+ </tr>
474
+ </table>
475
+
476
+ ---
477
+
478
+ ## 🤔 Why FluxStack?
479
+
480
+ ### 🆚 **Comparison with Other Stacks**
481
+
482
+ <table>
483
+ <tr>
484
+ <th>Feature</th>
485
+ <th>FluxStack</th>
486
+ <th>Next.js</th>
487
+ <th>T3 Stack</th>
488
+ </tr>
489
+ <tr>
490
+ <td><b>Runtime</b></td>
491
+ <td>✅ Bun (3x faster)</td>
492
+ <td>❌ Node.js</td>
493
+ <td>❌ Node.js</td>
494
+ </tr>
495
+ <tr>
496
+ <td><b>Backend Framework</b></td>
497
+ <td>✅ Elysia (ultra-fast)</td>
498
+ <td>⚠️ Next.js API Routes</td>
499
+ <td>✅ tRPC</td>
500
+ </tr>
501
+ <tr>
502
+ <td><b>Type Safety</b></td>
503
+ <td>✅ Eden Treaty (auto-inferred)</td>
504
+ <td>⚠️ Manual types</td>
505
+ <td>✅ tRPC</td>
506
+ </tr>
507
+ <tr>
508
+ <td><b>Configuration</b></td>
509
+ <td>✅ Declarative with validation</td>
510
+ <td>⚠️ Manual setup</td>
511
+ <td>⚠️ Manual setup</td>
512
+ </tr>
513
+ <tr>
514
+ <td><b>API Docs</b></td>
515
+ <td>✅ Auto-generated Swagger</td>
516
+ <td>❌ Manual</td>
517
+ <td>❌ Manual</td>
518
+ </tr>
519
+ <tr>
520
+ <td><b>WebSockets</b></td>
521
+ <td>✅ Built-in</td>
522
+ <td>⚠️ Third-party</td>
523
+ <td>⚠️ Third-party</td>
524
+ </tr>
525
+ <tr>
526
+ <td><b>Docker</b></td>
527
+ <td>✅ Multi-stage ready</td>
528
+ <td>⚠️ Manual setup</td>
529
+ <td>⚠️ Manual setup</td>
530
+ </tr>
531
+ </table>
532
+
533
+ ### 💡 **Key Advantages**
534
+
535
+ <table>
536
+ <tr>
537
+ <td width="50%">
538
+
539
+ #### 🚀 **Performance**
540
+ - **3x faster** startup with Bun
541
+ - **Ultra-fast** API routing with Elysia
542
+ - **Instant** HMR with Vite 7
543
+ - **Optimized** production builds
544
+
545
+ #### 🔒 **Type Safety**
546
+ - **Automatic** type inference
547
+ - **Zero manual** DTO definitions
548
+ - **End-to-end** type checking
549
+ - **Refactor-friendly** architecture
550
+
551
+ </td>
552
+ <td width="50%">
553
+
554
+ #### 🛠️ **Developer Experience**
555
+ - **Zero configuration** needed
556
+ - **One command** to start
557
+ - **Auto-generated** documentation
558
+ - **AI-optimized** documentation
559
+
560
+ #### 🎯 **Production Ready**
561
+ - **Docker** templates included
562
+ - **Declarative** configuration
563
+ - **Unified** error handling
564
+ - **Built-in** monitoring support
565
+
566
+ </td>
567
+ </tr>
568
+ </table>
569
+
570
+ ---
571
+
572
+ ## ⚙️ Requirements
573
+
574
+ <table>
575
+ <tr>
576
+ <td width="50%">
577
+
578
+ ### 📦 **System Requirements**
579
+ - **Bun** ≥ 1.2.0 (required)
580
+ - **Git** (for version control)
581
+ - **Modern OS**: Linux, macOS, or Windows
582
+
583
+ </td>
584
+ <td width="50%">
585
+
586
+ ### 📥 **Install Bun**
587
+
588
+ **macOS / Linux:**
589
+ ```bash
590
+ curl -fsSL https://bun.sh/install | bash
591
+ ```
592
+
593
+ **Windows:**
594
+ ```powershell
595
+ powershell -c "irm bun.sh/install.ps1 | iex"
596
+ ```
597
+
598
+ </td>
599
+ </tr>
600
+ </table>
601
+
602
+ > ⚠️ **Important**: FluxStack is designed exclusively for the Bun runtime. Node.js is not supported.
603
+
604
+ ---
605
+
606
+ ## 🚀 Ready to Build?
607
+
608
+ <div align="center">
609
+
610
+ ### Start your next project in seconds
611
+
612
+ ```bash
613
+ bunx create-fluxstack my-awesome-app
614
+ cd my-awesome-app
615
+ bun run dev
616
+ ```
617
+
618
+ ### Welcome to the future of full-stack development 🎉
619
+
620
+ [![GitHub Repo](https://img.shields.io/badge/GitHub-FluxStack-blue?style=for-the-badge&logo=github)](https://github.com/MarcosBrendonDePaula/FluxStack)
621
+ [![npm](https://img.shields.io/badge/npm-create--fluxstack-red?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/create-fluxstack)
622
+
623
+ </div>
624
+
625
+ ---
626
+
627
+ ## 📄 License
628
+
629
+ This project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for details.
630
+
631
+ ---
632
+
633
+ ## 🙏 Acknowledgments
634
+
635
+ Built with amazing open-source technologies:
636
+ - [Bun](https://bun.sh) - Fast all-in-one JavaScript runtime
637
+ - [Elysia.js](https://elysiajs.com) - Ergonomic framework for humans
638
+ - [React](https://react.dev) - Library for web and native interfaces
639
+ - [Vite](https://vite.dev) - Next generation frontend tooling
640
+ - [Tailwind CSS](https://tailwindcss.com) - Utility-first CSS framework
641
+ - [TypeScript](https://www.typescriptlang.org) - JavaScript with syntax for types
642
+
643
+ ---
644
+
645
+ <div align="center">
646
+
647
+ **Made with ❤️ by the FluxStack Team**
648
+
649
+ *Star ⭐ this repo if you find it helpful!*
650
+
651
+ [Report Bug](https://github.com/MarcosBrendonDePaula/FluxStack/issues) · [Request Feature](https://github.com/MarcosBrendonDePaula/FluxStack/issues) · [Contribute](https://github.com/MarcosBrendonDePaula/FluxStack/pulls)
652
+
653
+ </div>