@friggframework/devtools 2.0.0--canary.517.179491e.0 → 2.0.0--canary.522.893db5d.0
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/frigg-cli/README.md +1 -1
- package/frigg-cli/__tests__/application/use-cases/AddApiModuleToIntegrationUseCase.test.js +326 -0
- package/frigg-cli/__tests__/application/use-cases/CreateApiModuleUseCase.test.js +337 -0
- package/frigg-cli/__tests__/domain/entities/ApiModule.test.js +373 -0
- package/frigg-cli/__tests__/domain/entities/AppDefinition.test.js +313 -0
- package/frigg-cli/__tests__/domain/services/IntegrationValidator.test.js +269 -0
- package/frigg-cli/__tests__/domain/value-objects/IntegrationName.test.js +82 -0
- package/frigg-cli/__tests__/infrastructure/adapters/IntegrationJsUpdater.test.js +408 -0
- package/frigg-cli/__tests__/infrastructure/repositories/FileSystemApiModuleRepository.test.js +583 -0
- package/frigg-cli/__tests__/infrastructure/repositories/FileSystemAppDefinitionRepository.test.js +314 -0
- package/frigg-cli/__tests__/infrastructure/repositories/FileSystemIntegrationRepository.test.js +383 -0
- package/frigg-cli/__tests__/unit/commands/doctor.test.js +0 -2
- package/frigg-cli/__tests__/unit/commands/init.test.js +406 -0
- package/frigg-cli/__tests__/unit/commands/install.test.js +23 -19
- package/frigg-cli/__tests__/unit/commands/repair.test.js +275 -0
- package/frigg-cli/__tests__/unit/dependencies.test.js +2 -2
- package/frigg-cli/__tests__/unit/start-command/application/RunPreflightChecksUseCase.test.js +411 -0
- package/frigg-cli/__tests__/unit/start-command/infrastructure/DatabaseAdapter.test.js +405 -0
- package/frigg-cli/__tests__/unit/start-command/infrastructure/DockerAdapter.test.js +496 -0
- package/frigg-cli/__tests__/unit/start-command/presentation/InteractivePromptAdapter.test.js +474 -0
- package/frigg-cli/__tests__/unit/utils/output.test.js +196 -0
- package/frigg-cli/application/use-cases/AddApiModuleToIntegrationUseCase.js +93 -0
- package/frigg-cli/application/use-cases/CreateApiModuleUseCase.js +93 -0
- package/frigg-cli/application/use-cases/CreateIntegrationUseCase.js +103 -0
- package/frigg-cli/container.js +172 -0
- package/frigg-cli/docs/OUTPUT_MIGRATION_GUIDE.md +286 -0
- package/frigg-cli/doctor-command/index.js +17 -16
- package/frigg-cli/domain/entities/ApiModule.js +272 -0
- package/frigg-cli/domain/entities/AppDefinition.js +227 -0
- package/frigg-cli/domain/entities/Integration.js +198 -0
- package/frigg-cli/domain/exceptions/DomainException.js +24 -0
- package/frigg-cli/domain/ports/IApiModuleRepository.js +53 -0
- package/frigg-cli/domain/ports/IAppDefinitionRepository.js +43 -0
- package/frigg-cli/domain/ports/IIntegrationRepository.js +61 -0
- package/frigg-cli/domain/services/IntegrationValidator.js +185 -0
- package/frigg-cli/domain/value-objects/IntegrationId.js +42 -0
- package/frigg-cli/domain/value-objects/IntegrationName.js +60 -0
- package/frigg-cli/domain/value-objects/SemanticVersion.js +70 -0
- package/frigg-cli/index.js +21 -6
- package/frigg-cli/index.test.js +7 -2
- package/frigg-cli/infrastructure/UnitOfWork.js +46 -0
- package/frigg-cli/infrastructure/adapters/BackendJsUpdater.js +197 -0
- package/frigg-cli/infrastructure/adapters/FileSystemAdapter.js +224 -0
- package/frigg-cli/infrastructure/adapters/IntegrationJsUpdater.js +249 -0
- package/frigg-cli/infrastructure/adapters/SchemaValidator.js +92 -0
- package/frigg-cli/infrastructure/repositories/FileSystemApiModuleRepository.js +373 -0
- package/frigg-cli/infrastructure/repositories/FileSystemAppDefinitionRepository.js +116 -0
- package/frigg-cli/infrastructure/repositories/FileSystemIntegrationRepository.js +277 -0
- package/frigg-cli/init-command/backend-first-handler.js +124 -42
- package/frigg-cli/init-command/index.js +2 -1
- package/frigg-cli/init-command/template-handler.js +13 -3
- package/frigg-cli/install-command/backend-js.js +3 -3
- package/frigg-cli/install-command/environment-variables.js +16 -19
- package/frigg-cli/install-command/environment-variables.test.js +12 -13
- package/frigg-cli/install-command/index.js +14 -9
- package/frigg-cli/install-command/integration-file.js +3 -3
- package/frigg-cli/install-command/validate-package.js +5 -9
- package/frigg-cli/jest.config.js +4 -1
- package/frigg-cli/package-lock.json +16226 -0
- package/frigg-cli/repair-command/index.js +101 -128
- package/frigg-cli/start-command/application/RunPreflightChecksUseCase.js +376 -0
- package/frigg-cli/start-command/index.js +246 -2
- package/frigg-cli/start-command/infrastructure/DatabaseAdapter.js +591 -0
- package/frigg-cli/start-command/infrastructure/DockerAdapter.js +306 -0
- package/frigg-cli/start-command/presentation/InteractivePromptAdapter.js +329 -0
- package/frigg-cli/templates/backend/.env.example +62 -0
- package/frigg-cli/templates/backend/.eslintrc.json +12 -0
- package/frigg-cli/templates/backend/.prettierrc +6 -0
- package/frigg-cli/templates/backend/docker-compose.yml +22 -0
- package/frigg-cli/templates/backend/index.js +96 -0
- package/frigg-cli/templates/backend/infrastructure.js +12 -0
- package/frigg-cli/templates/backend/jest.config.js +17 -0
- package/frigg-cli/templates/backend/package.json +50 -0
- package/frigg-cli/templates/backend/src/api-modules/.gitkeep +10 -0
- package/frigg-cli/templates/backend/src/base/.gitkeep +7 -0
- package/frigg-cli/templates/backend/src/integrations/.gitkeep +10 -0
- package/frigg-cli/templates/backend/src/integrations/ExampleIntegration.js +65 -0
- package/frigg-cli/templates/backend/src/utils/.gitkeep +7 -0
- package/frigg-cli/templates/backend/test/setup.js +30 -0
- package/frigg-cli/templates/backend/ui-extensions/.gitkeep +0 -0
- package/frigg-cli/templates/backend/ui-extensions/README.md +77 -0
- package/frigg-cli/ui-command/index.js +58 -36
- package/frigg-cli/utils/__tests__/repo-detection.test.js +436 -0
- package/frigg-cli/utils/output.js +382 -0
- package/frigg-cli/utils/repo-detection.js +85 -37
- package/frigg-cli/validate-command/__tests__/adapters/validate-command.test.js +205 -0
- package/frigg-cli/validate-command/__tests__/application/validate-app-use-case.test.js +104 -0
- package/frigg-cli/validate-command/__tests__/domain/fix-suggestion.test.js +153 -0
- package/frigg-cli/validate-command/__tests__/domain/validation-error.test.js +162 -0
- package/frigg-cli/validate-command/__tests__/domain/validation-result.test.js +152 -0
- package/frigg-cli/validate-command/__tests__/infrastructure/api-module-validator.test.js +332 -0
- package/frigg-cli/validate-command/__tests__/infrastructure/app-definition-validator.test.js +191 -0
- package/frigg-cli/validate-command/__tests__/infrastructure/integration-class-validator.test.js +146 -0
- package/frigg-cli/validate-command/__tests__/infrastructure/template-validation.test.js +155 -0
- package/frigg-cli/validate-command/adapters/cli/validate-command.js +199 -0
- package/frigg-cli/validate-command/application/use-cases/validate-app-use-case.js +35 -0
- package/frigg-cli/validate-command/domain/entities/validation-result.js +74 -0
- package/frigg-cli/validate-command/domain/value-objects/fix-suggestion.js +74 -0
- package/frigg-cli/validate-command/domain/value-objects/validation-error.js +68 -0
- package/frigg-cli/validate-command/infrastructure/validators/api-module-validator.js +181 -0
- package/frigg-cli/validate-command/infrastructure/validators/app-definition-validator.js +128 -0
- package/frigg-cli/validate-command/infrastructure/validators/integration-class-validator.js +113 -0
- package/infrastructure/docs/iam-policy-templates.md +1 -1
- package/infrastructure/domains/networking/vpc-builder.test.js +2 -4
- package/infrastructure/domains/networking/vpc-resolver.test.js +1 -1
- package/infrastructure/domains/shared/cloudformation-discovery.test.js +4 -7
- package/infrastructure/domains/shared/resource-discovery.js +5 -5
- package/infrastructure/domains/shared/types/discovery-result.test.js +1 -1
- package/infrastructure/domains/shared/utilities/base-definition-factory.js +10 -1
- package/infrastructure/domains/shared/utilities/base-definition-factory.test.js +2 -2
- package/infrastructure/infrastructure-composer.test.js +2 -2
- package/infrastructure/jest.config.js +16 -0
- package/management-ui/README.md +245 -109
- package/package.json +8 -7
- package/frigg-cli/install-command/logger.js +0 -12
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
displayName: 'Infrastructure',
|
|
3
|
+
rootDir: __dirname,
|
|
4
|
+
testMatch: [
|
|
5
|
+
'<rootDir>/**/*.test.js',
|
|
6
|
+
'<rootDir>/**/*.spec.js',
|
|
7
|
+
],
|
|
8
|
+
testPathIgnorePatterns: [
|
|
9
|
+
'/node_modules/',
|
|
10
|
+
'/__tests__/fixtures/',
|
|
11
|
+
'/__tests__/helpers/',
|
|
12
|
+
],
|
|
13
|
+
testEnvironment: 'node',
|
|
14
|
+
testTimeout: 10000,
|
|
15
|
+
transform: {},
|
|
16
|
+
};
|
package/management-ui/README.md
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
# Frigg Management UI
|
|
2
2
|
|
|
3
|
-
A modern React-based
|
|
3
|
+
A modern React-based **developer tool** for managing local Frigg projects. Built with Vite, React, and Tailwind CSS following DDD/Hexagonal architecture principles.
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
The Management UI is a **local development tool** for Frigg framework developers to:
|
|
8
|
+
- Manage Frigg project lifecycle (start/stop/inspect)
|
|
9
|
+
- Perform git operations (branch management, sync)
|
|
10
|
+
- Test integrations using `@friggframework/ui` in a sandboxed environment
|
|
11
|
+
|
|
12
|
+
**NOT for runtime integration management** - that's handled by `@friggframework/ui` in deployed applications.
|
|
4
13
|
|
|
5
14
|
## Features
|
|
6
15
|
|
|
7
|
-
- **
|
|
8
|
-
- **
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
- **Connection Management**: Monitor and manage integration connections
|
|
12
|
-
- **Real-time Updates**: WebSocket-based live updates
|
|
16
|
+
- **Project Management**: Discover, initialize, start/stop local Frigg projects
|
|
17
|
+
- **Git Operations**: Branch management, repository status, sync operations
|
|
18
|
+
- **Test Area**: Sandboxed environment using `@friggframework/ui` for integration testing
|
|
19
|
+
- **Real-time Updates**: WebSocket-based live updates for process status
|
|
13
20
|
- **Responsive Design**: Mobile-friendly interface
|
|
14
|
-
- **
|
|
21
|
+
- **DDD Architecture**: Clean separation of concerns with hexagonal architecture
|
|
15
22
|
|
|
16
23
|
## Tech Stack
|
|
17
24
|
|
|
@@ -28,111 +35,153 @@ A modern React-based management interface for Frigg development environment. Bui
|
|
|
28
35
|
|
|
29
36
|
### Prerequisites
|
|
30
37
|
|
|
31
|
-
- Node.js
|
|
32
|
-
-
|
|
38
|
+
- Node.js 18+ and npm
|
|
39
|
+
- A Frigg project directory to manage
|
|
40
|
+
|
|
41
|
+
### Quick Start
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# From any Frigg project directory
|
|
45
|
+
frigg ui
|
|
46
|
+
|
|
47
|
+
# Or install and run globally
|
|
48
|
+
npm install -g @friggframework/devtools
|
|
49
|
+
frigg ui
|
|
50
|
+
```
|
|
33
51
|
|
|
34
|
-
###
|
|
52
|
+
### Development
|
|
35
53
|
|
|
36
54
|
```bash
|
|
37
55
|
# Install dependencies
|
|
38
56
|
npm install
|
|
39
57
|
|
|
40
|
-
# Start development server (frontend
|
|
41
|
-
npm run dev
|
|
42
|
-
|
|
43
|
-
# Start both frontend and backend
|
|
58
|
+
# Start development server (frontend + backend)
|
|
44
59
|
npm run dev:server
|
|
45
60
|
|
|
46
|
-
#
|
|
47
|
-
npm run
|
|
61
|
+
# Frontend only
|
|
62
|
+
npm run dev
|
|
63
|
+
|
|
64
|
+
# Backend only
|
|
65
|
+
npm run server:dev
|
|
48
66
|
```
|
|
49
67
|
|
|
50
68
|
### Available Scripts
|
|
51
69
|
|
|
52
|
-
- `npm run dev` - Start Vite development server
|
|
70
|
+
- `npm run dev` - Start Vite development server (port 5173)
|
|
53
71
|
- `npm run dev:server` - Start both frontend and backend concurrently
|
|
54
72
|
- `npm run build` - Build for production
|
|
55
73
|
- `npm run preview` - Preview production build
|
|
56
|
-
- `npm run server` - Start backend server
|
|
74
|
+
- `npm run server` - Start backend server (port 3210)
|
|
57
75
|
- `npm run server:dev` - Start backend server with nodemon
|
|
58
76
|
- `npm run lint` - Run ESLint
|
|
59
77
|
- `npm run lint:fix` - Fix ESLint issues
|
|
60
|
-
- `npm run
|
|
78
|
+
- `npm run test` - Run Jest tests
|
|
61
79
|
|
|
62
|
-
##
|
|
80
|
+
## Architecture
|
|
63
81
|
|
|
64
|
-
|
|
65
|
-
src/
|
|
66
|
-
├── components/ # Reusable UI components
|
|
67
|
-
│ ├── Button.jsx # Custom button component
|
|
68
|
-
│ ├── Card.jsx # Card container components
|
|
69
|
-
│ ├── ErrorBoundary.jsx
|
|
70
|
-
│ ├── IntegrationCard.jsx
|
|
71
|
-
│ ├── Layout.jsx # Main layout component
|
|
72
|
-
│ ├── LoadingSpinner.jsx
|
|
73
|
-
│ ├── StatusBadge.jsx
|
|
74
|
-
│ └── index.js # Component exports
|
|
75
|
-
├── hooks/ # React hooks
|
|
76
|
-
│ ├── useFrigg.jsx # Main Frigg state management
|
|
77
|
-
│ └── useSocket.jsx # WebSocket connection
|
|
78
|
-
├── pages/ # Page components
|
|
79
|
-
│ ├── Dashboard.jsx # Main dashboard
|
|
80
|
-
│ ├── Integrations.jsx
|
|
81
|
-
│ ├── Environment.jsx
|
|
82
|
-
│ ├── Users.jsx
|
|
83
|
-
│ └── Connections.jsx
|
|
84
|
-
├── services/ # API services
|
|
85
|
-
│ └── api.js # Axios configuration
|
|
86
|
-
├── utils/ # Utility functions
|
|
87
|
-
│ └── cn.js # Class name utility
|
|
88
|
-
├── App.jsx # Root component
|
|
89
|
-
├── main.jsx # Application entry point
|
|
90
|
-
└── index.css # Global styles
|
|
91
|
-
|
|
92
|
-
server/
|
|
93
|
-
├── api/ # Backend API routes
|
|
94
|
-
├── middleware/ # Express middleware
|
|
95
|
-
├── utils/ # Server utilities
|
|
96
|
-
├── websocket/ # WebSocket handlers
|
|
97
|
-
└── index.js # Server entry point
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
## Component Architecture
|
|
101
|
-
|
|
102
|
-
### Layout Components
|
|
103
|
-
- **Layout**: Main application layout with responsive sidebar
|
|
104
|
-
- **ErrorBoundary**: Catches and displays errors gracefully
|
|
105
|
-
|
|
106
|
-
### UI Components
|
|
107
|
-
- **Button**: Customizable button with variants and sizes
|
|
108
|
-
- **Card**: Container components for content sections
|
|
109
|
-
- **StatusBadge**: Displays server status with color coding
|
|
110
|
-
- **LoadingSpinner**: Loading indicators
|
|
111
|
-
- **IntegrationCard**: Rich integration display component
|
|
112
|
-
|
|
113
|
-
### State Management
|
|
114
|
-
- **useFrigg**: Central state management for Frigg data
|
|
115
|
-
- **useSocket**: WebSocket connection and real-time updates
|
|
116
|
-
|
|
117
|
-
## API Integration
|
|
82
|
+
### DDD/Hexagonal Architecture (Clean Architecture)
|
|
118
83
|
|
|
119
|
-
The
|
|
84
|
+
The Management UI follows Domain-Driven Design principles with clear separation of concerns:
|
|
120
85
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
86
|
+
```
|
|
87
|
+
server/src/
|
|
88
|
+
├── presentation/ # Routes & Controllers (HTTP adapters)
|
|
89
|
+
│ ├── routes/
|
|
90
|
+
│ │ ├── projectRoutes.js # Project management endpoints
|
|
91
|
+
│ │ ├── gitRoutes.js # Git operation endpoints
|
|
92
|
+
│ │ └── testAreaRoutes.js # Test area endpoints
|
|
93
|
+
│ └── controllers/
|
|
94
|
+
│ ├── ProjectController.js
|
|
95
|
+
│ └── GitController.js
|
|
96
|
+
├── application/ # Use Cases & Services (Business logic)
|
|
97
|
+
│ ├── use-cases/
|
|
98
|
+
│ │ ├── StartProjectUseCase.js
|
|
99
|
+
│ │ ├── StopProjectUseCase.js
|
|
100
|
+
│ │ ├── InspectProjectUseCase.js
|
|
101
|
+
│ │ └── git/
|
|
102
|
+
│ │ ├── CreateBranchUseCase.js
|
|
103
|
+
│ │ ├── SwitchBranchUseCase.js
|
|
104
|
+
│ │ └── SyncBranchUseCase.js
|
|
105
|
+
│ └── services/
|
|
106
|
+
│ ├── ProjectService.js
|
|
107
|
+
│ └── GitService.js
|
|
108
|
+
├── domain/ # Domain Entities & Services
|
|
109
|
+
│ ├── entities/
|
|
110
|
+
│ │ ├── Project.js
|
|
111
|
+
│ │ └── AppDefinition.js
|
|
112
|
+
│ └── services/
|
|
113
|
+
│ ├── ProcessManager.js
|
|
114
|
+
│ └── GitService.js
|
|
115
|
+
└── infrastructure/ # Repositories & Adapters
|
|
116
|
+
├── repositories/
|
|
117
|
+
│ └── FileSystemProjectRepository.js
|
|
118
|
+
├── adapters/
|
|
119
|
+
│ ├── FriggCliAdapter.js
|
|
120
|
+
│ └── GitAdapter.js
|
|
121
|
+
└── persistence/
|
|
122
|
+
└── SimpleGitAdapter.js
|
|
123
|
+
|
|
124
|
+
src/ # Frontend (React)
|
|
125
|
+
├── presentation/ # UI Layer
|
|
126
|
+
│ ├── components/
|
|
127
|
+
│ │ ├── common/ # Shared UI components
|
|
128
|
+
│ │ ├── admin/ # Admin view components
|
|
129
|
+
│ │ └── zones/ # Zone-based organization
|
|
130
|
+
│ ├── pages/
|
|
131
|
+
│ └── hooks/
|
|
132
|
+
├── application/ # Frontend use cases
|
|
133
|
+
├── domain/ # Frontend domain models
|
|
134
|
+
└── infrastructure/ # API clients
|
|
135
|
+
```
|
|
125
136
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
-
|
|
130
|
-
-
|
|
131
|
-
-
|
|
132
|
-
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
-
|
|
137
|
+
## Core Functionality
|
|
138
|
+
|
|
139
|
+
### 1. Project Management
|
|
140
|
+
- **Discover Projects**: Automatically find Frigg projects in your workspace
|
|
141
|
+
- **Initialize**: Set up new Frigg projects
|
|
142
|
+
- **Start/Stop**: Manage local Frigg process lifecycle
|
|
143
|
+
- **Inspect**: Deep project analysis (structure, config, dependencies)
|
|
144
|
+
|
|
145
|
+
### 2. Git Operations
|
|
146
|
+
- **Branch Management**: Create, switch, delete branches
|
|
147
|
+
- **Repository Status**: Real-time git status and branch info
|
|
148
|
+
- **Sync Operations**: Pull, push, and synchronize branches
|
|
149
|
+
- **Working Directory**: Track uncommitted changes
|
|
150
|
+
|
|
151
|
+
### 3. Test Area
|
|
152
|
+
- **Integration Testing**: Uses `@friggframework/ui` for testing integrations
|
|
153
|
+
- **User Simulation**: Switch between test users
|
|
154
|
+
- **Live Testing**: Test integrations in real-time with hot reload
|
|
155
|
+
- **Same UI**: Test with the exact UI end-users will see
|
|
156
|
+
|
|
157
|
+
## API Endpoints
|
|
158
|
+
|
|
159
|
+
The management UI backend exposes clean REST APIs following DDD principles:
|
|
160
|
+
|
|
161
|
+
### Project Management (`/api/projects`)
|
|
162
|
+
- `GET /api/projects/discover` - Discover Frigg projects in workspace
|
|
163
|
+
- `POST /api/projects/initialize` - Initialize new Frigg project
|
|
164
|
+
- `GET /api/projects/inspect` - Deep inspection of project structure
|
|
165
|
+
- `GET /api/projects/status` - Get project and process status
|
|
166
|
+
- `POST /api/projects/start` - Start Frigg project
|
|
167
|
+
- `POST /api/projects/stop` - Stop Frigg project
|
|
168
|
+
|
|
169
|
+
### Git Operations (`/api/git`)
|
|
170
|
+
- `GET /api/git/status` - Repository and branch status
|
|
171
|
+
- `GET /api/git/branches` - List all branches
|
|
172
|
+
- `POST /api/git/branches` - Create new branch
|
|
173
|
+
- `PUT /api/git/branches/:name` - Switch to branch
|
|
174
|
+
- `DELETE /api/git/branches/:name` - Delete branch
|
|
175
|
+
- `POST /api/git/sync` - Sync branch with remote
|
|
176
|
+
|
|
177
|
+
### Test Area (`/api/test-area`)
|
|
178
|
+
- `GET /api/test-area/status` - Check if Frigg is running for testing
|
|
179
|
+
- `POST /api/test-area/start` - Start Frigg for test area
|
|
180
|
+
- `POST /api/test-area/stop` - Stop test area Frigg instance
|
|
181
|
+
- `GET /api/test-area/health` - Health check for test Frigg
|
|
182
|
+
|
|
183
|
+
### System
|
|
184
|
+
- `GET /api/health` - Management UI health check
|
|
136
185
|
|
|
137
186
|
## Styling
|
|
138
187
|
|
|
@@ -156,20 +205,46 @@ This project uses Tailwind CSS for styling with:
|
|
|
156
205
|
|
|
157
206
|
## Development
|
|
158
207
|
|
|
159
|
-
###
|
|
208
|
+
### DDD/Hexagonal Architecture Guidelines
|
|
160
209
|
|
|
161
|
-
|
|
162
|
-
- **Prettier**: Code formatting (recommended)
|
|
163
|
-
- **TypeScript Ready**: Prepared for TypeScript migration
|
|
210
|
+
**Golden Rule**: Handlers/Controllers ONLY call Use Cases, NEVER Repositories directly.
|
|
164
211
|
|
|
165
|
-
|
|
212
|
+
```
|
|
213
|
+
Controller → Use Case → Repository → External System
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
#### Layer Responsibilities
|
|
217
|
+
|
|
218
|
+
1. **Presentation Layer** (Routes & Controllers)
|
|
219
|
+
- HTTP-specific logic only (status codes, headers, response formatting)
|
|
220
|
+
- Calls use cases, never repositories
|
|
221
|
+
- Thin adapters with minimal logic
|
|
222
|
+
- Error mapping (domain errors → HTTP errors)
|
|
223
|
+
|
|
224
|
+
2. **Application Layer** (Use Cases & Services)
|
|
225
|
+
- Business logic and orchestration
|
|
226
|
+
- Coordinates multiple repository calls
|
|
227
|
+
- Enforces business rules
|
|
228
|
+
- Receives dependencies via constructor (dependency injection)
|
|
166
229
|
|
|
167
|
-
|
|
168
|
-
-
|
|
169
|
-
-
|
|
170
|
-
-
|
|
171
|
-
|
|
172
|
-
|
|
230
|
+
3. **Domain Layer** (Entities & Domain Services)
|
|
231
|
+
- Core business objects
|
|
232
|
+
- Domain logic and invariants
|
|
233
|
+
- Technology-agnostic
|
|
234
|
+
|
|
235
|
+
4. **Infrastructure Layer** (Repositories & Adapters)
|
|
236
|
+
- Pure database/file operations (CRUD)
|
|
237
|
+
- External API calls
|
|
238
|
+
- No business logic
|
|
239
|
+
- Returns raw data
|
|
240
|
+
|
|
241
|
+
### Code Style
|
|
242
|
+
|
|
243
|
+
- **DDD Principles**: Follow hexagonal architecture patterns
|
|
244
|
+
- **ESLint**: Linting with React and React Hooks rules
|
|
245
|
+
- **Functional Components**: React hooks and composition
|
|
246
|
+
- **Dependency Injection**: Constructor-based injection
|
|
247
|
+
- **Single Responsibility**: Each use case does one thing
|
|
173
248
|
|
|
174
249
|
## Building and Deployment
|
|
175
250
|
|
|
@@ -183,20 +258,81 @@ npm run preview
|
|
|
183
258
|
|
|
184
259
|
The build output will be in the `dist/` directory and can be served by any static file server.
|
|
185
260
|
|
|
261
|
+
## Key Architectural Decisions
|
|
262
|
+
|
|
263
|
+
### Why No Integration Management in Management UI?
|
|
264
|
+
|
|
265
|
+
The Management UI is a **developer tool** for managing local Frigg projects. Integration and connection management belongs in `@friggframework/ui`, which is:
|
|
266
|
+
- Used by deployed Frigg applications (runtime)
|
|
267
|
+
- End-user facing
|
|
268
|
+
- Embedded in Test Area for testing
|
|
269
|
+
|
|
270
|
+
This separation ensures:
|
|
271
|
+
- ✅ Zero duplication between dev tools and runtime UI
|
|
272
|
+
- ✅ Clear boundaries of responsibility
|
|
273
|
+
- ✅ Developers test with the exact UI end-users see
|
|
274
|
+
- ✅ Simpler maintenance (single source of truth)
|
|
275
|
+
|
|
276
|
+
### Test Area Pattern
|
|
277
|
+
|
|
278
|
+
The Test Area embeds `@friggframework/ui` to provide:
|
|
279
|
+
1. **Integration testing** with the production UI
|
|
280
|
+
2. **User simulation** for multi-tenant scenarios
|
|
281
|
+
3. **Real-time testing** with hot reload
|
|
282
|
+
4. **Authentication context** for testing flows
|
|
283
|
+
|
|
186
284
|
## Environment Variables
|
|
187
285
|
|
|
188
|
-
|
|
286
|
+
### Backend
|
|
287
|
+
- `PORT` - Server port (default: 3210)
|
|
288
|
+
- `PROJECT_PATH` - Default project path to manage
|
|
189
289
|
|
|
190
|
-
|
|
191
|
-
-
|
|
290
|
+
### Frontend
|
|
291
|
+
- Auto-detects environment:
|
|
292
|
+
- **Development**: API at `http://localhost:3210`
|
|
293
|
+
- **Production**: Same origin
|
|
192
294
|
|
|
193
295
|
## Contributing
|
|
194
296
|
|
|
195
|
-
1. Follow
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
297
|
+
1. **Follow DDD Architecture**:
|
|
298
|
+
- Controllers call use cases, not repositories
|
|
299
|
+
- Business logic in use cases, not controllers
|
|
300
|
+
- Repositories only for data access
|
|
301
|
+
2. **Add error handling** for new features
|
|
302
|
+
3. **Include loading states** for async operations
|
|
303
|
+
4. **Write tests** using the established patterns
|
|
304
|
+
5. **Update documentation** for significant changes
|
|
305
|
+
6. **Use dependency injection** for all dependencies
|
|
306
|
+
|
|
307
|
+
## Testing
|
|
308
|
+
|
|
309
|
+
```bash
|
|
310
|
+
# Run server tests
|
|
311
|
+
npm run test
|
|
312
|
+
|
|
313
|
+
# Run specific test file
|
|
314
|
+
npm run test -- path/to/test.js
|
|
315
|
+
|
|
316
|
+
# Watch mode
|
|
317
|
+
npm run test -- --watch
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
### Test Structure
|
|
321
|
+
- **Unit Tests**: Domain entities, value objects
|
|
322
|
+
- **Integration Tests**: Use case workflows
|
|
323
|
+
- **Controller Tests**: HTTP endpoint behavior
|
|
324
|
+
|
|
325
|
+
## Related Packages
|
|
326
|
+
|
|
327
|
+
- **@friggframework/core**: Frigg framework core functionality
|
|
328
|
+
- **@friggframework/ui**: Runtime integration UI (used in Test Area)
|
|
329
|
+
- **@friggframework/devtools**: CLI tools for Frigg development
|
|
330
|
+
|
|
331
|
+
## Documentation
|
|
332
|
+
|
|
333
|
+
- [DDD Architecture](./docs/ARCHITECTURE.md)
|
|
334
|
+
- [Cleanup Summary](./CLEANUP_SUMMARY.md)
|
|
335
|
+
- [Frigg Framework Docs](https://docs.friggframework.org)
|
|
200
336
|
|
|
201
337
|
## License
|
|
202
338
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@friggframework/devtools",
|
|
3
3
|
"prettier": "@friggframework/prettier-config",
|
|
4
|
-
"version": "2.0.0--canary.
|
|
4
|
+
"version": "2.0.0--canary.522.893db5d.0",
|
|
5
5
|
"bin": {
|
|
6
6
|
"frigg": "./frigg-cli/index.js"
|
|
7
7
|
},
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"@babel/eslint-parser": "^7.18.9",
|
|
26
26
|
"@babel/parser": "^7.25.3",
|
|
27
27
|
"@babel/traverse": "^7.25.3",
|
|
28
|
-
"@friggframework/core": "2.0.0--canary.
|
|
29
|
-
"@friggframework/schemas": "2.0.0--canary.
|
|
30
|
-
"@friggframework/test": "2.0.0--canary.
|
|
28
|
+
"@friggframework/core": "2.0.0--canary.522.893db5d.0",
|
|
29
|
+
"@friggframework/schemas": "2.0.0--canary.522.893db5d.0",
|
|
30
|
+
"@friggframework/test": "2.0.0--canary.522.893db5d.0",
|
|
31
31
|
"@hapi/boom": "^10.0.1",
|
|
32
32
|
"@inquirer/prompts": "^5.3.8",
|
|
33
33
|
"axios": "^1.7.2",
|
|
@@ -55,10 +55,11 @@
|
|
|
55
55
|
"validate-npm-package-name": "^5.0.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@friggframework/eslint-config": "2.0.0--canary.
|
|
59
|
-
"@friggframework/prettier-config": "2.0.0--canary.
|
|
58
|
+
"@friggframework/eslint-config": "2.0.0--canary.522.893db5d.0",
|
|
59
|
+
"@friggframework/prettier-config": "2.0.0--canary.522.893db5d.0",
|
|
60
60
|
"aws-sdk-client-mock": "^4.1.0",
|
|
61
61
|
"aws-sdk-client-mock-jest": "^4.1.0",
|
|
62
|
+
"exit-x": "^0.2.2",
|
|
62
63
|
"jest": "^30.1.3",
|
|
63
64
|
"osls": "^3.40.1",
|
|
64
65
|
"prettier": "^2.7.1",
|
|
@@ -88,5 +89,5 @@
|
|
|
88
89
|
"publishConfig": {
|
|
89
90
|
"access": "public"
|
|
90
91
|
},
|
|
91
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "893db5dc366945920987fecc1e8ab53754f76f63"
|
|
92
93
|
}
|