create-fluxstack 1.0.13 → 1.0.14
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/.env.example +29 -29
- package/app/client/README.md +69 -69
- package/app/client/index.html +14 -13
- package/app/client/src/App.tsx +157 -524
- package/app/client/src/components/ErrorBoundary.tsx +107 -0
- package/app/client/src/components/ErrorDisplay.css +365 -0
- package/app/client/src/components/ErrorDisplay.tsx +258 -0
- package/app/client/src/components/FluxStackConfig.tsx +1321 -0
- package/app/client/src/components/HybridLiveCounter.tsx +140 -0
- package/app/client/src/components/LiveClock.tsx +286 -0
- package/app/client/src/components/MainLayout.tsx +390 -0
- package/app/client/src/components/SidebarNavigation.tsx +391 -0
- package/app/client/src/components/StateDemo.tsx +178 -0
- package/app/client/src/components/SystemMonitor.tsx +1038 -0
- package/app/client/src/components/Teste.tsx +104 -0
- package/app/client/src/components/UserProfile.tsx +809 -0
- package/app/client/src/hooks/useAuth.ts +39 -0
- package/app/client/src/hooks/useNotifications.ts +56 -0
- package/app/client/src/lib/eden-api.ts +189 -53
- package/app/client/src/lib/errors.ts +340 -0
- package/app/client/src/lib/hooks/useErrorHandler.ts +258 -0
- package/app/client/src/lib/index.ts +45 -0
- package/app/client/src/main.tsx +3 -2
- package/app/client/src/pages/ApiDocs.tsx +182 -0
- package/app/client/src/pages/Demo.tsx +174 -0
- package/app/client/src/pages/HybridLive.tsx +263 -0
- package/app/client/src/pages/Overview.tsx +155 -0
- package/app/client/src/store/README.md +43 -0
- package/app/client/src/store/index.ts +16 -0
- package/app/client/src/store/slices/uiSlice.ts +151 -0
- package/app/client/src/store/slices/userSlice.ts +161 -0
- package/app/client/src/test/README.md +257 -0
- package/app/client/src/test/setup.ts +70 -0
- package/app/client/src/test/types.ts +12 -0
- package/app/client/src/vite-env.d.ts +1 -1
- package/app/client/tsconfig.app.json +44 -43
- package/app/client/tsconfig.json +7 -7
- package/app/client/tsconfig.node.json +25 -25
- package/app/client/zustand-setup.md +65 -0
- package/app/server/controllers/users.controller.ts +68 -68
- package/app/server/index.ts +9 -1
- package/app/server/live/CounterComponent.ts +191 -0
- package/app/server/live/FluxStackConfig.ts +529 -0
- package/app/server/live/LiveClockComponent.ts +214 -0
- package/app/server/live/SidebarNavigation.ts +156 -0
- package/app/server/live/SystemMonitor.ts +594 -0
- package/app/server/live/SystemMonitorIntegration.ts +151 -0
- package/app/server/live/TesteComponent.ts +87 -0
- package/app/server/live/UserProfileComponent.ts +135 -0
- package/app/server/live/register-components.ts +28 -0
- package/app/server/middleware/auth.ts +136 -0
- package/app/server/middleware/errorHandling.ts +250 -0
- package/app/server/middleware/index.ts +10 -0
- package/app/server/middleware/rateLimit.ts +193 -0
- package/app/server/middleware/requestLogging.ts +215 -0
- package/app/server/middleware/validation.ts +270 -0
- package/app/server/routes/index.ts +14 -2
- package/app/server/routes/upload.ts +92 -0
- package/app/server/routes/users.routes.ts +2 -9
- package/app/server/services/NotificationService.ts +302 -0
- package/app/server/services/UserService.ts +222 -0
- package/app/server/services/index.ts +46 -0
- package/core/cli/commands/plugin-deps.ts +263 -0
- package/core/cli/generators/README.md +339 -0
- package/core/cli/generators/component.ts +770 -0
- package/core/cli/generators/controller.ts +299 -0
- package/core/cli/generators/index.ts +144 -0
- package/core/cli/generators/interactive.ts +228 -0
- package/core/cli/generators/prompts.ts +83 -0
- package/core/cli/generators/route.ts +513 -0
- package/core/cli/generators/service.ts +465 -0
- package/core/cli/generators/template-engine.ts +154 -0
- package/core/cli/generators/types.ts +71 -0
- package/core/cli/generators/utils.ts +192 -0
- package/core/cli/index.ts +69 -0
- package/core/cli/plugin-discovery.ts +16 -85
- package/core/client/fluxstack.ts +17 -0
- package/core/client/hooks/index.ts +7 -0
- package/core/client/hooks/state-validator.ts +130 -0
- package/core/client/hooks/useAuth.ts +49 -0
- package/core/client/hooks/useChunkedUpload.ts +258 -0
- package/core/client/hooks/useHybridLiveComponent.ts +967 -0
- package/core/client/hooks/useWebSocket.ts +373 -0
- package/core/client/index.ts +47 -0
- package/core/client/state/createStore.ts +193 -0
- package/core/client/state/index.ts +15 -0
- package/core/config/env-dynamic.ts +1 -1
- package/core/config/env.ts +2 -1
- package/core/config/runtime-config.ts +3 -3
- package/core/config/schema.ts +84 -49
- package/core/framework/server.ts +30 -0
- package/core/index.ts +25 -0
- package/core/live/ComponentRegistry.ts +399 -0
- package/core/live/types.ts +164 -0
- package/core/plugins/built-in/live-components/commands/create-live-component.ts +1201 -0
- package/core/plugins/built-in/live-components/index.ts +27 -0
- package/core/plugins/built-in/logger/index.ts +1 -1
- package/core/plugins/built-in/monitoring/index.ts +1 -1
- package/core/plugins/built-in/static/index.ts +1 -1
- package/core/plugins/built-in/swagger/index.ts +1 -1
- package/core/plugins/built-in/vite/index.ts +1 -1
- package/core/plugins/dependency-manager.ts +384 -0
- package/core/plugins/index.ts +5 -1
- package/core/plugins/manager.ts +7 -3
- package/core/plugins/registry.ts +88 -10
- package/core/plugins/types.ts +11 -11
- package/core/server/framework.ts +43 -0
- package/core/server/index.ts +11 -1
- package/core/server/live/ComponentRegistry.ts +1017 -0
- package/core/server/live/FileUploadManager.ts +272 -0
- package/core/server/live/LiveComponentPerformanceMonitor.ts +930 -0
- package/core/server/live/SingleConnectionManager.ts +0 -0
- package/core/server/live/StateSignature.ts +644 -0
- package/core/server/live/WebSocketConnectionManager.ts +688 -0
- package/core/server/live/websocket-plugin.ts +435 -0
- package/core/server/middleware/errorHandling.ts +141 -0
- package/core/server/middleware/index.ts +16 -0
- package/core/server/plugins/static-files-plugin.ts +232 -0
- package/core/server/services/BaseService.ts +95 -0
- package/core/server/services/ServiceContainer.ts +144 -0
- package/core/server/services/index.ts +9 -0
- package/core/templates/create-project.ts +46 -2
- package/core/testing/index.ts +10 -0
- package/core/testing/setup.ts +74 -0
- package/core/types/build.ts +38 -14
- package/core/types/types.ts +319 -0
- package/core/utils/env-runtime.ts +7 -0
- package/core/utils/errors/handlers.ts +264 -39
- package/core/utils/errors/index.ts +528 -18
- package/core/utils/errors/middleware.ts +114 -0
- package/core/utils/logger/formatters.ts +222 -0
- package/core/utils/logger/index.ts +167 -48
- package/core/utils/logger/middleware.ts +253 -0
- package/core/utils/logger/performance.ts +384 -0
- package/core/utils/logger/transports.ts +365 -0
- package/create-fluxstack.ts +296 -296
- package/fluxstack.config.ts +17 -1
- package/package-template.json +66 -66
- package/package.json +31 -6
- package/public/README.md +16 -0
- package/vite.config.ts +29 -14
- package/.claude/settings.local.json +0 -74
- package/.github/workflows/ci-build-tests.yml +0 -480
- package/.github/workflows/dependency-management.yml +0 -324
- package/.github/workflows/release-validation.yml +0 -355
- package/.kiro/specs/fluxstack-architecture-optimization/design.md +0 -700
- package/.kiro/specs/fluxstack-architecture-optimization/requirements.md +0 -127
- package/.kiro/specs/fluxstack-architecture-optimization/tasks.md +0 -330
- package/CLAUDE.md +0 -200
- package/Dockerfile +0 -58
- package/Dockerfile.backend +0 -52
- package/Dockerfile.frontend +0 -54
- package/README-Docker.md +0 -85
- package/ai-context/00-QUICK-START.md +0 -86
- package/ai-context/README.md +0 -88
- package/ai-context/development/eden-treaty-guide.md +0 -362
- package/ai-context/development/patterns.md +0 -382
- package/ai-context/development/plugins-guide.md +0 -572
- package/ai-context/examples/crud-complete.md +0 -626
- package/ai-context/project/architecture.md +0 -399
- package/ai-context/project/overview.md +0 -213
- package/ai-context/recent-changes/eden-treaty-refactor.md +0 -281
- package/ai-context/recent-changes/type-inference-fix.md +0 -223
- package/ai-context/reference/environment-vars.md +0 -384
- package/ai-context/reference/troubleshooting.md +0 -407
- package/app/client/src/components/TestPage.tsx +0 -453
- package/bun.lock +0 -1063
- package/bunfig.toml +0 -16
- package/core/__tests__/integration.test.ts +0 -227
- package/core/build/index.ts +0 -186
- package/core/config/__tests__/config-loader.test.ts +0 -554
- package/core/config/__tests__/config-merger.test.ts +0 -657
- package/core/config/__tests__/env-converter.test.ts +0 -372
- package/core/config/__tests__/env-processor.test.ts +0 -431
- package/core/config/__tests__/env.test.ts +0 -452
- package/core/config/__tests__/integration.test.ts +0 -418
- package/core/config/__tests__/loader.test.ts +0 -331
- package/core/config/__tests__/schema.test.ts +0 -129
- package/core/config/__tests__/validator.test.ts +0 -318
- package/core/framework/__tests__/server.test.ts +0 -233
- package/core/plugins/__tests__/built-in.test.ts.disabled +0 -366
- package/core/plugins/__tests__/manager.test.ts +0 -398
- package/core/plugins/__tests__/monitoring.test.ts +0 -401
- package/core/plugins/__tests__/registry.test.ts +0 -335
- package/core/utils/__tests__/errors.test.ts +0 -139
- package/core/utils/__tests__/helpers.test.ts +0 -297
- package/core/utils/__tests__/logger.test.ts +0 -141
- package/create-test-app.ts +0 -156
- package/docker-compose.microservices.yml +0 -75
- package/docker-compose.simple.yml +0 -57
- package/docker-compose.yml +0 -71
- package/eslint.config.js +0 -23
- package/flux-cli.ts +0 -214
- package/nginx-lb.conf +0 -37
- package/publish.sh +0 -63
- package/run-clean.ts +0 -26
- package/run-env-tests.ts +0 -313
- package/tailwind.config.js +0 -34
- package/tests/__mocks__/api.ts +0 -56
- package/tests/fixtures/users.ts +0 -69
- package/tests/integration/api/users.routes.test.ts +0 -221
- package/tests/setup.ts +0 -29
- package/tests/unit/app/client/App-simple.test.tsx +0 -56
- package/tests/unit/app/client/App.test.tsx.skip +0 -237
- package/tests/unit/app/client/eden-api.test.ts +0 -186
- package/tests/unit/app/client/simple.test.tsx +0 -23
- package/tests/unit/app/controllers/users.controller.test.ts +0 -150
- package/tests/unit/core/create-project.test.ts.skip +0 -95
- package/tests/unit/core/framework.test.ts +0 -144
- package/tests/unit/core/plugins/logger.test.ts.skip +0 -268
- package/tests/unit/core/plugins/vite.test.ts.disabled +0 -188
- package/tests/utils/test-helpers.ts +0 -61
- package/vitest.config.ts +0 -50
- package/workspace.json +0 -6
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
# Requirements Document
|
|
2
|
-
|
|
3
|
-
## Introduction
|
|
4
|
-
|
|
5
|
-
Esta especificação define melhorias na arquitetura do FluxStack para otimizar a organização do código, performance, developer experience e manutenibilidade. O objetivo é evoluir o framework mantendo sua simplicidade e poder, mas corrigindo inconsistências estruturais e adicionando funcionalidades que faltam para um framework de produção robusto.
|
|
6
|
-
|
|
7
|
-
## Requirements
|
|
8
|
-
|
|
9
|
-
### Requirement 1: Reorganização da Estrutura de Pastas
|
|
10
|
-
|
|
11
|
-
**User Story:** Como desenvolvedor usando FluxStack, eu quero uma estrutura de pastas mais consistente e intuitiva, para que eu possa navegar e organizar meu código de forma mais eficiente.
|
|
12
|
-
|
|
13
|
-
#### Acceptance Criteria
|
|
14
|
-
|
|
15
|
-
1. WHEN eu examino a estrutura do projeto THEN eu devo ver uma organização clara entre framework core, aplicação do usuário, e configurações
|
|
16
|
-
2. WHEN eu procuro por arquivos relacionados THEN eles devem estar agrupados logicamente na mesma pasta ou subpasta
|
|
17
|
-
3. WHEN eu adiciono novos plugins ou funcionalidades THEN deve haver um local claro e consistente para colocá-los
|
|
18
|
-
4. WHEN eu trabalho com tipos compartilhados THEN deve haver uma estrutura clara que evite imports circulares
|
|
19
|
-
5. WHEN eu examino a pasta core THEN ela deve estar organizada por funcionalidade (server, client, build, cli, etc.)
|
|
20
|
-
|
|
21
|
-
### Requirement 2: Sistema de Build Otimizado
|
|
22
|
-
|
|
23
|
-
**User Story:** Como desenvolvedor, eu quero um sistema de build mais robusto e rápido, para que eu possa ter builds confiáveis tanto em desenvolvimento quanto em produção.
|
|
24
|
-
|
|
25
|
-
#### Acceptance Criteria
|
|
26
|
-
|
|
27
|
-
1. WHEN eu executo `bun run build` THEN o processo deve ser otimizado e reportar progresso claramente
|
|
28
|
-
2. WHEN o build falha THEN eu devo receber mensagens de erro claras e acionáveis
|
|
29
|
-
3. WHEN eu faço build de produção THEN os assets devem ser otimizados (minificação, tree-shaking, etc.)
|
|
30
|
-
4. WHEN eu uso build incremental THEN apenas os arquivos modificados devem ser reprocessados
|
|
31
|
-
5. WHEN eu configuro diferentes targets THEN o build deve se adaptar automaticamente (Node.js, Bun, Docker)
|
|
32
|
-
|
|
33
|
-
### Requirement 3: Sistema de Logging Aprimorado
|
|
34
|
-
|
|
35
|
-
**User Story:** Como desenvolvedor, eu quero um sistema de logging mais estruturado e configurável, para que eu possa debugar problemas e monitorar a aplicação eficientemente.
|
|
36
|
-
|
|
37
|
-
#### Acceptance Criteria
|
|
38
|
-
|
|
39
|
-
1. WHEN a aplicação roda THEN os logs devem ter formato consistente com timestamps, níveis e contexto
|
|
40
|
-
2. WHEN eu configuro LOG_LEVEL THEN apenas logs do nível especificado ou superior devem aparecer
|
|
41
|
-
3. WHEN ocorre um erro THEN o log deve incluir stack trace, contexto da requisição e metadata relevante
|
|
42
|
-
4. WHEN eu uso diferentes ambientes THEN o formato de log deve se adaptar (desenvolvimento vs produção)
|
|
43
|
-
5. WHEN eu quero logs estruturados THEN deve haver suporte para JSON logging para ferramentas de monitoramento
|
|
44
|
-
|
|
45
|
-
### Requirement 4: Error Handling Unificado
|
|
46
|
-
|
|
47
|
-
**User Story:** Como desenvolvedor, eu quero um sistema de tratamento de erros consistente entre frontend e backend, para que eu possa lidar com erros de forma previsível e user-friendly.
|
|
48
|
-
|
|
49
|
-
#### Acceptance Criteria
|
|
50
|
-
|
|
51
|
-
1. WHEN ocorre um erro no backend THEN ele deve ser formatado de forma consistente com códigos de erro padronizados
|
|
52
|
-
2. WHEN o frontend recebe um erro THEN ele deve ser tratado de forma consistente com mensagens user-friendly
|
|
53
|
-
3. WHEN há erro de validação THEN as mensagens devem ser específicas e acionáveis
|
|
54
|
-
4. WHEN ocorre erro de rede THEN deve haver retry automático e fallbacks apropriados
|
|
55
|
-
5. WHEN há erro não tratado THEN deve ser logado adequadamente e não quebrar a aplicação
|
|
56
|
-
|
|
57
|
-
### Requirement 5: Plugin System Aprimorado
|
|
58
|
-
|
|
59
|
-
**User Story:** Como desenvolvedor, eu quero um sistema de plugins mais poderoso e flexível, para que eu possa estender o FluxStack facilmente com funcionalidades customizadas.
|
|
60
|
-
|
|
61
|
-
#### Acceptance Criteria
|
|
62
|
-
|
|
63
|
-
1. WHEN eu crio um plugin THEN deve haver uma API clara para hooks de lifecycle (onRequest, onResponse, onError, etc.)
|
|
64
|
-
2. WHEN eu instalo um plugin THEN ele deve poder modificar configurações, adicionar rotas e middleware
|
|
65
|
-
3. WHEN plugins interagem THEN deve haver um sistema de prioridades e dependências
|
|
66
|
-
4. WHEN eu desenvolvo plugins THEN deve haver TypeScript support completo com tipos inferidos
|
|
67
|
-
5. WHEN eu distribuo plugins THEN deve haver um sistema de descoberta e instalação simples
|
|
68
|
-
|
|
69
|
-
### Requirement 6: Development Experience Melhorado
|
|
70
|
-
|
|
71
|
-
**User Story:** Como desenvolvedor, eu quero uma experiência de desenvolvimento mais fluida e produtiva, para que eu possa focar na lógica de negócio ao invés de configurações.
|
|
72
|
-
|
|
73
|
-
#### Acceptance Criteria
|
|
74
|
-
|
|
75
|
-
1. WHEN eu inicio o desenvolvimento THEN o setup deve ser instantâneo com feedback claro do status
|
|
76
|
-
2. WHEN eu faço mudanças no código THEN o hot reload deve ser rápido e confiável
|
|
77
|
-
3. WHEN ocorrem erros THEN eles devem ser exibidos de forma clara no terminal e browser
|
|
78
|
-
4. WHEN eu uso o CLI THEN os comandos devem ter help contextual e validação de parâmetros
|
|
79
|
-
5. WHEN eu trabalho com APIs THEN deve haver ferramentas de debugging e inspeção integradas
|
|
80
|
-
|
|
81
|
-
### Requirement 7: Performance Monitoring
|
|
82
|
-
|
|
83
|
-
**User Story:** Como desenvolvedor, eu quero ferramentas de monitoramento de performance integradas, para que eu possa identificar e otimizar gargalos na aplicação.
|
|
84
|
-
|
|
85
|
-
#### Acceptance Criteria
|
|
86
|
-
|
|
87
|
-
1. WHEN a aplicação roda THEN deve coletar métricas básicas (response time, memory usage, etc.)
|
|
88
|
-
2. WHEN eu acesso endpoints THEN deve haver logging de performance com timing detalhado
|
|
89
|
-
3. WHEN há problemas de performance THEN deve haver alertas e sugestões de otimização
|
|
90
|
-
4. WHEN eu uso em produção THEN deve haver dashboard básico de métricas
|
|
91
|
-
5. WHEN integro com ferramentas externas THEN deve haver exporters para Prometheus, DataDog, etc.
|
|
92
|
-
|
|
93
|
-
### Requirement 8: Gerenciamento de Estado Global
|
|
94
|
-
|
|
95
|
-
**User Story:** Como desenvolvedor frontend, eu quero um padrão claro para gerenciamento de estado global, para que eu possa compartilhar estado entre componentes de forma eficiente.
|
|
96
|
-
|
|
97
|
-
#### Acceptance Criteria
|
|
98
|
-
|
|
99
|
-
1. WHEN eu preciso de estado global THEN deve haver uma solução integrada e type-safe
|
|
100
|
-
2. WHEN o estado muda THEN os componentes devem re-renderizar automaticamente
|
|
101
|
-
3. WHEN eu uso estado assíncrono THEN deve haver suporte para loading states e error handling
|
|
102
|
-
4. WHEN eu persisto estado THEN deve haver integração com localStorage/sessionStorage
|
|
103
|
-
5. WHEN eu debugo estado THEN deve haver ferramentas de inspeção integradas
|
|
104
|
-
|
|
105
|
-
### Requirement 9: Configuração Avançada
|
|
106
|
-
|
|
107
|
-
**User Story:** Como desenvolvedor, eu quero um sistema de configuração mais flexível e poderoso, para que eu possa customizar o comportamento do framework para diferentes cenários.
|
|
108
|
-
|
|
109
|
-
#### Acceptance Criteria
|
|
110
|
-
|
|
111
|
-
1. WHEN eu configuro o framework THEN deve haver validação de configuração com mensagens claras
|
|
112
|
-
2. WHEN eu uso diferentes ambientes THEN as configurações devem ser carregadas automaticamente
|
|
113
|
-
3. WHEN eu override configurações THEN deve haver precedência clara (env vars > config file > defaults)
|
|
114
|
-
4. WHEN eu adiciono configurações customizadas THEN elas devem ser type-safe e documentadas
|
|
115
|
-
5. WHEN eu valido configurações THEN deve haver schema validation com error reporting detalhado
|
|
116
|
-
|
|
117
|
-
### Requirement 10: Tooling e Utilitários
|
|
118
|
-
|
|
119
|
-
**User Story:** Como desenvolvedor, eu quero ferramentas e utilitários integrados que facilitem tarefas comuns de desenvolvimento, para que eu possa ser mais produtivo.
|
|
120
|
-
|
|
121
|
-
#### Acceptance Criteria
|
|
122
|
-
|
|
123
|
-
1. WHEN eu preciso gerar código THEN deve haver generators para controllers, routes, components, etc.
|
|
124
|
-
2. WHEN eu faço deploy THEN deve haver comandos integrados para diferentes plataformas
|
|
125
|
-
3. WHEN eu analiso o projeto THEN deve haver ferramentas de análise de bundle size e dependencies
|
|
126
|
-
4. WHEN eu migro versões THEN deve haver scripts de migração automática
|
|
127
|
-
5. WHEN eu trabalho em equipe THEN deve haver ferramentas de linting e formatting configuradas
|
|
@@ -1,330 +0,0 @@
|
|
|
1
|
-
# Implementation Plan
|
|
2
|
-
|
|
3
|
-
- [x] 1. Setup and Configuration System Refactoring
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
- Create new configuration system with schema validation and environment handling
|
|
9
|
-
- Move fluxstack.config.ts to root and implement new configuration structure
|
|
10
|
-
- Implement configuration loader with validation and environment-specific overrides
|
|
11
|
-
- _Requirements: 1.1, 9.1, 9.2, 9.3, 9.4, 9.5_
|
|
12
|
-
|
|
13
|
-
- [x] 1.1 Create Enhanced Configuration Schema
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
- Write TypeScript interfaces for comprehensive FluxStackConfig
|
|
17
|
-
- Implement JSON schema validation for configuration
|
|
18
|
-
- Create configuration loader with environment variable support
|
|
19
|
-
- _Requirements: 9.1, 9.2, 9.3_
|
|
20
|
-
|
|
21
|
-
- [x] 1.2 Implement Configuration Validation System
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
- Create configuration validator with detailed error reporting
|
|
25
|
-
- Implement environment-specific configuration merging
|
|
26
|
-
- Add configuration precedence handling (env vars > config file > defaults)
|
|
27
|
-
- _Requirements: 9.1, 9.4, 9.5_
|
|
28
|
-
|
|
29
|
-
- [x] 1.3 Move and Update Main Configuration File
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
- Move fluxstack.config.ts from config/ to root directory
|
|
33
|
-
- Update all imports and references to new configuration location
|
|
34
|
-
- Implement backward compatibility for existing configuration structure
|
|
35
|
-
- _Requirements: 1.1, 1.2, 9.1_
|
|
36
|
-
|
|
37
|
-
- [x] 2. Core Framework Restructuring
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
- Reorganize core/ directory structure according to new design
|
|
43
|
-
- Create new framework class with enhanced plugin system
|
|
44
|
-
- Implement modular core utilities (logger, errors, monitoring)
|
|
45
|
-
- _Requirements: 1.1, 1.2, 1.3, 5.1, 5.2_
|
|
46
|
-
|
|
47
|
-
- [x] 2.1 Reorganize Core Directory Structure
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
- Create new directory structure: framework/, plugins/, build/, cli/, config/, utils/, types/
|
|
51
|
-
- Move existing files to appropriate new locations
|
|
52
|
-
- Update all import paths throughout the codebase
|
|
53
|
-
- _Requirements: 1.1, 1.2, 1.3_
|
|
54
|
-
|
|
55
|
-
- [x] 2.2 Create Enhanced Framework Class
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
- Refactor FluxStackFramework class with new plugin system integration
|
|
59
|
-
- Implement lifecycle hooks for plugins (onServerStart, onServerStop, etc.)
|
|
60
|
-
- Add configuration injection and validation to framework initialization
|
|
61
|
-
- _Requirements: 5.1, 5.2, 5.3_
|
|
62
|
-
|
|
63
|
-
- [x] 2.3 Implement Core Types System
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
- Create comprehensive TypeScript types for all core interfaces
|
|
67
|
-
- Implement plugin types with lifecycle hooks and configuration schemas
|
|
68
|
-
- Add build system types and configuration interfaces
|
|
69
|
-
- _Requirements: 1.4, 5.4, 2.1_
|
|
70
|
-
|
|
71
|
-
- [x] 3. Enhanced Plugin System Implementation
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
- Create plugin registry with dependency management and load ordering
|
|
76
|
-
- Implement enhanced plugin interface with lifecycle hooks
|
|
77
|
-
- Refactor existing plugins to use new plugin system
|
|
78
|
-
- _Requirements: 5.1, 5.2, 5.3, 5.4, 5.5_
|
|
79
|
-
|
|
80
|
-
- [x] 3.1 Create Plugin Registry System
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
- Implement PluginRegistry class with registration, dependency validation, and load ordering
|
|
84
|
-
- Create plugin discovery mechanism for built-in and external plugins
|
|
85
|
-
- Add plugin configuration management and validation
|
|
86
|
-
- _Requirements: 5.1, 5.3, 5.5_
|
|
87
|
-
|
|
88
|
-
- [x] 3.2 Implement Enhanced Plugin Interface
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
- Create comprehensive Plugin interface with all lifecycle hooks
|
|
92
|
-
- Implement PluginContext with access to config, logger, app, and utilities
|
|
93
|
-
- Add plugin priority system and dependency resolution
|
|
94
|
-
- _Requirements: 5.1, 5.2, 5.4_
|
|
95
|
-
|
|
96
|
-
- [x] 3.3 Refactor Built-in Plugins
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
- Update logger plugin to use new plugin interface and enhanced logging system
|
|
100
|
-
- Refactor swagger plugin with new configuration and lifecycle hooks
|
|
101
|
-
- Update vite plugin with improved integration and error handling
|
|
102
|
-
- _Requirements: 5.1, 5.2, 3.1_
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
- [x] 3.4 Create Monitoring Plugin
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
- Implement performance monitoring plugin with metrics collection
|
|
112
|
-
- Add HTTP request/response timing and system metrics
|
|
113
|
-
- Create metrics exporters for Prometheus and other monitoring systems
|
|
114
|
-
- _Requirements: 7.1, 7.2, 7.3, 7.4, 7.5_
|
|
115
|
-
|
|
116
|
-
- [ ] 4. Enhanced Logging System
|
|
117
|
-
- Create structured logging system with multiple transports and formatters
|
|
118
|
-
- Implement contextual logging with request correlation
|
|
119
|
-
- Add performance logging with timing utilities
|
|
120
|
-
- _Requirements: 3.1, 3.2, 3.3, 3.4, 3.5_
|
|
121
|
-
|
|
122
|
-
- [ ] 4.1 Create Core Logging Infrastructure
|
|
123
|
-
- Implement FluxStackLogger class with multiple transport support
|
|
124
|
-
- Create log formatters for development (pretty) and production (JSON)
|
|
125
|
-
- Add log level filtering and contextual logging capabilities
|
|
126
|
-
- _Requirements: 3.1, 3.2, 3.4_
|
|
127
|
-
|
|
128
|
-
- [ ] 4.2 Implement Log Transports
|
|
129
|
-
- Create console transport with colored output for development
|
|
130
|
-
- Implement file transport with rotation and compression
|
|
131
|
-
- Add structured JSON transport for production logging
|
|
132
|
-
- _Requirements: 3.1, 3.4, 3.5_
|
|
133
|
-
|
|
134
|
-
- [ ] 4.3 Add Performance and Request Logging
|
|
135
|
-
- Implement request correlation IDs and contextual logging
|
|
136
|
-
- Create timing utilities for performance measurement
|
|
137
|
-
- Add automatic request/response logging with duration tracking
|
|
138
|
-
- _Requirements: 3.2, 3.3, 7.2_
|
|
139
|
-
|
|
140
|
-
- [ ] 5. Unified Error Handling System
|
|
141
|
-
- Create comprehensive error classes with codes and context
|
|
142
|
-
- Implement error handler middleware with consistent formatting
|
|
143
|
-
- Add error recovery strategies and user-friendly messaging
|
|
144
|
-
- _Requirements: 4.1, 4.2, 4.3, 4.4, 4.5_
|
|
145
|
-
|
|
146
|
-
- [ ] 5.1 Create Error Class Hierarchy
|
|
147
|
-
- Implement FluxStackError base class with code, statusCode, and context
|
|
148
|
-
- Create specific error classes (ValidationError, NotFoundError, etc.)
|
|
149
|
-
- Add error serialization for consistent API responses
|
|
150
|
-
- _Requirements: 4.1, 4.2, 4.3_
|
|
151
|
-
|
|
152
|
-
- [ ] 5.2 Implement Error Handler Middleware
|
|
153
|
-
- Create centralized error handler with logging and metrics integration
|
|
154
|
-
- Implement error context preservation and stack trace handling
|
|
155
|
-
- Add user-friendly error message generation
|
|
156
|
-
- _Requirements: 4.1, 4.2, 4.5_
|
|
157
|
-
|
|
158
|
-
- [ ] 5.3 Add Client-Side Error Handling
|
|
159
|
-
- Update Eden Treaty client with consistent error handling
|
|
160
|
-
- Implement error recovery strategies (retry, fallback)
|
|
161
|
-
- Create user-friendly error message utilities
|
|
162
|
-
- _Requirements: 4.2, 4.4, 4.5_
|
|
163
|
-
|
|
164
|
-
- [ ] 6. Build System Optimization
|
|
165
|
-
- Create modular build system with bundler, optimizer, and target support
|
|
166
|
-
- Implement incremental builds and caching
|
|
167
|
-
- Add build performance monitoring and optimization
|
|
168
|
-
- _Requirements: 2.1, 2.2, 2.3, 2.4, 2.5_
|
|
169
|
-
|
|
170
|
-
- [ ] 6.1 Create Enhanced Builder Class
|
|
171
|
-
- Implement FluxStackBuilder with modular architecture (bundler, optimizer)
|
|
172
|
-
- Add build validation, cleaning, and manifest generation
|
|
173
|
-
- Create build result reporting with timing and metrics
|
|
174
|
-
- _Requirements: 2.1, 2.2, 2.3_
|
|
175
|
-
|
|
176
|
-
- [ ] 6.2 Implement Build Optimization
|
|
177
|
-
- Create Optimizer class with minification, tree-shaking, and compression
|
|
178
|
-
- Add bundle analysis and size optimization
|
|
179
|
-
- Implement code splitting and chunk optimization
|
|
180
|
-
- _Requirements: 2.3, 2.4, 2.5_
|
|
181
|
-
|
|
182
|
-
- [ ] 6.3 Add Build Targets Support
|
|
183
|
-
- Implement different build targets (bun, node, docker)
|
|
184
|
-
- Create target-specific optimizations and configurations
|
|
185
|
-
- Add build manifest generation for deployment
|
|
186
|
-
- _Requirements: 2.1, 2.5_
|
|
187
|
-
|
|
188
|
-
- [ ] 7. CLI Enhancement and Code Generation
|
|
189
|
-
- Enhance CLI with better help, validation, and error handling
|
|
190
|
-
- Add code generation commands for common patterns
|
|
191
|
-
- Implement deployment helpers and project analysis tools
|
|
192
|
-
- _Requirements: 6.1, 6.2, 6.3, 6.4, 10.1, 10.2, 10.3_
|
|
193
|
-
|
|
194
|
-
- [ ] 7.1 Enhance Core CLI Infrastructure
|
|
195
|
-
- Improve CLI command structure with better help and validation
|
|
196
|
-
- Add command parameter validation and error handling
|
|
197
|
-
- Implement progress reporting and user feedback
|
|
198
|
-
- _Requirements: 6.1, 6.4, 6.5_
|
|
199
|
-
|
|
200
|
-
- [ ] 7.2 Create Code Generation System
|
|
201
|
-
- Implement generators for controllers, routes, components, and services
|
|
202
|
-
- Create template system for code generation
|
|
203
|
-
- Add interactive prompts for generator configuration
|
|
204
|
-
- _Requirements: 10.1, 10.4_
|
|
205
|
-
|
|
206
|
-
- [ ] 7.3 Add Development Tools
|
|
207
|
-
- Create project analysis tools (bundle size, dependencies)
|
|
208
|
-
- Implement deployment helpers for different platforms
|
|
209
|
-
- Add migration scripts for version updates
|
|
210
|
-
- _Requirements: 10.2, 10.3, 10.4_
|
|
211
|
-
|
|
212
|
-
- [ ] 8. State Management Integration
|
|
213
|
-
- Create integrated state management solution for frontend
|
|
214
|
-
- Implement React hooks and utilities for state access
|
|
215
|
-
- Add persistence and middleware support
|
|
216
|
-
- _Requirements: 8.1, 8.2, 8.3, 8.4, 8.5_
|
|
217
|
-
|
|
218
|
-
- [ ] 8.1 Create Core State Management System
|
|
219
|
-
- Implement FluxStackStore class with type-safe state management
|
|
220
|
-
- Create state slices pattern for modular state organization
|
|
221
|
-
- Add middleware support for logging, persistence, and async actions
|
|
222
|
-
- _Requirements: 8.1, 8.2, 8.4_
|
|
223
|
-
|
|
224
|
-
- [ ] 8.2 Implement React Integration
|
|
225
|
-
- Create React hooks (useAppStore, useAppSelector) for state access
|
|
226
|
-
- Implement context provider for store access
|
|
227
|
-
- Add React DevTools integration for debugging
|
|
228
|
-
- _Requirements: 8.1, 8.2, 8.5_
|
|
229
|
-
|
|
230
|
-
- [ ] 8.3 Add State Persistence
|
|
231
|
-
- Implement localStorage and sessionStorage persistence
|
|
232
|
-
- Create selective persistence with whitelist/blacklist
|
|
233
|
-
- Add state hydration and serialization utilities
|
|
234
|
-
- _Requirements: 8.4_
|
|
235
|
-
|
|
236
|
-
- [ ] 9. Performance Monitoring Implementation
|
|
237
|
-
- Create metrics collection system with HTTP and system metrics
|
|
238
|
-
- Implement performance profiling and monitoring
|
|
239
|
-
- Add metrics exporters for external monitoring systems
|
|
240
|
-
- _Requirements: 7.1, 7.2, 7.3, 7.4, 7.5_
|
|
241
|
-
|
|
242
|
-
- [ ] 9.1 Create Metrics Collection System
|
|
243
|
-
- Implement MetricsCollector class with HTTP, system, and custom metrics
|
|
244
|
-
- Add automatic metrics collection for requests, responses, and system resources
|
|
245
|
-
- Create metrics registry for custom application metrics
|
|
246
|
-
- _Requirements: 7.1, 7.2, 7.3_
|
|
247
|
-
|
|
248
|
-
- [ ] 9.2 Implement Performance Profiling
|
|
249
|
-
- Create performance profiler for identifying bottlenecks
|
|
250
|
-
- Add request tracing and timing analysis
|
|
251
|
-
- Implement memory usage monitoring and leak detection
|
|
252
|
-
- _Requirements: 7.2, 7.3_
|
|
253
|
-
|
|
254
|
-
- [ ] 9.3 Add Metrics Export System
|
|
255
|
-
- Create metrics exporters for Prometheus, DataDog, and other systems
|
|
256
|
-
- Implement basic metrics dashboard for development
|
|
257
|
-
- Add alerting capabilities for performance issues
|
|
258
|
-
- _Requirements: 7.4, 7.5_
|
|
259
|
-
|
|
260
|
-
- [ ] 10. Application Structure Improvements
|
|
261
|
-
- Reorganize app/ directory with better separation of concerns
|
|
262
|
-
- Create service layer and improved controller structure
|
|
263
|
-
- Add middleware organization and custom middleware support
|
|
264
|
-
- _Requirements: 1.1, 1.2, 1.3, 1.4_
|
|
265
|
-
|
|
266
|
-
- [ ] 10.1 Reorganize App Directory Structure
|
|
267
|
-
- Create new app structure with controllers/, services/, middleware/, models/
|
|
268
|
-
- Move existing code to appropriate new locations
|
|
269
|
-
- Update imports and references throughout the application
|
|
270
|
-
- _Requirements: 1.1, 1.2, 1.3_
|
|
271
|
-
|
|
272
|
-
- [ ] 10.2 Implement Service Layer Pattern
|
|
273
|
-
- Create service classes for business logic separation
|
|
274
|
-
- Refactor controllers to use services for business operations
|
|
275
|
-
- Add dependency injection pattern for service management
|
|
276
|
-
- _Requirements: 1.2, 1.3_
|
|
277
|
-
|
|
278
|
-
- [ ] 10.3 Enhance Frontend Structure
|
|
279
|
-
- Create organized component structure with pages/, hooks/, store/
|
|
280
|
-
- Implement proper state management integration
|
|
281
|
-
- Add improved API client with error handling
|
|
282
|
-
- _Requirements: 1.1, 1.2, 8.1, 8.2_
|
|
283
|
-
|
|
284
|
-
- [ ] 11. Testing Infrastructure Updates
|
|
285
|
-
- Update test utilities for new architecture
|
|
286
|
-
- Create comprehensive test fixtures and mocks
|
|
287
|
-
- Add performance and integration testing capabilities
|
|
288
|
-
- _Requirements: All requirements need updated tests_
|
|
289
|
-
|
|
290
|
-
- [ ] 11.1 Update Test Infrastructure
|
|
291
|
-
- Create FluxStackTestUtils with new architecture support
|
|
292
|
-
- Update test fixtures for new configuration and plugin systems
|
|
293
|
-
- Implement test database and state management utilities
|
|
294
|
-
- _Requirements: All requirements_
|
|
295
|
-
|
|
296
|
-
- [ ] 11.2 Create Comprehensive Test Suite
|
|
297
|
-
- Write unit tests for all new core components
|
|
298
|
-
- Create integration tests for plugin system and configuration
|
|
299
|
-
- Add performance tests for build system and runtime
|
|
300
|
-
- _Requirements: All requirements_
|
|
301
|
-
|
|
302
|
-
- [ ] 11.3 Add E2E Testing Capabilities
|
|
303
|
-
- Implement end-to-end testing for complete user workflows
|
|
304
|
-
- Create test scenarios for development and production modes
|
|
305
|
-
- Add automated testing for CLI commands and code generation
|
|
306
|
-
- _Requirements: 6.1, 6.2, 10.1, 10.2_
|
|
307
|
-
|
|
308
|
-
- [ ] 12. Documentation and Migration
|
|
309
|
-
- Create comprehensive documentation for new architecture
|
|
310
|
-
- Write migration guides for existing projects
|
|
311
|
-
- Add examples and best practices documentation
|
|
312
|
-
- _Requirements: All requirements need documentation_
|
|
313
|
-
|
|
314
|
-
- [ ] 12.1 Create Architecture Documentation
|
|
315
|
-
- Document new directory structure and organization principles
|
|
316
|
-
- Create plugin development guide with examples
|
|
317
|
-
- Write configuration reference and best practices
|
|
318
|
-
- _Requirements: 1.1, 1.2, 5.1, 5.2, 9.1_
|
|
319
|
-
|
|
320
|
-
- [ ] 12.2 Write Migration Guide
|
|
321
|
-
- Create step-by-step migration guide for existing projects
|
|
322
|
-
- Implement automated migration scripts where possible
|
|
323
|
-
- Document breaking changes and compatibility considerations
|
|
324
|
-
- _Requirements: All requirements_
|
|
325
|
-
|
|
326
|
-
- [ ] 12.3 Add Examples and Best Practices
|
|
327
|
-
- Create example projects showcasing new features
|
|
328
|
-
- Write best practices guide for different use cases
|
|
329
|
-
- Add troubleshooting guide for common issues
|
|
330
|
-
- _Requirements: All requirements_
|
package/CLAUDE.md
DELETED
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
# 🤖 FluxStack - AI Context Documentation
|
|
2
|
-
|
|
3
|
-
> **IMPORTANTE**: Esta documentação foi **reorganizada e modernizada** para melhor suporte a LLMs.
|
|
4
|
-
|
|
5
|
-
## 📖 **Nova Documentação AI**
|
|
6
|
-
|
|
7
|
-
👉 **Acesse a documentação completa em**: [`ai-context/`](./ai-context/)
|
|
8
|
-
|
|
9
|
-
### ⚡ **Início Rápido para LLMs**
|
|
10
|
-
- **[`ai-context/00-QUICK-START.md`](./ai-context/00-QUICK-START.md)** - Entenda tudo em 2 minutos
|
|
11
|
-
- **[`ai-context/README.md`](./ai-context/README.md)** - Navegação completa
|
|
12
|
-
|
|
13
|
-
### 🎯 **Documentos Principais**
|
|
14
|
-
- **[Development Patterns](./ai-context/development/patterns.md)** - Padrões e boas práticas
|
|
15
|
-
- **[Eden Treaty Guide](./ai-context/development/eden-treaty-guide.md)** - Guia completo Eden Treaty
|
|
16
|
-
- **[CRUD Example](./ai-context/examples/crud-complete.md)** - Exemplo prático completo
|
|
17
|
-
- **[Troubleshooting](./ai-context/reference/troubleshooting.md)** - Solução de problemas
|
|
18
|
-
|
|
19
|
-
### 🔥 **Mudanças Recentes**
|
|
20
|
-
- **[Eden Treaty Refactor](./ai-context/recent-changes/eden-treaty-refactor.md)** - Refatoração crítica
|
|
21
|
-
- **[Type Inference Fix](./ai-context/recent-changes/type-inference-fix.md)** - Correção de tipos
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
## 🚀 **FluxStack - Overview Atualizado**
|
|
26
|
-
|
|
27
|
-
**FluxStack** é um framework full-stack TypeScript moderno que combina:
|
|
28
|
-
|
|
29
|
-
### 🛠️ **Stack Tecnológica (Janeiro 2025)**
|
|
30
|
-
- **Runtime**: Bun 1.2.20 (3x mais rápido que Node.js)
|
|
31
|
-
- **Backend**: Elysia.js 1.4.6 (ultra-performático)
|
|
32
|
-
- **Frontend**: React 19.1.0 + Vite 7.0.4
|
|
33
|
-
- **Language**: TypeScript 5.9.2 (100% type-safe)
|
|
34
|
-
- **Communication**: Eden Treaty com inferência automática
|
|
35
|
-
- **Docs**: Swagger UI gerado automaticamente
|
|
36
|
-
- **Testing**: Vitest + React Testing Library
|
|
37
|
-
- **Deploy**: Docker otimizado
|
|
38
|
-
|
|
39
|
-
### ✨ **Estado Atual (Validado)**
|
|
40
|
-
- **✅ Eden Treaty Nativo**: Type inference automática funcionando perfeitamente
|
|
41
|
-
- **✅ Zero Tipos Unknown**: Inferência corrigida após refatoração
|
|
42
|
-
- **✅ Monorepo Unificado**: Uma instalação, hot reload independente
|
|
43
|
-
- **✅ APIs Funcionando**: Health check e CRUD operacionais
|
|
44
|
-
- **✅ Frontend Ativo**: React 19 + Vite rodando na porta 5173
|
|
45
|
-
- **✅ Backend Ativo**: Elysia + Bun rodando na porta 3000
|
|
46
|
-
|
|
47
|
-
## 📁 **Arquitetura Atual Validada**
|
|
48
|
-
|
|
49
|
-
```
|
|
50
|
-
FluxStack/
|
|
51
|
-
├── core/ # 🔒 FRAMEWORK (read-only)
|
|
52
|
-
│ ├── server/ # Framework Elysia + plugins
|
|
53
|
-
│ ├── config/ # Sistema de configuração
|
|
54
|
-
│ ├── types/ # Types do framework
|
|
55
|
-
│ └── build/ # Sistema de build
|
|
56
|
-
├── app/ # 👨💻 CÓDIGO DA APLICAÇÃO
|
|
57
|
-
│ ├── server/ # Backend (controllers, routes)
|
|
58
|
-
│ │ ├── controllers/ # Lógica de negócio
|
|
59
|
-
│ │ ├── routes/ # Endpoints da API
|
|
60
|
-
│ │ └── app.ts # Export do tipo para Eden Treaty
|
|
61
|
-
│ ├── client/ # Frontend (React + Vite)
|
|
62
|
-
│ │ ├── src/components/ # Componentes React
|
|
63
|
-
│ │ ├── src/lib/ # Cliente Eden Treaty
|
|
64
|
-
│ │ └── src/App.tsx # Interface principal
|
|
65
|
-
│ └── shared/ # Types compartilhados
|
|
66
|
-
├── tests/ # Testes do framework
|
|
67
|
-
├── docs/ # Documentação técnica
|
|
68
|
-
└── ai-context/ # 📖 Esta documentação reorganizada
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
## 🔄 **Estado Atual da Interface**
|
|
72
|
-
|
|
73
|
-
### **Frontend Redesignado (App.tsx)**
|
|
74
|
-
- **Interface em abas integradas**: Demo interativo, API Docs, Tests
|
|
75
|
-
- **Demo CRUD**: Usuários usando Eden Treaty nativo
|
|
76
|
-
- **Swagger UI**: Documentação automática integrada
|
|
77
|
-
- **Type Safety**: Eden Treaty com inferência automática
|
|
78
|
-
|
|
79
|
-
### **Backend Robusto (Elysia + Bun)**
|
|
80
|
-
- **API RESTful**: Endpoints CRUD completos
|
|
81
|
-
- **Response Schemas**: Documentação automática via TypeBox
|
|
82
|
-
- **Error Handling**: Tratamento consistente de erros
|
|
83
|
-
- **Hot Reload**: Recarregamento automático
|
|
84
|
-
|
|
85
|
-
## 🎯 **Funcionalidades Implementadas (Validadas)**
|
|
86
|
-
|
|
87
|
-
### ✅ **1. Type Safety End-to-End**
|
|
88
|
-
```typescript
|
|
89
|
-
// ✅ Eden Treaty infere automaticamente após refatoração
|
|
90
|
-
const { data: user, error } = await api.users.post({
|
|
91
|
-
name: "João",
|
|
92
|
-
email: "joao@example.com"
|
|
93
|
-
})
|
|
94
|
-
|
|
95
|
-
// TypeScript sabe que:
|
|
96
|
-
// - user: UserResponse = { success: boolean; user?: User; message?: string }
|
|
97
|
-
// - error: undefined (em caso de sucesso)
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
### ✅ **2. Hot Reload Independente**
|
|
101
|
-
```bash
|
|
102
|
-
bun run dev # ✅ Backend (3000) + Frontend (5173)
|
|
103
|
-
bun run dev:clean # ✅ Output limpo (sem logs HEAD do Elysia)
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
### ✅ **3. APIs Funcionais**
|
|
107
|
-
- **Health Check**: `GET /api/health` ✅
|
|
108
|
-
- **Users CRUD**: `GET|POST|PUT|DELETE /api/users` ✅
|
|
109
|
-
- **Swagger Docs**: `GET /swagger` ✅
|
|
110
|
-
|
|
111
|
-
### ✅ **4. Environment Variables Dinâmicas**
|
|
112
|
-
- **Sistema robusto**: Precedência clara
|
|
113
|
-
- **Testing endpoint**: `/api/env-test`
|
|
114
|
-
- **Validação automática**: Environment vars
|
|
115
|
-
|
|
116
|
-
## 🚨 **Regras Críticas (Atualizadas)**
|
|
117
|
-
|
|
118
|
-
### ❌ **NUNCA FAZER**
|
|
119
|
-
- Editar arquivos em `core/` (framework read-only)
|
|
120
|
-
- ~~Usar `apiCall()` wrapper~~ ✅ **REMOVIDO** - quebrava type inference
|
|
121
|
-
- Criar types manuais para Eden Treaty
|
|
122
|
-
- Ignorar response schemas nas rotas
|
|
123
|
-
|
|
124
|
-
### ✅ **SEMPRE FAZER**
|
|
125
|
-
- Trabalhar em `app/` (código da aplicação)
|
|
126
|
-
- **Usar Eden Treaty nativo**: `const { data, error } = await api.users.get()`
|
|
127
|
-
- Manter types compartilhados em `app/shared/`
|
|
128
|
-
- Definir response schemas para documentação automática
|
|
129
|
-
- Testar com `bun run dev`
|
|
130
|
-
|
|
131
|
-
## 🔧 **Comandos Validados**
|
|
132
|
-
|
|
133
|
-
```bash
|
|
134
|
-
# Desenvolvimento
|
|
135
|
-
bun run dev # ✅ Full-stack (recomendado)
|
|
136
|
-
bun run dev:clean # ✅ Output limpo
|
|
137
|
-
bun run dev:backend # ✅ Backend apenas (porta 3001)
|
|
138
|
-
bun run dev:frontend # ✅ Frontend apenas (porta 5173)
|
|
139
|
-
|
|
140
|
-
# Build e produção
|
|
141
|
-
bun run build # ✅ Build completo
|
|
142
|
-
bun run start # ✅ Servidor de produção
|
|
143
|
-
|
|
144
|
-
# Testes e validação
|
|
145
|
-
bun run test # ✅ Suite de testes
|
|
146
|
-
bunx tsc --noEmit # ✅ Verificação TypeScript
|
|
147
|
-
curl http://localhost:3000/api/health # ✅ Health check
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
## 📊 **URLs de Acesso (Validadas)**
|
|
151
|
-
|
|
152
|
-
- **🚀 Backend API**: http://localhost:3000
|
|
153
|
-
- **⚛️ Frontend React**: http://localhost:5173
|
|
154
|
-
- **📋 Swagger Docs**: http://localhost:3000/swagger
|
|
155
|
-
- **🩺 Health Check**: http://localhost:3000/api/health
|
|
156
|
-
- **👥 Users API**: http://localhost:3000/api/users
|
|
157
|
-
|
|
158
|
-
## 🔥 **Mudanças Importantes v1.4→v1.5**
|
|
159
|
-
|
|
160
|
-
### **✅ Eden Treaty Refatoração (Setembro 2025)**
|
|
161
|
-
- **Problema resolvido**: Wrapper `apiCall()` quebrava type inference
|
|
162
|
-
- **Solução implementada**: Eden Treaty nativo preserva tipos automáticos
|
|
163
|
-
- **Resultado**: Zero tipos `unknown`, autocomplete perfeito
|
|
164
|
-
|
|
165
|
-
### **✅ Response Schemas Implementados**
|
|
166
|
-
- **Todas as rotas**: Schemas TypeBox para inferência
|
|
167
|
-
- **Documentação automática**: Swagger UI atualizado
|
|
168
|
-
- **Type inference**: Eden Treaty funcionando 100%
|
|
169
|
-
|
|
170
|
-
### **✅ Monorepo Estabilizado**
|
|
171
|
-
- **Uma instalação**: `bun install` para todo o projeto
|
|
172
|
-
- **Hot reload independente**: Backend e frontend separados
|
|
173
|
-
- **Build otimizado**: Sistema unificado
|
|
174
|
-
|
|
175
|
-
## 🎯 **Próximos Passos Sugeridos**
|
|
176
|
-
|
|
177
|
-
### **Funcionalidades Pendentes**
|
|
178
|
-
1. **Database integration** - ORM nativo
|
|
179
|
-
2. **Authentication system** - Auth built-in
|
|
180
|
-
3. **Real-time features** - WebSockets/SSE
|
|
181
|
-
4. **API versioning** - Versionamento automático
|
|
182
|
-
|
|
183
|
-
### **Melhorias Técnicas**
|
|
184
|
-
- Middleware de validação avançado
|
|
185
|
-
- Cache de responses
|
|
186
|
-
- Bundle size optimization
|
|
187
|
-
- Monitoring e métricas
|
|
188
|
-
|
|
189
|
-
## 🆘 **Suporte e Troubleshooting**
|
|
190
|
-
|
|
191
|
-
1. **Erro específico?** → [`ai-context/reference/troubleshooting.md`](./ai-context/reference/troubleshooting.md)
|
|
192
|
-
2. **Como fazer X?** → [`ai-context/development/patterns.md`](./ai-context/development/patterns.md)
|
|
193
|
-
3. **Eden Treaty?** → [`ai-context/development/eden-treaty-guide.md`](./ai-context/development/eden-treaty-guide.md)
|
|
194
|
-
4. **Não entendo nada?** → [`ai-context/00-QUICK-START.md`](./ai-context/00-QUICK-START.md)
|
|
195
|
-
|
|
196
|
-
---
|
|
197
|
-
|
|
198
|
-
**🎯 Objetivo**: Capacitar LLMs a trabalhar eficientemente com FluxStack, seguindo padrões estabelecidos e garantindo código de alta qualidade com type safety automática.
|
|
199
|
-
|
|
200
|
-
**📅 Última atualização**: Janeiro 2025 - Documentação completamente reorganizada e validada.
|