@friggframework/devtools 2.0.0--canary.398.7664c46.0 → 2.0.0--canary.400.bed3308.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/.eslintrc.js +141 -0
- package/frigg-cli/__tests__/jest.config.js +102 -0
- package/frigg-cli/__tests__/unit/commands/build.test.js +483 -0
- package/frigg-cli/__tests__/unit/commands/install.test.js +418 -0
- package/frigg-cli/__tests__/unit/commands/ui.test.js +592 -0
- package/frigg-cli/__tests__/utils/command-tester.js +170 -0
- package/frigg-cli/__tests__/utils/mock-factory.js +270 -0
- package/frigg-cli/__tests__/utils/test-fixtures.js +463 -0
- package/frigg-cli/__tests__/utils/test-setup.js +286 -0
- package/frigg-cli/build-command/index.js +15 -2
- package/frigg-cli/deploy-command/index.js +15 -2
- package/frigg-cli/generate-command/__tests__/generate-command.test.js +312 -0
- package/frigg-cli/generate-command/azure-generator.js +43 -0
- package/frigg-cli/generate-command/gcp-generator.js +47 -0
- package/frigg-cli/generate-command/index.js +350 -0
- package/frigg-cli/generate-command/terraform-generator.js +555 -0
- package/frigg-cli/index.js +66 -4
- package/frigg-cli/install-command/index.js +15 -2
- package/frigg-cli/package.json +75 -0
- package/frigg-cli/start-command/index.js +17 -2
- package/frigg-cli/ui-command/index.js +167 -0
- package/frigg-cli/utils/app-resolver.js +319 -0
- package/frigg-cli/utils/backend-path.js +38 -0
- package/frigg-cli/utils/process-manager.js +199 -0
- package/frigg-cli/utils/repo-detection.js +405 -0
- package/infrastructure/AWS-IAM-CREDENTIAL-NEEDS.md +43 -19
- package/infrastructure/IAM-POLICY-TEMPLATES.md +1 -1
- package/infrastructure/frigg-deployment-iam-stack.yaml +16 -2
- package/infrastructure/iam-generator.js +129 -6
- package/infrastructure/iam-policy-basic.json +29 -5
- package/infrastructure/iam-policy-full.json +28 -5
- package/infrastructure/serverless-template.js +209 -3
- package/infrastructure/serverless-template.test.js +12 -0
- package/management-ui/.eslintrc.js +22 -0
- package/management-ui/README.md +203 -0
- package/management-ui/components.json +21 -0
- package/management-ui/{dist/index.html → index.html} +1 -2
- package/management-ui/merge-conflict-cleaner.py +371 -0
- package/management-ui/package-lock.json +10997 -0
- package/management-ui/package.json +76 -0
- package/management-ui/postcss.config.js +6 -0
- package/management-ui/server/api/backend.js +256 -0
- package/management-ui/server/api/cli.js +315 -0
- package/management-ui/server/api/codegen.js +663 -0
- package/management-ui/server/api/connections.js +857 -0
- package/management-ui/server/api/discovery.js +185 -0
- package/management-ui/server/api/environment/index.js +1 -0
- package/management-ui/server/api/environment/router.js +378 -0
- package/management-ui/server/api/environment.js +328 -0
- package/management-ui/server/api/integrations.js +479 -0
- package/management-ui/server/api/logs.js +248 -0
- package/management-ui/server/api/monitoring.js +282 -0
- package/management-ui/server/api/open-ide.js +31 -0
- package/management-ui/server/api/project.js +553 -0
- package/management-ui/server/api/users/sessions.js +371 -0
- package/management-ui/server/api/users/simulation.js +254 -0
- package/management-ui/server/api/users.js +362 -0
- package/management-ui/server/api-contract.md +275 -0
- package/management-ui/server/index.js +428 -0
- package/management-ui/server/middleware/errorHandler.js +70 -0
- package/management-ui/server/middleware/security.js +32 -0
- package/management-ui/server/processManager.js +296 -0
- package/management-ui/server/server.js +188 -0
- package/management-ui/server/services/aws-monitor.js +413 -0
- package/management-ui/server/services/npm-registry.js +347 -0
- package/management-ui/server/services/template-engine.js +538 -0
- package/management-ui/server/utils/cliIntegration.js +220 -0
- package/management-ui/server/utils/environment/auditLogger.js +471 -0
- package/management-ui/server/utils/environment/awsParameterStore.js +264 -0
- package/management-ui/server/utils/environment/encryption.js +278 -0
- package/management-ui/server/utils/environment/envFileManager.js +286 -0
- package/management-ui/server/utils/import-commonjs.js +28 -0
- package/management-ui/server/utils/response.js +83 -0
- package/management-ui/server/websocket/handler.js +325 -0
- package/management-ui/src/App.jsx +51 -0
- package/management-ui/src/components/AppRouter.jsx +65 -0
- package/management-ui/src/components/Button.jsx +2 -0
- package/management-ui/src/components/Card.jsx +9 -0
- package/management-ui/src/components/EnvironmentCompare.jsx +400 -0
- package/management-ui/src/components/EnvironmentEditor.jsx +372 -0
- package/management-ui/src/components/EnvironmentImportExport.jsx +469 -0
- package/management-ui/src/components/EnvironmentSchema.jsx +491 -0
- package/management-ui/src/components/EnvironmentSecurity.jsx +463 -0
- package/management-ui/src/components/ErrorBoundary.jsx +73 -0
- package/management-ui/src/components/IntegrationCard.jsx +199 -0
- package/management-ui/src/components/IntegrationCardEnhanced.jsx +490 -0
- package/management-ui/src/components/IntegrationExplorer.jsx +379 -0
- package/management-ui/src/components/IntegrationStatus.jsx +235 -0
- package/management-ui/src/components/Layout.jsx +250 -0
- package/management-ui/src/components/LoadingSpinner.jsx +45 -0
- package/management-ui/src/components/RepositoryPicker.jsx +248 -0
- package/management-ui/src/components/SessionMonitor.jsx +255 -0
- package/management-ui/src/components/StatusBadge.jsx +70 -0
- package/management-ui/src/components/UserContextSwitcher.jsx +154 -0
- package/management-ui/src/components/UserSimulation.jsx +299 -0
- package/management-ui/src/components/Welcome.jsx +434 -0
- package/management-ui/src/components/codegen/APIEndpointGenerator.jsx +637 -0
- package/management-ui/src/components/codegen/APIModuleSelector.jsx +227 -0
- package/management-ui/src/components/codegen/CodeGenerationWizard.jsx +247 -0
- package/management-ui/src/components/codegen/CodePreviewEditor.jsx +316 -0
- package/management-ui/src/components/codegen/DynamicModuleForm.jsx +271 -0
- package/management-ui/src/components/codegen/FormBuilder.jsx +737 -0
- package/management-ui/src/components/codegen/IntegrationGenerator.jsx +855 -0
- package/management-ui/src/components/codegen/ProjectScaffoldWizard.jsx +797 -0
- package/management-ui/src/components/codegen/SchemaBuilder.jsx +303 -0
- package/management-ui/src/components/codegen/TemplateSelector.jsx +586 -0
- package/management-ui/src/components/codegen/index.js +10 -0
- package/management-ui/src/components/connections/ConnectionConfigForm.jsx +362 -0
- package/management-ui/src/components/connections/ConnectionHealthMonitor.jsx +182 -0
- package/management-ui/src/components/connections/ConnectionTester.jsx +200 -0
- package/management-ui/src/components/connections/EntityRelationshipMapper.jsx +292 -0
- package/management-ui/src/components/connections/OAuthFlow.jsx +204 -0
- package/management-ui/src/components/connections/index.js +5 -0
- package/management-ui/src/components/index.js +21 -0
- package/management-ui/src/components/monitoring/APIGatewayMetrics.jsx +222 -0
- package/management-ui/src/components/monitoring/LambdaMetrics.jsx +169 -0
- package/management-ui/src/components/monitoring/MetricsChart.jsx +197 -0
- package/management-ui/src/components/monitoring/MonitoringDashboard.jsx +393 -0
- package/management-ui/src/components/monitoring/SQSMetrics.jsx +246 -0
- package/management-ui/src/components/monitoring/index.js +6 -0
- package/management-ui/src/components/monitoring/monitoring.css +218 -0
- package/management-ui/src/components/theme-provider.jsx +52 -0
- package/management-ui/src/components/theme-toggle.jsx +39 -0
- package/management-ui/src/components/ui/badge.tsx +36 -0
- package/management-ui/src/components/ui/button.test.jsx +56 -0
- package/management-ui/src/components/ui/button.tsx +57 -0
- package/management-ui/src/components/ui/card.tsx +76 -0
- package/management-ui/src/components/ui/dropdown-menu.tsx +199 -0
- package/management-ui/src/components/ui/select.tsx +157 -0
- package/management-ui/src/components/ui/skeleton.jsx +15 -0
- package/management-ui/src/hooks/useFrigg.jsx +387 -0
- package/management-ui/src/hooks/useSocket.jsx +58 -0
- package/management-ui/src/index.css +194 -0
- package/management-ui/src/lib/utils.ts +6 -0
- package/management-ui/src/main.jsx +10 -0
- package/management-ui/src/pages/CodeGeneration.jsx +14 -0
- package/management-ui/src/pages/Connections.jsx +252 -0
- package/management-ui/src/pages/ConnectionsEnhanced.jsx +427 -0
- package/management-ui/src/pages/Dashboard.jsx +311 -0
- package/management-ui/src/pages/Environment.jsx +314 -0
- package/management-ui/src/pages/IntegrationConfigure.jsx +544 -0
- package/management-ui/src/pages/IntegrationDiscovery.jsx +479 -0
- package/management-ui/src/pages/IntegrationTest.jsx +494 -0
- package/management-ui/src/pages/Integrations.jsx +254 -0
- package/management-ui/src/pages/Monitoring.jsx +17 -0
- package/management-ui/src/pages/Simulation.jsx +155 -0
- package/management-ui/src/pages/Users.jsx +492 -0
- package/management-ui/src/services/api.js +41 -0
- package/management-ui/src/services/apiModuleService.js +193 -0
- package/management-ui/src/services/websocket-handlers.js +120 -0
- package/management-ui/src/test/api/project.test.js +273 -0
- package/management-ui/src/test/components/Welcome.test.jsx +378 -0
- package/management-ui/src/test/mocks/server.js +178 -0
- package/management-ui/src/test/setup.js +61 -0
- package/management-ui/src/test/utils/test-utils.jsx +134 -0
- package/management-ui/src/utils/repository.js +98 -0
- package/management-ui/src/utils/repository.test.js +118 -0
- package/management-ui/src/workflows/phase2-integration-workflows.js +884 -0
- package/management-ui/tailwind.config.js +63 -0
- package/management-ui/tsconfig.json +37 -0
- package/management-ui/tsconfig.node.json +10 -0
- package/management-ui/vite.config.js +26 -0
- package/management-ui/vitest.config.js +38 -0
- package/package.json +5 -5
- package/management-ui/dist/assets/index-CbM64Oba.js +0 -1221
- package/management-ui/dist/assets/index-CkvseXTC.css +0 -1
- /package/management-ui/{dist/assets/FriggLogo-B7Xx8ZW1.svg → src/assets/FriggLogo.svg} +0 -0
|
@@ -8,7 +8,7 @@ const { AWSDiscovery } = require('./aws-discovery');
|
|
|
8
8
|
* @returns {boolean} True if discovery should run
|
|
9
9
|
*/
|
|
10
10
|
const shouldRunDiscovery = (AppDefinition) => {
|
|
11
|
-
return AppDefinition.vpc?.enable === true ||
|
|
11
|
+
return AppDefinition.vpc?.enable === true ||
|
|
12
12
|
AppDefinition.encryption?.useDefaultKMSForFieldLevelEncryption === true ||
|
|
13
13
|
AppDefinition.ssm?.enable === true;
|
|
14
14
|
};
|
|
@@ -453,22 +453,34 @@ const createVPCInfrastructure = (AppDefinition) => {
|
|
|
453
453
|
const composeServerlessDefinition = async (AppDefinition) => {
|
|
454
454
|
// Store discovered resources
|
|
455
455
|
let discoveredResources = {};
|
|
456
|
+
<<<<<<< HEAD
|
|
457
|
+
=======
|
|
456
458
|
|
|
459
|
+
>>>>>>> 37c4892ee8a686eb7acfcd17c333b0ed73e1f120
|
|
457
460
|
// Run AWS discovery if needed
|
|
458
461
|
if (shouldRunDiscovery(AppDefinition)) {
|
|
459
462
|
console.log('🔍 Running AWS resource discovery for serverless template...');
|
|
460
463
|
try {
|
|
461
464
|
const region = process.env.AWS_REGION || 'us-east-1';
|
|
462
465
|
const discovery = new AWSDiscovery(region);
|
|
466
|
+
<<<<<<< HEAD
|
|
467
|
+
=======
|
|
463
468
|
|
|
469
|
+
>>>>>>> 37c4892ee8a686eb7acfcd17c333b0ed73e1f120
|
|
464
470
|
const config = {
|
|
465
471
|
vpc: AppDefinition.vpc || {},
|
|
466
472
|
encryption: AppDefinition.encryption || {},
|
|
467
473
|
ssm: AppDefinition.ssm || {}
|
|
468
474
|
};
|
|
475
|
+
<<<<<<< HEAD
|
|
476
|
+
|
|
477
|
+
discoveredResources = await discovery.discoverResources(config);
|
|
478
|
+
|
|
479
|
+
=======
|
|
469
480
|
|
|
470
481
|
discoveredResources = await discovery.discoverResources(config);
|
|
471
482
|
|
|
483
|
+
>>>>>>> 37c4892ee8a686eb7acfcd17c333b0ed73e1f120
|
|
472
484
|
console.log('✅ AWS discovery completed successfully!');
|
|
473
485
|
if (discoveredResources.defaultVpcId) {
|
|
474
486
|
console.log(` VPC: ${discoveredResources.defaultVpcId}`);
|
|
@@ -487,7 +499,10 @@ const composeServerlessDefinition = async (AppDefinition) => {
|
|
|
487
499
|
throw new Error(`AWS discovery failed: ${error.message}`);
|
|
488
500
|
}
|
|
489
501
|
}
|
|
502
|
+
<<<<<<< HEAD
|
|
503
|
+
=======
|
|
490
504
|
|
|
505
|
+
>>>>>>> 37c4892ee8a686eb7acfcd17c333b0ed73e1f120
|
|
491
506
|
const definition = {
|
|
492
507
|
frameworkVersion: '>=3.17.0',
|
|
493
508
|
service: AppDefinition.name || 'create-frigg-app',
|
|
@@ -611,6 +626,25 @@ const composeServerlessDefinition = async (AppDefinition) => {
|
|
|
611
626
|
},
|
|
612
627
|
],
|
|
613
628
|
},
|
|
629
|
+
health: {
|
|
630
|
+
handler: 'node_modules/@friggframework/core/handlers/routers/health.handler',
|
|
631
|
+
events: [
|
|
632
|
+
{
|
|
633
|
+
http: {
|
|
634
|
+
path: '/health',
|
|
635
|
+
method: 'GET',
|
|
636
|
+
cors: true,
|
|
637
|
+
},
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
http: {
|
|
641
|
+
path: '/health/{proxy+}',
|
|
642
|
+
method: 'GET',
|
|
643
|
+
cors: true,
|
|
644
|
+
},
|
|
645
|
+
},
|
|
646
|
+
],
|
|
647
|
+
},
|
|
614
648
|
},
|
|
615
649
|
resources: {
|
|
616
650
|
Resources: {
|
|
@@ -776,22 +810,39 @@ const composeServerlessDefinition = async (AppDefinition) => {
|
|
|
776
810
|
// Option 2: Use AWS Discovery (default behavior)
|
|
777
811
|
// VPC configuration using discovered or explicitly provided resources
|
|
778
812
|
const vpcConfig = {
|
|
813
|
+
<<<<<<< HEAD
|
|
814
|
+
securityGroupIds: AppDefinition.vpc.securityGroupIds ||
|
|
815
|
+
(discoveredResources.defaultSecurityGroupId ? [discoveredResources.defaultSecurityGroupId] : []),
|
|
816
|
+
subnetIds: AppDefinition.vpc.subnetIds ||
|
|
817
|
+
(discoveredResources.privateSubnetId1 && discoveredResources.privateSubnetId2 ?
|
|
818
|
+
[discoveredResources.privateSubnetId1, discoveredResources.privateSubnetId2] :
|
|
819
|
+
[])
|
|
820
|
+
=======
|
|
779
821
|
securityGroupIds: AppDefinition.vpc.securityGroupIds ||
|
|
780
822
|
(discoveredResources.defaultSecurityGroupId ? [discoveredResources.defaultSecurityGroupId] : []),
|
|
781
823
|
subnetIds: AppDefinition.vpc.subnetIds ||
|
|
782
824
|
(discoveredResources.privateSubnetId1 && discoveredResources.privateSubnetId2 ?
|
|
783
825
|
[discoveredResources.privateSubnetId1, discoveredResources.privateSubnetId2] :
|
|
784
826
|
[])
|
|
827
|
+
>>>>>>> 37c4892ee8a686eb7acfcd17c333b0ed73e1f120
|
|
785
828
|
};
|
|
786
829
|
|
|
787
830
|
// Set VPC config for Lambda functions only if we have valid subnet IDs
|
|
788
831
|
if (vpcConfig.subnetIds.length >= 2 && vpcConfig.securityGroupIds.length > 0) {
|
|
789
832
|
definition.provider.vpc = vpcConfig;
|
|
833
|
+
<<<<<<< HEAD
|
|
834
|
+
|
|
835
|
+
// Check if we have an existing NAT Gateway to use
|
|
836
|
+
if (!discoveredResources.existingNatGatewayId) {
|
|
837
|
+
// No existing NAT Gateway, create new resources
|
|
838
|
+
|
|
839
|
+
=======
|
|
790
840
|
|
|
791
841
|
// Check if we have an existing NAT Gateway to use
|
|
792
842
|
if (!discoveredResources.existingNatGatewayId) {
|
|
793
843
|
// No existing NAT Gateway, create new resources
|
|
794
844
|
|
|
845
|
+
>>>>>>> 37c4892ee8a686eb7acfcd17c333b0ed73e1f120
|
|
795
846
|
// Only create EIP if we don't have an existing one available
|
|
796
847
|
if (!discoveredResources.existingElasticIpAllocationId) {
|
|
797
848
|
definition.resources.Resources.FriggNATGatewayEIP = {
|
|
@@ -808,8 +859,13 @@ const composeServerlessDefinition = async (AppDefinition) => {
|
|
|
808
859
|
definition.resources.Resources.FriggNATGateway = {
|
|
809
860
|
Type: 'AWS::EC2::NatGateway',
|
|
810
861
|
Properties: {
|
|
862
|
+
<<<<<<< HEAD
|
|
863
|
+
AllocationId: discoveredResources.existingElasticIpAllocationId ||
|
|
864
|
+
{ 'Fn::GetAtt': ['FriggNATGatewayEIP', 'AllocationId'] },
|
|
865
|
+
=======
|
|
811
866
|
AllocationId: discoveredResources.existingElasticIpAllocationId ||
|
|
812
867
|
{ 'Fn::GetAtt': ['FriggNATGatewayEIP', 'AllocationId'] },
|
|
868
|
+
>>>>>>> 37c4892ee8a686eb7acfcd17c333b0ed73e1f120
|
|
813
869
|
SubnetId: discoveredResources.publicSubnetId || discoveredResources.privateSubnetId1, // Use first discovered subnet if no public subnet found
|
|
814
870
|
Tags: [
|
|
815
871
|
{ Key: 'Name', Value: '${self:service}-${self:provider.stage}-nat-gateway' }
|
|
@@ -841,6 +897,21 @@ const composeServerlessDefinition = async (AppDefinition) => {
|
|
|
841
897
|
// Associate Lambda subnets with NAT Gateway route table
|
|
842
898
|
definition.resources.Resources.FriggSubnet1RouteAssociation = {
|
|
843
899
|
Type: 'AWS::EC2::SubnetRouteTableAssociation',
|
|
900
|
+
<<<<<<< HEAD
|
|
901
|
+
Properties: {
|
|
902
|
+
SubnetId: vpcConfig.subnetIds[0],
|
|
903
|
+
RouteTableId: { Ref: 'FriggLambdaRouteTable' }
|
|
904
|
+
}
|
|
905
|
+
};
|
|
906
|
+
|
|
907
|
+
definition.resources.Resources.FriggSubnet2RouteAssociation = {
|
|
908
|
+
Type: 'AWS::EC2::SubnetRouteTableAssociation',
|
|
909
|
+
Properties: {
|
|
910
|
+
SubnetId: vpcConfig.subnetIds[1],
|
|
911
|
+
RouteTableId: { Ref: 'FriggLambdaRouteTable' }
|
|
912
|
+
}
|
|
913
|
+
};
|
|
914
|
+
=======
|
|
844
915
|
Properties: {
|
|
845
916
|
SubnetId: vpcConfig.subnetIds[0],
|
|
846
917
|
RouteTableId: { Ref: 'FriggLambdaRouteTable' }
|
|
@@ -854,10 +925,31 @@ const composeServerlessDefinition = async (AppDefinition) => {
|
|
|
854
925
|
RouteTableId: { Ref: 'FriggLambdaRouteTable' }
|
|
855
926
|
}
|
|
856
927
|
};
|
|
928
|
+
>>>>>>> 37c4892ee8a686eb7acfcd17c333b0ed73e1f120
|
|
857
929
|
|
|
858
930
|
// Add VPC endpoints for AWS service optimization (optional but recommended)
|
|
859
931
|
if (AppDefinition.vpc.enableVPCEndpoints !== false) {
|
|
860
932
|
definition.resources.Resources.VPCEndpointS3 = {
|
|
933
|
+
<<<<<<< HEAD
|
|
934
|
+
Type: 'AWS::EC2::VPCEndpoint',
|
|
935
|
+
Properties: {
|
|
936
|
+
VpcId: discoveredResources.defaultVpcId,
|
|
937
|
+
ServiceName: 'com.amazonaws.${self:provider.region}.s3',
|
|
938
|
+
VpcEndpointType: 'Gateway',
|
|
939
|
+
RouteTableIds: [{ Ref: 'FriggLambdaRouteTable' }]
|
|
940
|
+
}
|
|
941
|
+
};
|
|
942
|
+
|
|
943
|
+
definition.resources.Resources.VPCEndpointDynamoDB = {
|
|
944
|
+
Type: 'AWS::EC2::VPCEndpoint',
|
|
945
|
+
Properties: {
|
|
946
|
+
VpcId: discoveredResources.defaultVpcId,
|
|
947
|
+
ServiceName: 'com.amazonaws.${self:provider.region}.dynamodb',
|
|
948
|
+
VpcEndpointType: 'Gateway',
|
|
949
|
+
RouteTableIds: [{ Ref: 'FriggLambdaRouteTable' }]
|
|
950
|
+
}
|
|
951
|
+
};
|
|
952
|
+
=======
|
|
861
953
|
Type: 'AWS::EC2::VPCEndpoint',
|
|
862
954
|
Properties: {
|
|
863
955
|
VpcId: discoveredResources.defaultVpcId,
|
|
@@ -876,6 +968,7 @@ const composeServerlessDefinition = async (AppDefinition) => {
|
|
|
876
968
|
RouteTableIds: [{ Ref: 'FriggLambdaRouteTable' }]
|
|
877
969
|
}
|
|
878
970
|
};
|
|
971
|
+
>>>>>>> 37c4892ee8a686eb7acfcd17c333b0ed73e1f120
|
|
879
972
|
}
|
|
880
973
|
}
|
|
881
974
|
}
|
|
@@ -915,6 +1008,15 @@ const composeServerlessDefinition = async (AppDefinition) => {
|
|
|
915
1008
|
|
|
916
1009
|
// Add function for the integration
|
|
917
1010
|
definition.functions[integrationName] = {
|
|
1011
|
+
<<<<<<< HEAD
|
|
1012
|
+
handler: `node_modules/@friggframework/core/handlers/routers/integration-defined-routers.handlers.${integrationName}.handler`,
|
|
1013
|
+
events: [
|
|
1014
|
+
{
|
|
1015
|
+
http: {
|
|
1016
|
+
path: `/api/${integrationName}-integration/{proxy+}`,
|
|
1017
|
+
method: 'ANY',
|
|
1018
|
+
cors: true,
|
|
1019
|
+
=======
|
|
918
1020
|
handler: `node_modules/@friggframework/core/handlers/routers/integration-defined-routers.handlers.${integrationName}.handler`,
|
|
919
1021
|
events: [
|
|
920
1022
|
{
|
|
@@ -956,14 +1058,117 @@ const composeServerlessDefinition = async (AppDefinition) => {
|
|
|
956
1058
|
sqs: {
|
|
957
1059
|
arn: {
|
|
958
1060
|
'Fn::GetAtt': [queueReference, 'Arn'],
|
|
1061
|
+
>>>>>>> 37c4892ee8a686eb7acfcd17c333b0ed73e1f120
|
|
1062
|
+
},
|
|
1063
|
+
},
|
|
1064
|
+
],
|
|
1065
|
+
};
|
|
1066
|
+
|
|
1067
|
+
// Add SQS Queue for the integration
|
|
1068
|
+
const queueReference = `${integrationName.charAt(0).toUpperCase() + integrationName.slice(1)
|
|
1069
|
+
}Queue`;
|
|
1070
|
+
const queueName = `\${self:service}--\${self:provider.stage}-${queueReference}`;
|
|
1071
|
+
definition.resources.Resources[queueReference] = {
|
|
1072
|
+
Type: 'AWS::SQS::Queue',
|
|
1073
|
+
Properties: {
|
|
1074
|
+
QueueName: `\${self:custom.${queueReference}}`,
|
|
1075
|
+
MessageRetentionPeriod: 60,
|
|
1076
|
+
VisibilityTimeout: 1800, // 30 minutes
|
|
1077
|
+
RedrivePolicy: {
|
|
1078
|
+
maxReceiveCount: 1,
|
|
1079
|
+
deadLetterTargetArn: {
|
|
1080
|
+
'Fn::GetAtt': ['InternalErrorQueue', 'Arn'],
|
|
1081
|
+
},
|
|
1082
|
+
},
|
|
1083
|
+
},
|
|
1084
|
+
};
|
|
1085
|
+
|
|
1086
|
+
// Add Queue Worker for the integration
|
|
1087
|
+
const queueWorkerName = `${integrationName}QueueWorker`;
|
|
1088
|
+
definition.functions[queueWorkerName] = {
|
|
1089
|
+
handler: `node_modules/@friggframework/core/handlers/workers/integration-defined-workers.handlers.${integrationName}.queueWorker`,
|
|
1090
|
+
reservedConcurrency: 5,
|
|
1091
|
+
events: [
|
|
1092
|
+
{
|
|
1093
|
+
sqs: {
|
|
1094
|
+
arn: {
|
|
1095
|
+
'Fn::GetAtt': [queueReference, 'Arn'],
|
|
1096
|
+
},
|
|
1097
|
+
batchSize: 1,
|
|
959
1098
|
},
|
|
960
|
-
|
|
1099
|
+
},
|
|
1100
|
+
],
|
|
1101
|
+
timeout: 600,
|
|
1102
|
+
};
|
|
1103
|
+
|
|
1104
|
+
// Add Queue URL for the integration to the ENVironment variables
|
|
1105
|
+
definition.provider.environment = {
|
|
1106
|
+
...definition.provider.environment,
|
|
1107
|
+
[`${integrationName.toUpperCase()}_QUEUE_URL`]: {
|
|
1108
|
+
Ref: queueReference,
|
|
1109
|
+
},
|
|
1110
|
+
};
|
|
1111
|
+
|
|
1112
|
+
definition.custom[queueReference] = queueName;
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
// Discovery has already run successfully at this point if needed
|
|
1117
|
+
// The discoveredResources object contains all the necessary AWS resources
|
|
1118
|
+
|
|
1119
|
+
// Add websocket function if enabled
|
|
1120
|
+
if (AppDefinition.websockets?.enable === true) {
|
|
1121
|
+
definition.functions.defaultWebsocket = {
|
|
1122
|
+
handler: 'node_modules/@friggframework/core/handlers/routers/websocket.handler',
|
|
1123
|
+
events: [
|
|
1124
|
+
{
|
|
1125
|
+
websocket: {
|
|
1126
|
+
route: '$connect',
|
|
1127
|
+
},
|
|
1128
|
+
},
|
|
1129
|
+
{
|
|
1130
|
+
websocket: {
|
|
1131
|
+
route: '$default',
|
|
1132
|
+
},
|
|
1133
|
+
},
|
|
1134
|
+
{
|
|
1135
|
+
websocket: {
|
|
1136
|
+
route: '$disconnect',
|
|
1137
|
+
},
|
|
1138
|
+
},
|
|
1139
|
+
],
|
|
1140
|
+
};
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
<<<<<<< HEAD
|
|
1144
|
+
// Discovery has already run successfully at this point if needed
|
|
1145
|
+
// The discoveredResources object contains all the necessary AWS resources
|
|
1146
|
+
|
|
1147
|
+
// Add websocket function if enabled
|
|
1148
|
+
if (AppDefinition.websockets?.enable === true) {
|
|
1149
|
+
definition.functions.defaultWebsocket = {
|
|
1150
|
+
handler: 'node_modules/@friggframework/core/handlers/routers/websocket.handler',
|
|
1151
|
+
events: [
|
|
1152
|
+
{
|
|
1153
|
+
websocket: {
|
|
1154
|
+
route: '$connect',
|
|
1155
|
+
},
|
|
1156
|
+
},
|
|
1157
|
+
{
|
|
1158
|
+
websocket: {
|
|
1159
|
+
route: '$default',
|
|
1160
|
+
},
|
|
1161
|
+
},
|
|
1162
|
+
{
|
|
1163
|
+
websocket: {
|
|
1164
|
+
route: '$disconnect',
|
|
961
1165
|
},
|
|
962
1166
|
},
|
|
963
1167
|
],
|
|
964
|
-
timeout: 600,
|
|
965
1168
|
};
|
|
1169
|
+
}
|
|
966
1170
|
|
|
1171
|
+
=======
|
|
967
1172
|
// Add Queue URL for the integration to the ENVironment variables
|
|
968
1173
|
definition.provider.environment = {
|
|
969
1174
|
...definition.provider.environment,
|
|
@@ -1003,6 +1208,7 @@ const composeServerlessDefinition = async (AppDefinition) => {
|
|
|
1003
1208
|
};
|
|
1004
1209
|
}
|
|
1005
1210
|
|
|
1211
|
+
>>>>>>> 37c4892ee8a686eb7acfcd17c333b0ed73e1f120
|
|
1006
1212
|
// Discovery has already run successfully at this point if needed
|
|
1007
1213
|
// The discoveredResources object contains all the necessary AWS resources
|
|
1008
1214
|
|
|
@@ -31,7 +31,10 @@ describe('composeServerlessDefinition', () => {
|
|
|
31
31
|
|
|
32
32
|
// Mock process.argv to avoid offline mode during tests
|
|
33
33
|
process.argv = ['node', 'test'];
|
|
34
|
+
<<<<<<< HEAD
|
|
35
|
+
=======
|
|
34
36
|
|
|
37
|
+
>>>>>>> 37c4892ee8a686eb7acfcd17c333b0ed73e1f120
|
|
35
38
|
// Clear AWS_REGION for tests
|
|
36
39
|
delete process.env.AWS_REGION;
|
|
37
40
|
});
|
|
@@ -82,7 +85,10 @@ describe('composeServerlessDefinition', () => {
|
|
|
82
85
|
|
|
83
86
|
it('should use AWS_REGION environment variable when set', async () => {
|
|
84
87
|
process.env.AWS_REGION = 'eu-west-1';
|
|
88
|
+
<<<<<<< HEAD
|
|
89
|
+
=======
|
|
85
90
|
|
|
91
|
+
>>>>>>> 37c4892ee8a686eb7acfcd17c333b0ed73e1f120
|
|
86
92
|
const appDefinition = {
|
|
87
93
|
name: 'test-app',
|
|
88
94
|
integrations: []
|
|
@@ -96,7 +102,10 @@ describe('composeServerlessDefinition', () => {
|
|
|
96
102
|
|
|
97
103
|
it('should default to us-east-1 when AWS_REGION is not set', async () => {
|
|
98
104
|
delete process.env.AWS_REGION;
|
|
105
|
+
<<<<<<< HEAD
|
|
106
|
+
=======
|
|
99
107
|
|
|
108
|
+
>>>>>>> 37c4892ee8a686eb7acfcd17c333b0ed73e1f120
|
|
100
109
|
const appDefinition = {
|
|
101
110
|
name: 'test-app',
|
|
102
111
|
integrations: []
|
|
@@ -283,7 +292,10 @@ describe('composeServerlessDefinition', () => {
|
|
|
283
292
|
const result = await composeServerlessDefinition(appDefinition);
|
|
284
293
|
|
|
285
294
|
expect(result.provider.layers).toBeUndefined();
|
|
295
|
+
<<<<<<< HEAD
|
|
296
|
+
=======
|
|
286
297
|
|
|
298
|
+
>>>>>>> 37c4892ee8a686eb7acfcd17c333b0ed73e1f120
|
|
287
299
|
const ssmPermission = result.provider.iamRoleStatements.find(
|
|
288
300
|
statement => statement.Action && statement.Action.includes('ssm:GetParameter')
|
|
289
301
|
);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
root: true,
|
|
3
|
+
env: { browser: true, es2020: true },
|
|
4
|
+
extends: [
|
|
5
|
+
'eslint:recommended',
|
|
6
|
+
'@eslint/js/recommended',
|
|
7
|
+
'plugin:react/recommended',
|
|
8
|
+
'plugin:react/jsx-runtime',
|
|
9
|
+
'plugin:react-hooks/recommended',
|
|
10
|
+
],
|
|
11
|
+
ignorePatterns: ['dist', '.eslintrc.js'],
|
|
12
|
+
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
|
|
13
|
+
settings: { react: { version: '18.3' } },
|
|
14
|
+
plugins: ['react-refresh'],
|
|
15
|
+
rules: {
|
|
16
|
+
'react/jsx-no-target-blank': 'off',
|
|
17
|
+
'react-refresh/only-export-components': [
|
|
18
|
+
'warn',
|
|
19
|
+
{ allowConstantExport: true },
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
# Frigg Management UI
|
|
2
|
+
|
|
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.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
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
|
|
13
|
+
- **Responsive Design**: Mobile-friendly interface
|
|
14
|
+
- **Error Boundaries**: Robust error handling
|
|
15
|
+
|
|
16
|
+
## Tech Stack
|
|
17
|
+
|
|
18
|
+
- **React 18.3**: Modern React with hooks and functional components
|
|
19
|
+
- **Vite**: Fast development and build tooling
|
|
20
|
+
- **React Router**: Client-side routing
|
|
21
|
+
- **Tailwind CSS**: Utility-first CSS framework
|
|
22
|
+
- **Lucide React**: Modern icon library
|
|
23
|
+
- **Socket.io**: Real-time communication
|
|
24
|
+
- **Axios**: HTTP client
|
|
25
|
+
- **@friggframework/ui**: Shared UI components
|
|
26
|
+
|
|
27
|
+
## Getting Started
|
|
28
|
+
|
|
29
|
+
### Prerequisites
|
|
30
|
+
|
|
31
|
+
- Node.js 16+ and npm
|
|
32
|
+
- Running Frigg backend server
|
|
33
|
+
|
|
34
|
+
### Installation
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# Install dependencies
|
|
38
|
+
npm install
|
|
39
|
+
|
|
40
|
+
# Start development server (frontend only)
|
|
41
|
+
npm run dev
|
|
42
|
+
|
|
43
|
+
# Start both frontend and backend
|
|
44
|
+
npm run dev:server
|
|
45
|
+
|
|
46
|
+
# Build for production
|
|
47
|
+
npm run build
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Available Scripts
|
|
51
|
+
|
|
52
|
+
- `npm run dev` - Start Vite development server
|
|
53
|
+
- `npm run dev:server` - Start both frontend and backend concurrently
|
|
54
|
+
- `npm run build` - Build for production
|
|
55
|
+
- `npm run preview` - Preview production build
|
|
56
|
+
- `npm run server` - Start backend server only
|
|
57
|
+
- `npm run server:dev` - Start backend server with nodemon
|
|
58
|
+
- `npm run lint` - Run ESLint
|
|
59
|
+
- `npm run lint:fix` - Fix ESLint issues
|
|
60
|
+
- `npm run typecheck` - Run TypeScript type checking
|
|
61
|
+
|
|
62
|
+
## Project Structure
|
|
63
|
+
|
|
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
|
|
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
|
|
136
|
+
|
|
137
|
+
## Styling
|
|
138
|
+
|
|
139
|
+
This project uses Tailwind CSS for styling with:
|
|
140
|
+
|
|
141
|
+
- **Design System**: Consistent spacing, colors, and typography
|
|
142
|
+
- **Responsive Design**: Mobile-first approach
|
|
143
|
+
- **Component Variants**: Button and component style variants
|
|
144
|
+
- **Dark Mode Ready**: CSS custom properties for theming
|
|
145
|
+
|
|
146
|
+
### Custom Utilities
|
|
147
|
+
|
|
148
|
+
- `cn()`: Utility for combining Tailwind classes with conditional logic
|
|
149
|
+
|
|
150
|
+
## Error Handling
|
|
151
|
+
|
|
152
|
+
- **Error Boundaries**: React error boundaries catch component errors
|
|
153
|
+
- **API Error Handling**: Axios interceptors handle API errors
|
|
154
|
+
- **Loading States**: Loading spinners and disabled states
|
|
155
|
+
- **Validation**: Form validation and user feedback
|
|
156
|
+
|
|
157
|
+
## Development
|
|
158
|
+
|
|
159
|
+
### Code Style
|
|
160
|
+
|
|
161
|
+
- **ESLint**: Linting with React and React Hooks rules
|
|
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
|
|
173
|
+
|
|
174
|
+
## Building and Deployment
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
# Build for production
|
|
178
|
+
npm run build
|
|
179
|
+
|
|
180
|
+
# Preview production build
|
|
181
|
+
npm run preview
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
The build output will be in the `dist/` directory and can be served by any static file server.
|
|
185
|
+
|
|
186
|
+
## Environment Variables
|
|
187
|
+
|
|
188
|
+
The application automatically detects the environment:
|
|
189
|
+
|
|
190
|
+
- **Development**: API calls to `http://localhost:3001`
|
|
191
|
+
- **Production**: API calls to the same origin
|
|
192
|
+
|
|
193
|
+
## Contributing
|
|
194
|
+
|
|
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
|
|
200
|
+
|
|
201
|
+
## License
|
|
202
|
+
|
|
203
|
+
This project is part of the Frigg Framework and follows the same licensing terms.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema.json",
|
|
3
|
+
"style": "new-york",
|
|
4
|
+
"rsc": false,
|
|
5
|
+
"tsx": true,
|
|
6
|
+
"tailwind": {
|
|
7
|
+
"config": "tailwind.config.js",
|
|
8
|
+
"css": "src/index.css",
|
|
9
|
+
"baseColor": "neutral",
|
|
10
|
+
"cssVariables": true,
|
|
11
|
+
"prefix": ""
|
|
12
|
+
},
|
|
13
|
+
"aliases": {
|
|
14
|
+
"components": "@/components",
|
|
15
|
+
"utils": "@/lib/utils",
|
|
16
|
+
"ui": "@/components/ui",
|
|
17
|
+
"lib": "@/lib",
|
|
18
|
+
"hooks": "@/hooks"
|
|
19
|
+
},
|
|
20
|
+
"iconLibrary": "lucide"
|
|
21
|
+
}
|
|
@@ -5,10 +5,9 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>Frigg Management UI</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-CbM64Oba.js"></script>
|
|
9
|
-
<link rel="stylesheet" crossorigin href="/assets/index-CkvseXTC.css">
|
|
10
8
|
</head>
|
|
11
9
|
<body>
|
|
12
10
|
<div id="root"></div>
|
|
11
|
+
<script type="module" src="/src/main.jsx"></script>
|
|
13
12
|
</body>
|
|
14
13
|
</html>
|