@friggframework/devtools 2.0.0--canary.522.923dfae.0 → 2.0.0--canary.540.c5ef83f.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__/unit/commands/doctor.test.js +2 -0
- package/frigg-cli/__tests__/unit/commands/install.test.js +19 -23
- package/frigg-cli/__tests__/unit/dependencies.test.js +2 -2
- package/frigg-cli/doctor-command/index.js +16 -17
- package/frigg-cli/index.js +6 -21
- package/frigg-cli/index.test.js +2 -7
- package/frigg-cli/init-command/backend-first-handler.js +42 -124
- package/frigg-cli/init-command/index.js +1 -2
- package/frigg-cli/init-command/template-handler.js +3 -13
- package/frigg-cli/install-command/backend-js.js +3 -3
- package/frigg-cli/install-command/environment-variables.js +19 -16
- package/frigg-cli/install-command/environment-variables.test.js +13 -12
- package/frigg-cli/install-command/index.js +9 -14
- package/frigg-cli/install-command/integration-file.js +3 -3
- package/frigg-cli/install-command/logger.js +12 -0
- package/frigg-cli/install-command/validate-package.js +9 -5
- package/frigg-cli/jest.config.js +1 -4
- package/frigg-cli/repair-command/index.js +128 -101
- package/frigg-cli/start-command/index.js +2 -246
- package/frigg-cli/ui-command/index.js +36 -58
- package/frigg-cli/utils/repo-detection.js +37 -85
- package/infrastructure/docs/iam-policy-templates.md +1 -1
- package/infrastructure/domains/networking/vpc-builder.test.js +4 -2
- package/infrastructure/domains/networking/vpc-resolver.test.js +1 -1
- package/infrastructure/domains/shared/cloudformation-discovery.test.js +7 -4
- package/infrastructure/domains/shared/resource-discovery.js +5 -5
- package/infrastructure/domains/shared/types/app-definition.js +0 -21
- package/infrastructure/domains/shared/types/discovery-result.test.js +1 -1
- package/infrastructure/domains/shared/utilities/base-definition-factory.js +1 -10
- package/infrastructure/domains/shared/utilities/base-definition-factory.test.js +2 -2
- package/infrastructure/infrastructure-composer.test.js +2 -2
- package/management-ui/README.md +109 -245
- package/package.json +7 -8
- package/frigg-cli/__tests__/application/use-cases/AddApiModuleToIntegrationUseCase.test.js +0 -326
- package/frigg-cli/__tests__/application/use-cases/CreateApiModuleUseCase.test.js +0 -337
- package/frigg-cli/__tests__/domain/entities/ApiModule.test.js +0 -373
- package/frigg-cli/__tests__/domain/entities/AppDefinition.test.js +0 -313
- package/frigg-cli/__tests__/domain/services/IntegrationValidator.test.js +0 -269
- package/frigg-cli/__tests__/domain/value-objects/IntegrationName.test.js +0 -82
- package/frigg-cli/__tests__/infrastructure/adapters/IntegrationJsUpdater.test.js +0 -408
- package/frigg-cli/__tests__/infrastructure/repositories/FileSystemApiModuleRepository.test.js +0 -583
- package/frigg-cli/__tests__/infrastructure/repositories/FileSystemAppDefinitionRepository.test.js +0 -314
- package/frigg-cli/__tests__/infrastructure/repositories/FileSystemIntegrationRepository.test.js +0 -383
- package/frigg-cli/__tests__/unit/commands/init.test.js +0 -406
- package/frigg-cli/__tests__/unit/commands/repair.test.js +0 -275
- package/frigg-cli/__tests__/unit/start-command/application/RunPreflightChecksUseCase.test.js +0 -411
- package/frigg-cli/__tests__/unit/start-command/infrastructure/DatabaseAdapter.test.js +0 -405
- package/frigg-cli/__tests__/unit/start-command/infrastructure/DockerAdapter.test.js +0 -496
- package/frigg-cli/__tests__/unit/start-command/presentation/InteractivePromptAdapter.test.js +0 -474
- package/frigg-cli/__tests__/unit/utils/output.test.js +0 -196
- package/frigg-cli/application/use-cases/AddApiModuleToIntegrationUseCase.js +0 -93
- package/frigg-cli/application/use-cases/CreateApiModuleUseCase.js +0 -93
- package/frigg-cli/application/use-cases/CreateIntegrationUseCase.js +0 -103
- package/frigg-cli/container.js +0 -172
- package/frigg-cli/docs/OUTPUT_MIGRATION_GUIDE.md +0 -286
- package/frigg-cli/domain/entities/ApiModule.js +0 -272
- package/frigg-cli/domain/entities/AppDefinition.js +0 -227
- package/frigg-cli/domain/entities/Integration.js +0 -198
- package/frigg-cli/domain/exceptions/DomainException.js +0 -24
- package/frigg-cli/domain/ports/IApiModuleRepository.js +0 -53
- package/frigg-cli/domain/ports/IAppDefinitionRepository.js +0 -43
- package/frigg-cli/domain/ports/IIntegrationRepository.js +0 -61
- package/frigg-cli/domain/services/IntegrationValidator.js +0 -185
- package/frigg-cli/domain/value-objects/IntegrationId.js +0 -42
- package/frigg-cli/domain/value-objects/IntegrationName.js +0 -60
- package/frigg-cli/domain/value-objects/SemanticVersion.js +0 -70
- package/frigg-cli/infrastructure/UnitOfWork.js +0 -46
- package/frigg-cli/infrastructure/adapters/BackendJsUpdater.js +0 -197
- package/frigg-cli/infrastructure/adapters/FileSystemAdapter.js +0 -224
- package/frigg-cli/infrastructure/adapters/IntegrationJsUpdater.js +0 -249
- package/frigg-cli/infrastructure/adapters/SchemaValidator.js +0 -92
- package/frigg-cli/infrastructure/repositories/FileSystemApiModuleRepository.js +0 -373
- package/frigg-cli/infrastructure/repositories/FileSystemAppDefinitionRepository.js +0 -116
- package/frigg-cli/infrastructure/repositories/FileSystemIntegrationRepository.js +0 -277
- package/frigg-cli/package-lock.json +0 -16226
- package/frigg-cli/start-command/application/RunPreflightChecksUseCase.js +0 -376
- package/frigg-cli/start-command/infrastructure/DatabaseAdapter.js +0 -591
- package/frigg-cli/start-command/infrastructure/DockerAdapter.js +0 -306
- package/frigg-cli/start-command/presentation/InteractivePromptAdapter.js +0 -329
- package/frigg-cli/templates/backend/.env.example +0 -62
- package/frigg-cli/templates/backend/.eslintrc.json +0 -12
- package/frigg-cli/templates/backend/.prettierrc +0 -6
- package/frigg-cli/templates/backend/docker-compose.yml +0 -22
- package/frigg-cli/templates/backend/index.js +0 -96
- package/frigg-cli/templates/backend/infrastructure.js +0 -12
- package/frigg-cli/templates/backend/jest.config.js +0 -17
- package/frigg-cli/templates/backend/package.json +0 -50
- package/frigg-cli/templates/backend/src/api-modules/.gitkeep +0 -10
- package/frigg-cli/templates/backend/src/base/.gitkeep +0 -7
- package/frigg-cli/templates/backend/src/integrations/.gitkeep +0 -10
- package/frigg-cli/templates/backend/src/integrations/ExampleIntegration.js +0 -65
- package/frigg-cli/templates/backend/src/utils/.gitkeep +0 -7
- package/frigg-cli/templates/backend/test/setup.js +0 -30
- package/frigg-cli/templates/backend/ui-extensions/.gitkeep +0 -0
- package/frigg-cli/templates/backend/ui-extensions/README.md +0 -77
- package/frigg-cli/utils/__tests__/repo-detection.test.js +0 -436
- package/frigg-cli/utils/output.js +0 -382
- package/frigg-cli/validate-command/__tests__/adapters/validate-command.test.js +0 -205
- package/frigg-cli/validate-command/__tests__/application/validate-app-use-case.test.js +0 -104
- package/frigg-cli/validate-command/__tests__/domain/fix-suggestion.test.js +0 -153
- package/frigg-cli/validate-command/__tests__/domain/validation-error.test.js +0 -162
- package/frigg-cli/validate-command/__tests__/domain/validation-result.test.js +0 -152
- package/frigg-cli/validate-command/__tests__/infrastructure/api-module-validator.test.js +0 -332
- package/frigg-cli/validate-command/__tests__/infrastructure/app-definition-validator.test.js +0 -191
- package/frigg-cli/validate-command/__tests__/infrastructure/integration-class-validator.test.js +0 -146
- package/frigg-cli/validate-command/__tests__/infrastructure/template-validation.test.js +0 -155
- package/frigg-cli/validate-command/adapters/cli/validate-command.js +0 -199
- package/frigg-cli/validate-command/application/use-cases/validate-app-use-case.js +0 -35
- package/frigg-cli/validate-command/domain/entities/validation-result.js +0 -74
- package/frigg-cli/validate-command/domain/value-objects/fix-suggestion.js +0 -74
- package/frigg-cli/validate-command/domain/value-objects/validation-error.js +0 -68
- package/frigg-cli/validate-command/infrastructure/validators/api-module-validator.js +0 -181
- package/frigg-cli/validate-command/infrastructure/validators/app-definition-validator.js +0 -128
- package/frigg-cli/validate-command/infrastructure/validators/integration-class-validator.js +0 -113
- package/infrastructure/domains/admin-scripts/admin-script-builder.js +0 -200
- package/infrastructure/domains/admin-scripts/admin-script-builder.test.js +0 -499
- package/infrastructure/domains/admin-scripts/index.js +0 -5
- package/infrastructure/jest.config.js +0 -16
|
@@ -589,8 +589,10 @@ describe('CloudFormationDiscovery', () => {
|
|
|
589
589
|
|
|
590
590
|
describe('External VPC with routing infrastructure pattern', () => {
|
|
591
591
|
it('should discover routing resources when VPC is external', async () => {
|
|
592
|
+
// This tests the external VPC pattern: external VPC/subnets/KMS,
|
|
593
|
+
// but stack creates routing infrastructure (route table, NAT route, VPC endpoints)
|
|
592
594
|
const mockStack = {
|
|
593
|
-
StackName: 'frigg-app-production',
|
|
595
|
+
StackName: 'create-frigg-app-production',
|
|
594
596
|
Outputs: [],
|
|
595
597
|
};
|
|
596
598
|
|
|
@@ -636,7 +638,7 @@ describe('CloudFormationDiscovery', () => {
|
|
|
636
638
|
mockProvider.describeStack.mockResolvedValue(mockStack);
|
|
637
639
|
mockProvider.listStackResources.mockResolvedValue(mockResources);
|
|
638
640
|
|
|
639
|
-
const result = await cfDiscovery.discoverFromStack('frigg-app-production');
|
|
641
|
+
const result = await cfDiscovery.discoverFromStack('create-frigg-app-production');
|
|
640
642
|
|
|
641
643
|
// Verify routing infrastructure was discovered
|
|
642
644
|
expect(result.routeTableId).toBe('rtb-0b83aca77ccde20a6');
|
|
@@ -805,8 +807,9 @@ describe('CloudFormationDiscovery', () => {
|
|
|
805
807
|
|
|
806
808
|
describe('existingLogicalIds tracking', () => {
|
|
807
809
|
it('should track OLD VPC endpoint logical IDs (VPCEndpointS3 pattern) for backwards compatibility', async () => {
|
|
810
|
+
// CRITICAL: Frontify production uses OLD naming convention
|
|
808
811
|
const mockStack = {
|
|
809
|
-
StackName: 'frigg-app-production',
|
|
812
|
+
StackName: 'create-frigg-app-production',
|
|
810
813
|
Outputs: []
|
|
811
814
|
};
|
|
812
815
|
|
|
@@ -822,7 +825,7 @@ describe('CloudFormationDiscovery', () => {
|
|
|
822
825
|
mockProvider.describeStack.mockResolvedValue(mockStack);
|
|
823
826
|
mockProvider.listStackResources.mockResolvedValue(mockResources);
|
|
824
827
|
|
|
825
|
-
const result = await cfDiscovery.discoverFromStack('frigg-app-production');
|
|
828
|
+
const result = await cfDiscovery.discoverFromStack('create-frigg-app-production');
|
|
826
829
|
|
|
827
830
|
// CRITICAL: existingLogicalIds MUST contain old VPC endpoint names
|
|
828
831
|
expect(result.existingLogicalIds).toBeDefined();
|
|
@@ -88,8 +88,8 @@ async function gatherDiscoveredResources(appDefinition) {
|
|
|
88
88
|
|
|
89
89
|
// Build discovery configuration
|
|
90
90
|
const stage = process.env.SLS_STAGE || 'dev';
|
|
91
|
-
const stackName = `${appDefinition.name || 'frigg-app'}-${stage}`;
|
|
92
|
-
const serviceName = appDefinition.name || 'frigg-app';
|
|
91
|
+
const stackName = `${appDefinition.name || 'create-frigg-app'}-${stage}`;
|
|
92
|
+
const serviceName = appDefinition.name || 'create-frigg-app';
|
|
93
93
|
|
|
94
94
|
// Try CloudFormation-first discovery
|
|
95
95
|
const cfDiscovery = new CloudFormationDiscovery(provider, { serviceName, stage });
|
|
@@ -135,9 +135,9 @@ async function gatherDiscoveredResources(appDefinition) {
|
|
|
135
135
|
// KMS keys CAN be shared across stages (encryption keys are safe to reuse)
|
|
136
136
|
const kmsDiscovery = new KmsDiscovery(provider);
|
|
137
137
|
const kmsConfig = {
|
|
138
|
-
serviceName: appDefinition.name || 'frigg-app',
|
|
138
|
+
serviceName: appDefinition.name || 'create-frigg-app',
|
|
139
139
|
stage,
|
|
140
|
-
keyAlias: `alias/${appDefinition.name || 'frigg-app'}-${stage}-frigg-kms`,
|
|
140
|
+
keyAlias: `alias/${appDefinition.name || 'create-frigg-app'}-${stage}-frigg-kms`,
|
|
141
141
|
};
|
|
142
142
|
const kmsResult = await kmsDiscovery.discover(kmsConfig);
|
|
143
143
|
|
|
@@ -166,7 +166,7 @@ async function gatherDiscoveredResources(appDefinition) {
|
|
|
166
166
|
const ssmDiscovery = new SsmDiscovery(provider);
|
|
167
167
|
|
|
168
168
|
const config = {
|
|
169
|
-
serviceName: appDefinition.name || 'frigg-app',
|
|
169
|
+
serviceName: appDefinition.name || 'create-frigg-app',
|
|
170
170
|
stage,
|
|
171
171
|
vpcId: appDefinition.vpc?.vpcId,
|
|
172
172
|
databaseId: appDefinition.database?.postgres?.clusterId ||
|
|
@@ -106,25 +106,6 @@
|
|
|
106
106
|
* @property {string} Definition.name - Integration name
|
|
107
107
|
*/
|
|
108
108
|
|
|
109
|
-
/**
|
|
110
|
-
* Admin script definition
|
|
111
|
-
* @typedef {Object} AdminScriptDefinition
|
|
112
|
-
* @property {Object} Definition - Static definition from script class
|
|
113
|
-
* @property {string} Definition.name - Script name identifier
|
|
114
|
-
* @property {string} Definition.version - Script version (semver)
|
|
115
|
-
* @property {string} [Definition.description] - Human-readable description
|
|
116
|
-
* @property {Object} [Definition.schedule] - Schedule configuration
|
|
117
|
-
* @property {boolean} [Definition.schedule.enabled] - Whether scheduling is enabled
|
|
118
|
-
* @property {string} [Definition.schedule.cronExpression] - Cron expression
|
|
119
|
-
*/
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Admin configuration
|
|
123
|
-
* @typedef {Object} AdminConfig
|
|
124
|
-
* @property {boolean} [includeBuiltinScripts] - Whether to include built-in scripts
|
|
125
|
-
* @property {boolean} [enableScheduling] - Whether to enable EventBridge scheduling
|
|
126
|
-
*/
|
|
127
|
-
|
|
128
109
|
/**
|
|
129
110
|
* Complete application definition
|
|
130
111
|
* @typedef {Object} AppDefinition
|
|
@@ -141,8 +122,6 @@
|
|
|
141
122
|
* @property {MigrationDefinition} [migrations] - Database migration configuration
|
|
142
123
|
* @property {WebsocketDefinition} [websockets] - WebSocket API configuration
|
|
143
124
|
* @property {IntegrationDefinition[]} [integrations] - Integration definitions
|
|
144
|
-
* @property {AdminScriptDefinition[]} [adminScripts] - Admin script definitions
|
|
145
|
-
* @property {AdminConfig} [admin] - Admin configuration
|
|
146
125
|
*
|
|
147
126
|
* @property {Object} [environment] - Environment variables
|
|
148
127
|
*/
|
|
@@ -165,7 +165,7 @@ function createBaseDefinition(
|
|
|
165
165
|
|
|
166
166
|
return {
|
|
167
167
|
frameworkVersion: '>=3.17.0',
|
|
168
|
-
service: AppDefinition.name || 'frigg-app',
|
|
168
|
+
service: AppDefinition.name || 'create-frigg-app',
|
|
169
169
|
package: {
|
|
170
170
|
individually: true,
|
|
171
171
|
},
|
|
@@ -311,15 +311,6 @@ function createBaseDefinition(
|
|
|
311
311
|
{ httpApi: { path: '/health/{proxy+}', method: 'GET' } },
|
|
312
312
|
],
|
|
313
313
|
},
|
|
314
|
-
docs: {
|
|
315
|
-
handler: 'node_modules/@friggframework/core/handlers/routers/docs.handler',
|
|
316
|
-
skipEsbuild: true,
|
|
317
|
-
package: skipEsbuildPackageConfig,
|
|
318
|
-
events: [
|
|
319
|
-
{ httpApi: { path: '/api/docs', method: 'GET' } },
|
|
320
|
-
{ httpApi: { path: '/api/openapi.json', method: 'GET' } },
|
|
321
|
-
],
|
|
322
|
-
},
|
|
323
314
|
// Note: dbMigrate removed - MigrationBuilder now handles migration infrastructure
|
|
324
315
|
// See: packages/devtools/infrastructure/domains/database/migration-builder.js
|
|
325
316
|
},
|
|
@@ -30,10 +30,10 @@ describe('Base Definition Factory', () => {
|
|
|
30
30
|
expect(result.provider.stage).toBe('${opt:stage}');
|
|
31
31
|
});
|
|
32
32
|
|
|
33
|
-
it('should default service name to frigg-app', () => {
|
|
33
|
+
it('should default service name to create-frigg-app', () => {
|
|
34
34
|
const result = createBaseDefinition({}, {}, {});
|
|
35
35
|
|
|
36
|
-
expect(result.service).toBe('frigg-app');
|
|
36
|
+
expect(result.service).toBe('create-frigg-app');
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
it('should use custom provider if specified', () => {
|
|
@@ -157,7 +157,7 @@ describe('composeServerlessDefinition', () => {
|
|
|
157
157
|
|
|
158
158
|
const result = await composeServerlessDefinition(appDefinition);
|
|
159
159
|
|
|
160
|
-
expect(result.service).toBe('frigg-app');
|
|
160
|
+
expect(result.service).toBe('create-frigg-app');
|
|
161
161
|
});
|
|
162
162
|
|
|
163
163
|
it('should use custom provider when specified', async () => {
|
|
@@ -1859,7 +1859,7 @@ describe('composeServerlessDefinition', () => {
|
|
|
1859
1859
|
|
|
1860
1860
|
await expect(composeServerlessDefinition(appDefinition)).resolves.not.toThrow();
|
|
1861
1861
|
const result = await composeServerlessDefinition(appDefinition);
|
|
1862
|
-
expect(result.service).toBe('frigg-app');
|
|
1862
|
+
expect(result.service).toBe('create-frigg-app');
|
|
1863
1863
|
});
|
|
1864
1864
|
|
|
1865
1865
|
it('should handle null/undefined integrations', async () => {
|
package/management-ui/README.md
CHANGED
|
@@ -1,24 +1,17 @@
|
|
|
1
1
|
# Frigg Management UI
|
|
2
2
|
|
|
3
|
-
A modern React-based
|
|
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.
|
|
3
|
+
A modern React-based management interface for Frigg development environment. Built with Vite, React, and Tailwind CSS, this application provides developers with a comprehensive dashboard to manage integrations, users, connections, and environment variables.
|
|
13
4
|
|
|
14
5
|
## Features
|
|
15
6
|
|
|
16
|
-
- **
|
|
17
|
-
- **
|
|
18
|
-
- **
|
|
19
|
-
- **
|
|
7
|
+
- **Dashboard**: Server control, metrics, and activity monitoring
|
|
8
|
+
- **Integration Discovery**: Browse, install, and manage Frigg integrations
|
|
9
|
+
- **Environment Management**: Configure environment variables and settings
|
|
10
|
+
- **User Management**: Create and manage test users
|
|
11
|
+
- **Connection Management**: Monitor and manage integration connections
|
|
12
|
+
- **Real-time Updates**: WebSocket-based live updates
|
|
20
13
|
- **Responsive Design**: Mobile-friendly interface
|
|
21
|
-
- **
|
|
14
|
+
- **Error Boundaries**: Robust error handling
|
|
22
15
|
|
|
23
16
|
## Tech Stack
|
|
24
17
|
|
|
@@ -35,153 +28,111 @@ The Management UI is a **local development tool** for Frigg framework developers
|
|
|
35
28
|
|
|
36
29
|
### Prerequisites
|
|
37
30
|
|
|
38
|
-
- Node.js
|
|
39
|
-
-
|
|
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
|
-
```
|
|
31
|
+
- Node.js 16+ and npm
|
|
32
|
+
- Running Frigg backend server
|
|
51
33
|
|
|
52
|
-
###
|
|
34
|
+
### Installation
|
|
53
35
|
|
|
54
36
|
```bash
|
|
55
37
|
# Install dependencies
|
|
56
38
|
npm install
|
|
57
39
|
|
|
58
|
-
# Start development server (frontend
|
|
59
|
-
npm run dev:server
|
|
60
|
-
|
|
61
|
-
# Frontend only
|
|
40
|
+
# Start development server (frontend only)
|
|
62
41
|
npm run dev
|
|
63
42
|
|
|
64
|
-
#
|
|
65
|
-
npm run server
|
|
43
|
+
# Start both frontend and backend
|
|
44
|
+
npm run dev:server
|
|
45
|
+
|
|
46
|
+
# Build for production
|
|
47
|
+
npm run build
|
|
66
48
|
```
|
|
67
49
|
|
|
68
50
|
### Available Scripts
|
|
69
51
|
|
|
70
|
-
- `npm run dev` - Start Vite development server
|
|
52
|
+
- `npm run dev` - Start Vite development server
|
|
71
53
|
- `npm run dev:server` - Start both frontend and backend concurrently
|
|
72
54
|
- `npm run build` - Build for production
|
|
73
55
|
- `npm run preview` - Preview production build
|
|
74
|
-
- `npm run server` - Start backend server
|
|
56
|
+
- `npm run server` - Start backend server only
|
|
75
57
|
- `npm run server:dev` - Start backend server with nodemon
|
|
76
58
|
- `npm run lint` - Run ESLint
|
|
77
59
|
- `npm run lint:fix` - Fix ESLint issues
|
|
78
|
-
- `npm run
|
|
60
|
+
- `npm run typecheck` - Run TypeScript type checking
|
|
79
61
|
|
|
80
|
-
##
|
|
81
|
-
|
|
82
|
-
### DDD/Hexagonal Architecture (Clean Architecture)
|
|
83
|
-
|
|
84
|
-
The Management UI follows Domain-Driven Design principles with clear separation of concerns:
|
|
62
|
+
## Project Structure
|
|
85
63
|
|
|
86
64
|
```
|
|
87
|
-
|
|
88
|
-
├──
|
|
89
|
-
│ ├──
|
|
90
|
-
│
|
|
91
|
-
│
|
|
92
|
-
│
|
|
93
|
-
│
|
|
94
|
-
│
|
|
95
|
-
│
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
│
|
|
99
|
-
│
|
|
100
|
-
|
|
101
|
-
│
|
|
102
|
-
│
|
|
103
|
-
│
|
|
104
|
-
│
|
|
105
|
-
│ └──
|
|
106
|
-
|
|
107
|
-
│
|
|
108
|
-
├──
|
|
109
|
-
│
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
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
|
|
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
|
|
135
98
|
```
|
|
136
99
|
|
|
137
|
-
##
|
|
138
|
-
|
|
139
|
-
###
|
|
140
|
-
- **
|
|
141
|
-
- **
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
- **
|
|
147
|
-
- **
|
|
148
|
-
- **
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
- **
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
###
|
|
162
|
-
|
|
163
|
-
- `
|
|
164
|
-
- `
|
|
165
|
-
- `
|
|
166
|
-
- `
|
|
167
|
-
- `POST /api/
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
- `GET /api/
|
|
171
|
-
- `
|
|
172
|
-
- `
|
|
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
|
|
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
|
|
118
|
+
|
|
119
|
+
The management UI communicates with the Frigg backend through:
|
|
120
|
+
|
|
121
|
+
1. **REST API**: Standard CRUD operations
|
|
122
|
+
2. **WebSocket**: Real-time updates and notifications
|
|
123
|
+
|
|
124
|
+
### API Endpoints
|
|
125
|
+
|
|
126
|
+
- `GET /api/frigg/status` - Server status
|
|
127
|
+
- `POST /api/frigg/start` - Start Frigg server
|
|
128
|
+
- `POST /api/frigg/stop` - Stop Frigg server
|
|
129
|
+
- `GET /api/integrations` - List integrations
|
|
130
|
+
- `POST /api/integrations/install` - Install integration
|
|
131
|
+
- `GET /api/environment` - Environment variables
|
|
132
|
+
- `PUT /api/environment` - Update environment variables
|
|
133
|
+
- `GET /api/users` - List test users
|
|
134
|
+
- `POST /api/users` - Create test user
|
|
135
|
+
- `GET /api/connections` - List connections
|
|
185
136
|
|
|
186
137
|
## Styling
|
|
187
138
|
|
|
@@ -205,46 +156,20 @@ This project uses Tailwind CSS for styling with:
|
|
|
205
156
|
|
|
206
157
|
## Development
|
|
207
158
|
|
|
208
|
-
### DDD/Hexagonal Architecture Guidelines
|
|
209
|
-
|
|
210
|
-
**Golden Rule**: Handlers/Controllers ONLY call Use Cases, NEVER Repositories directly.
|
|
211
|
-
|
|
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)
|
|
229
|
-
|
|
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
159
|
### Code Style
|
|
242
160
|
|
|
243
|
-
- **DDD Principles**: Follow hexagonal architecture patterns
|
|
244
161
|
- **ESLint**: Linting with React and React Hooks rules
|
|
245
|
-
- **
|
|
246
|
-
- **
|
|
247
|
-
|
|
162
|
+
- **Prettier**: Code formatting (recommended)
|
|
163
|
+
- **TypeScript Ready**: Prepared for TypeScript migration
|
|
164
|
+
|
|
165
|
+
### Best Practices
|
|
166
|
+
|
|
167
|
+
- Functional components with hooks
|
|
168
|
+
- Component composition over inheritance
|
|
169
|
+
- Separation of concerns (UI, state, logic)
|
|
170
|
+
- Error boundaries for robustness
|
|
171
|
+
- Loading states for better UX
|
|
172
|
+
- Responsive design principles
|
|
248
173
|
|
|
249
174
|
## Building and Deployment
|
|
250
175
|
|
|
@@ -258,81 +183,20 @@ npm run preview
|
|
|
258
183
|
|
|
259
184
|
The build output will be in the `dist/` directory and can be served by any static file server.
|
|
260
185
|
|
|
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
|
-
|
|
284
186
|
## Environment Variables
|
|
285
187
|
|
|
286
|
-
|
|
287
|
-
- `PORT` - Server port (default: 3210)
|
|
288
|
-
- `PROJECT_PATH` - Default project path to manage
|
|
188
|
+
The application automatically detects the environment:
|
|
289
189
|
|
|
290
|
-
|
|
291
|
-
-
|
|
292
|
-
- **Development**: API at `http://localhost:3210`
|
|
293
|
-
- **Production**: Same origin
|
|
190
|
+
- **Development**: API calls to `http://localhost:3001`
|
|
191
|
+
- **Production**: API calls to the same origin
|
|
294
192
|
|
|
295
193
|
## Contributing
|
|
296
194
|
|
|
297
|
-
1.
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
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)
|
|
195
|
+
1. Follow the existing code style and patterns
|
|
196
|
+
2. Add error handling for new features
|
|
197
|
+
3. Include loading states for async operations
|
|
198
|
+
4. Write tests for new components (when testing is set up)
|
|
199
|
+
5. Update documentation for significant changes
|
|
336
200
|
|
|
337
201
|
## License
|
|
338
202
|
|
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.540.c5ef83f.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.540.c5ef83f.0",
|
|
29
|
+
"@friggframework/schemas": "2.0.0--canary.540.c5ef83f.0",
|
|
30
|
+
"@friggframework/test": "2.0.0--canary.540.c5ef83f.0",
|
|
31
31
|
"@hapi/boom": "^10.0.1",
|
|
32
32
|
"@inquirer/prompts": "^5.3.8",
|
|
33
33
|
"axios": "^1.7.2",
|
|
@@ -55,11 +55,10 @@
|
|
|
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.540.c5ef83f.0",
|
|
59
|
+
"@friggframework/prettier-config": "2.0.0--canary.540.c5ef83f.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",
|
|
63
62
|
"jest": "^30.1.3",
|
|
64
63
|
"osls": "^3.40.1",
|
|
65
64
|
"prettier": "^2.7.1",
|
|
@@ -89,5 +88,5 @@
|
|
|
89
88
|
"publishConfig": {
|
|
90
89
|
"access": "public"
|
|
91
90
|
},
|
|
92
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "c5ef83fae0876e66e46a74a0950750c742f0ceae"
|
|
93
92
|
}
|