@friggframework/devtools 2.0.0-next.4 → 2.0.0-next.41
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 +54 -0
- package/frigg-cli/deploy-command/index.js +175 -0
- 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 +332 -0
- package/frigg-cli/generate-command/terraform-generator.js +555 -0
- package/frigg-cli/generate-iam-command.js +115 -0
- package/frigg-cli/index.js +47 -1
- package/frigg-cli/index.test.js +1 -4
- package/frigg-cli/init-command/backend-first-handler.js +756 -0
- package/frigg-cli/init-command/index.js +93 -0
- package/frigg-cli/init-command/template-handler.js +143 -0
- package/frigg-cli/install-command/index.js +1 -4
- package/frigg-cli/package.json +51 -0
- package/frigg-cli/start-command/index.js +30 -4
- package/frigg-cli/start-command/start-command.test.js +155 -0
- package/frigg-cli/test/init-command.test.js +180 -0
- package/frigg-cli/test/npm-registry.test.js +319 -0
- package/frigg-cli/ui-command/index.js +154 -0
- package/frigg-cli/utils/app-resolver.js +319 -0
- package/frigg-cli/utils/backend-path.js +16 -17
- package/frigg-cli/utils/npm-registry.js +167 -0
- package/frigg-cli/utils/process-manager.js +199 -0
- package/frigg-cli/utils/repo-detection.js +405 -0
- package/infrastructure/DEPLOYMENT-INSTRUCTIONS.md +268 -0
- package/infrastructure/GENERATE-IAM-DOCS.md +278 -0
- package/infrastructure/IAM-POLICY-TEMPLATES.md +176 -0
- package/infrastructure/README.md +443 -0
- package/infrastructure/WEBSOCKET-CONFIGURATION.md +105 -0
- package/infrastructure/__tests__/fixtures/mock-aws-resources.js +391 -0
- package/infrastructure/__tests__/helpers/test-utils.js +277 -0
- package/infrastructure/aws-discovery.js +1176 -0
- package/infrastructure/aws-discovery.test.js +1220 -0
- package/infrastructure/build-time-discovery.js +206 -0
- package/infrastructure/build-time-discovery.test.js +378 -0
- package/infrastructure/create-frigg-infrastructure.js +3 -5
- package/infrastructure/env-validator.js +77 -0
- package/infrastructure/frigg-deployment-iam-stack.yaml +401 -0
- package/infrastructure/iam-generator.js +836 -0
- package/infrastructure/iam-generator.test.js +172 -0
- package/infrastructure/iam-policy-basic.json +218 -0
- package/infrastructure/iam-policy-full.json +288 -0
- package/infrastructure/integration.test.js +383 -0
- package/infrastructure/run-discovery.js +110 -0
- package/infrastructure/serverless-template.js +1493 -138
- package/infrastructure/serverless-template.test.js +1804 -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/docs/phase2-integration-guide.md +320 -0
- package/management-ui/index.html +13 -0
- package/management-ui/package-lock.json +16517 -0
- package/management-ui/package.json +76 -0
- package/management-ui/packages/devtools/frigg-cli/ui-command/index.js +302 -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 +876 -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 +1029 -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 +873 -0
- package/management-ui/server/middleware/errorHandler.js +93 -0
- package/management-ui/server/middleware/security.js +32 -0
- package/management-ui/server/processManager.js +296 -0
- package/management-ui/server/server.js +346 -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 +109 -0
- package/management-ui/src/assets/FriggLogo.svg +1 -0
- package/management-ui/src/components/AppRouter.jsx +65 -0
- package/management-ui/src/components/Button.jsx +70 -0
- package/management-ui/src/components/Card.jsx +97 -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 +481 -0
- package/management-ui/src/components/IntegrationCardEnhanced.jsx +770 -0
- package/management-ui/src/components/IntegrationExplorer.jsx +379 -0
- package/management-ui/src/components/IntegrationStatus.jsx +336 -0
- package/management-ui/src/components/Layout.jsx +716 -0
- package/management-ui/src/components/LoadingSpinner.jsx +113 -0
- package/management-ui/src/components/RepositoryPicker.jsx +248 -0
- package/management-ui/src/components/SessionMonitor.jsx +350 -0
- package/management-ui/src/components/StatusBadge.jsx +208 -0
- package/management-ui/src/components/UserContextSwitcher.jsx +212 -0
- package/management-ui/src/components/UserSimulation.jsx +327 -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 +601 -0
- package/management-ui/src/hooks/useSocket.jsx +58 -0
- package/management-ui/src/index.css +193 -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 +633 -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 +669 -0
- package/management-ui/src/pages/IntegrationDiscovery.jsx +567 -0
- package/management-ui/src/pages/IntegrationTest.jsx +742 -0
- package/management-ui/src/pages/Integrations.jsx +253 -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 +20 -9
- package/infrastructure/app-handler-helpers.js +0 -57
- package/infrastructure/backend-utils.js +0 -90
- package/infrastructure/routers/auth.js +0 -26
- package/infrastructure/routers/integration-defined-routers.js +0 -37
- package/infrastructure/routers/middleware/loadUser.js +0 -15
- package/infrastructure/routers/middleware/requireLoggedInUser.js +0 -12
- package/infrastructure/routers/user.js +0 -41
- package/infrastructure/routers/websocket.js +0 -55
- package/infrastructure/workers/integration-defined-workers.js +0 -24
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
# Phase 2 Integration Guide
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
This guide covers the complete integration of all Phase 2 features for the Frigg Management UI as specified in RFC 0001. Phase 2 introduces core features that transform the developer experience with visual tools for integration management, testing, and deployment.
|
|
6
|
+
|
|
7
|
+
## Phase 2 Core Features
|
|
8
|
+
|
|
9
|
+
### 1. Integration Discovery and Installation
|
|
10
|
+
|
|
11
|
+
The integration discovery system connects to the npm registry to find and install @friggframework modules.
|
|
12
|
+
|
|
13
|
+
#### Key Components:
|
|
14
|
+
- **IntegrationDiscoveryService**: Searches npm registry for Frigg integrations
|
|
15
|
+
- **IntegrationInstallerService**: Handles package installation and dependency management
|
|
16
|
+
- **UI Components**: Visual interface for browsing and installing integrations
|
|
17
|
+
|
|
18
|
+
#### Usage:
|
|
19
|
+
```javascript
|
|
20
|
+
// Discover integrations
|
|
21
|
+
const discoveries = await discoveryService.searchIntegrations({
|
|
22
|
+
query: 'hubspot',
|
|
23
|
+
limit: 20
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// Install integration
|
|
27
|
+
const result = await installerService.installIntegration({
|
|
28
|
+
packageName: '@friggframework/api-module-hubspot'
|
|
29
|
+
});
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### 2. Dummy User Management System
|
|
33
|
+
|
|
34
|
+
Create and manage test users for development and testing purposes.
|
|
35
|
+
|
|
36
|
+
#### Features:
|
|
37
|
+
- Generate unique test IDs for each user
|
|
38
|
+
- Create OAuth credentials for testing
|
|
39
|
+
- Bulk user creation support
|
|
40
|
+
- Complete isolation from production data
|
|
41
|
+
|
|
42
|
+
#### API Endpoints:
|
|
43
|
+
- `POST /api/users/dummy` - Create a dummy user
|
|
44
|
+
- `GET /api/users/dummy` - List all dummy users
|
|
45
|
+
- `POST /api/users/dummy/:id/credentials` - Generate test credentials
|
|
46
|
+
- `POST /api/users/dummy/bulk` - Create multiple users
|
|
47
|
+
|
|
48
|
+
### 3. Connection/Entity Management
|
|
49
|
+
|
|
50
|
+
Manage connections between users and integrations with full entity synchronization.
|
|
51
|
+
|
|
52
|
+
#### Capabilities:
|
|
53
|
+
- Create and manage user-integration connections
|
|
54
|
+
- Health monitoring for active connections
|
|
55
|
+
- Entity CRUD operations
|
|
56
|
+
- Bulk synchronization support
|
|
57
|
+
|
|
58
|
+
#### Connection Lifecycle:
|
|
59
|
+
1. Create connection with user credentials
|
|
60
|
+
2. Test connection health
|
|
61
|
+
3. Manage entities (contacts, deals, messages, etc.)
|
|
62
|
+
4. Monitor connection status
|
|
63
|
+
5. Handle refresh/reconnection
|
|
64
|
+
|
|
65
|
+
### 4. Environment Variable Editor
|
|
66
|
+
|
|
67
|
+
Visual interface for managing environment variables across development and production.
|
|
68
|
+
|
|
69
|
+
#### Features:
|
|
70
|
+
- Read and display current variables
|
|
71
|
+
- Mask sensitive values (passwords, keys, secrets)
|
|
72
|
+
- Validate variable names
|
|
73
|
+
- Differentiate local vs production environments
|
|
74
|
+
- Bulk update support
|
|
75
|
+
|
|
76
|
+
#### Security:
|
|
77
|
+
- Automatic masking of sensitive values
|
|
78
|
+
- Validation to prevent invalid variable names
|
|
79
|
+
- Production update confirmation required
|
|
80
|
+
- AWS Parameter Store integration for production
|
|
81
|
+
|
|
82
|
+
## Integration Workflows
|
|
83
|
+
|
|
84
|
+
### Complete Integration Setup Flow
|
|
85
|
+
|
|
86
|
+
```javascript
|
|
87
|
+
const workflow = await phase2Workflows.setupIntegration('hubspot', {
|
|
88
|
+
config: {
|
|
89
|
+
clientId: 'your-client-id',
|
|
90
|
+
clientSecret: 'your-client-secret'
|
|
91
|
+
},
|
|
92
|
+
testUserName: 'HubSpot Test User',
|
|
93
|
+
environment: 'development'
|
|
94
|
+
});
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
This workflow automatically:
|
|
98
|
+
1. Discovers integration details
|
|
99
|
+
2. Installs the package
|
|
100
|
+
3. Configures the integration
|
|
101
|
+
4. Creates a test user
|
|
102
|
+
5. Generates credentials
|
|
103
|
+
6. Creates a connection
|
|
104
|
+
7. Tests the connection
|
|
105
|
+
8. Sets up environment variables
|
|
106
|
+
|
|
107
|
+
### Bulk Integration Management
|
|
108
|
+
|
|
109
|
+
```javascript
|
|
110
|
+
const bulkResult = await phase2Workflows.bulkIntegrationSetup([
|
|
111
|
+
{ name: 'slack', options: { /* config */ } },
|
|
112
|
+
{ name: 'salesforce', options: { /* config */ } },
|
|
113
|
+
{ name: 'stripe', options: { /* config */ } }
|
|
114
|
+
], {
|
|
115
|
+
batchSize: 3 // Process in parallel
|
|
116
|
+
});
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Development Environment Setup
|
|
120
|
+
|
|
121
|
+
```javascript
|
|
122
|
+
const devEnv = await phase2Workflows.setupDevelopmentEnvironment({
|
|
123
|
+
projectType: 'saas',
|
|
124
|
+
integrations: ['stripe', 'hubspot', 'slack'],
|
|
125
|
+
testUserCount: 10,
|
|
126
|
+
mockDataTypes: ['contacts', 'messages', 'payments']
|
|
127
|
+
});
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Testing Phase 2 Features
|
|
131
|
+
|
|
132
|
+
### Integration Tests
|
|
133
|
+
|
|
134
|
+
Run the comprehensive integration test suite:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
npm run test:integration
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Key test areas:
|
|
141
|
+
- End-to-end user flows
|
|
142
|
+
- WebSocket real-time updates
|
|
143
|
+
- Concurrent operation handling
|
|
144
|
+
- Error recovery
|
|
145
|
+
- Data consistency
|
|
146
|
+
|
|
147
|
+
### Performance Benchmarks
|
|
148
|
+
|
|
149
|
+
Run performance benchmarks:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
npm run benchmark:phase2
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Benchmark metrics:
|
|
156
|
+
- Integration discovery speed
|
|
157
|
+
- Installation throughput
|
|
158
|
+
- API response times
|
|
159
|
+
- WebSocket latency
|
|
160
|
+
- Memory usage under load
|
|
161
|
+
- Concurrent user capacity
|
|
162
|
+
|
|
163
|
+
### Validation Tests
|
|
164
|
+
|
|
165
|
+
Ensure RFC compliance:
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
npm run test:validation
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Validates:
|
|
172
|
+
- All RFC requirements are met
|
|
173
|
+
- Security requirements
|
|
174
|
+
- Performance targets
|
|
175
|
+
- API contracts
|
|
176
|
+
- Migration compatibility
|
|
177
|
+
|
|
178
|
+
## Performance Optimization
|
|
179
|
+
|
|
180
|
+
### Caching Strategy
|
|
181
|
+
|
|
182
|
+
The discovery service implements a 1-hour cache for npm queries:
|
|
183
|
+
- Cold start: First request fetches from npm
|
|
184
|
+
- Cached: Subsequent requests use in-memory cache
|
|
185
|
+
- Cache invalidation: Manual or time-based
|
|
186
|
+
|
|
187
|
+
### Batch Processing
|
|
188
|
+
|
|
189
|
+
For optimal performance with multiple operations:
|
|
190
|
+
- Use bulk endpoints when available
|
|
191
|
+
- Process in configurable batch sizes
|
|
192
|
+
- Implement proper error handling per batch
|
|
193
|
+
|
|
194
|
+
### WebSocket Updates
|
|
195
|
+
|
|
196
|
+
Real-time updates for long-running operations:
|
|
197
|
+
- Installation progress
|
|
198
|
+
- Connection status changes
|
|
199
|
+
- Environment updates
|
|
200
|
+
- Error notifications
|
|
201
|
+
|
|
202
|
+
## Security Considerations
|
|
203
|
+
|
|
204
|
+
### Environment Variables
|
|
205
|
+
- Automatic masking of sensitive values
|
|
206
|
+
- Patterns detected: PASSWORD, SECRET, KEY, TOKEN, etc.
|
|
207
|
+
- Read-only access for discovery operations
|
|
208
|
+
- Production updates require explicit confirmation
|
|
209
|
+
|
|
210
|
+
### Test Data Isolation
|
|
211
|
+
- All dummy users marked with `isDummy: true`
|
|
212
|
+
- Test IDs include 'test' prefix
|
|
213
|
+
- Separate storage from production data
|
|
214
|
+
- No cross-contamination possible
|
|
215
|
+
|
|
216
|
+
### Input Validation
|
|
217
|
+
- Variable name validation (alphanumeric + underscore)
|
|
218
|
+
- Package name verification
|
|
219
|
+
- Credential format checking
|
|
220
|
+
- SQL injection prevention
|
|
221
|
+
|
|
222
|
+
## Migration from create-frigg-app
|
|
223
|
+
|
|
224
|
+
### Automated Migration
|
|
225
|
+
|
|
226
|
+
```javascript
|
|
227
|
+
const migration = await phase2Workflows.migrateProject('/path/to/project', {
|
|
228
|
+
preserveCustom: true,
|
|
229
|
+
integrationMapping: {
|
|
230
|
+
'old-integration': 'new-integration'
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### Manual Migration Steps
|
|
236
|
+
|
|
237
|
+
1. **Backup existing project**
|
|
238
|
+
2. **Update dependencies**:
|
|
239
|
+
```json
|
|
240
|
+
{
|
|
241
|
+
"devDependencies": {
|
|
242
|
+
"@friggframework/cli": "latest"
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
```
|
|
246
|
+
3. **Run migration command**:
|
|
247
|
+
```bash
|
|
248
|
+
frigg migrate --from-create-frigg-app
|
|
249
|
+
```
|
|
250
|
+
4. **Verify integration configurations**
|
|
251
|
+
5. **Update environment variables**
|
|
252
|
+
6. **Test all connections**
|
|
253
|
+
|
|
254
|
+
## Troubleshooting
|
|
255
|
+
|
|
256
|
+
### Common Issues
|
|
257
|
+
|
|
258
|
+
#### Integration Discovery Fails
|
|
259
|
+
- Check network connectivity
|
|
260
|
+
- Verify npm registry access
|
|
261
|
+
- Clear discovery cache
|
|
262
|
+
- Check for proxy settings
|
|
263
|
+
|
|
264
|
+
#### Connection Test Failures
|
|
265
|
+
- Verify credentials are correct
|
|
266
|
+
- Check integration configuration
|
|
267
|
+
- Review API rate limits
|
|
268
|
+
- Inspect WebSocket connection
|
|
269
|
+
|
|
270
|
+
#### Environment Variable Issues
|
|
271
|
+
- Ensure valid variable names
|
|
272
|
+
- Check file permissions for .env
|
|
273
|
+
- Verify AWS credentials for production
|
|
274
|
+
- Look for conflicting variables
|
|
275
|
+
|
|
276
|
+
### Debug Mode
|
|
277
|
+
|
|
278
|
+
Enable debug logging:
|
|
279
|
+
```bash
|
|
280
|
+
DEBUG=frigg:* npm run dev:server
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### Health Checks
|
|
284
|
+
|
|
285
|
+
Monitor system health:
|
|
286
|
+
```javascript
|
|
287
|
+
// API endpoint
|
|
288
|
+
GET /api/health
|
|
289
|
+
|
|
290
|
+
// Returns
|
|
291
|
+
{
|
|
292
|
+
"status": "healthy",
|
|
293
|
+
"services": {
|
|
294
|
+
"discovery": "operational",
|
|
295
|
+
"installer": "operational",
|
|
296
|
+
"websocket": "connected",
|
|
297
|
+
"environment": "configured"
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
## Best Practices
|
|
303
|
+
|
|
304
|
+
1. **Use Workflows**: Leverage the provided workflows for complex operations
|
|
305
|
+
2. **Monitor Performance**: Regularly run benchmarks to ensure optimal performance
|
|
306
|
+
3. **Test Thoroughly**: Use the comprehensive test suites before deployment
|
|
307
|
+
4. **Handle Errors**: Implement proper error handling for all async operations
|
|
308
|
+
5. **Cache Wisely**: Use caching for frequently accessed data
|
|
309
|
+
6. **Secure Sensitive Data**: Always mask sensitive environment variables
|
|
310
|
+
7. **Document Custom Integrations**: Maintain clear documentation for custom work
|
|
311
|
+
|
|
312
|
+
## Next Steps
|
|
313
|
+
|
|
314
|
+
After Phase 2 implementation:
|
|
315
|
+
|
|
316
|
+
1. **Phase 3**: Advanced features including production monitoring
|
|
317
|
+
2. **Phase 4**: Multi-framework UI support
|
|
318
|
+
3. **Phase 5**: Complete migration and deprecation of create-frigg-app
|
|
319
|
+
|
|
320
|
+
For questions or issues, refer to the [Frigg documentation](https://docs.frigg.dev) or open an issue on GitHub.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>Frigg Management UI</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="root"></div>
|
|
11
|
+
<script type="module" src="/src/main.jsx"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|