|
| 1 | +# Kainos Studio - High-Level Architecture |
| 2 | + |
| 3 | +```mermaid |
| 4 | +graph TB |
| 5 | + %% External Users |
| 6 | + Users[👥 End Users] |
| 7 | + |
| 8 | + %% GitHub CI/CD |
| 9 | + GitHub[🔄 GitHub Actions<br/>CI/CD Pipeline] |
| 10 | + |
| 11 | + %% AWS Infrastructure |
| 12 | + subgraph AWS["☁️ AWS Infrastructure"] |
| 13 | + direction TB |
| 14 | + subgraph AWSCompute["Compute Layer"] |
| 15 | + LambdaCore[⚡ Lambda<br/>Core Application] |
| 16 | + LambdaUpload[⚡ Lambda<br/>Upload Handler] |
| 17 | + end |
| 18 | + |
| 19 | + subgraph AWSStorage["Storage Layer"] |
| 20 | + S3KFD[🗄️ S3<br/>KFD Files] |
| 21 | + S3Forms[🗄️ S3<br/>Form Files] |
| 22 | + DynamoDB[🗃️ DynamoDB<br/>Sessions] |
| 23 | + end |
| 24 | + |
| 25 | + subgraph AWSMonitoring["Monitoring"] |
| 26 | + CloudWatch[📊 CloudWatch<br/>Logs & Metrics] |
| 27 | + end |
| 28 | + |
| 29 | + subgraph AWSSecurity["Security"] |
| 30 | + KMS[🔐 KMS<br/>Encryption] |
| 31 | + Secrets[🔑 Secrets Manager] |
| 32 | + end |
| 33 | + end |
| 34 | + |
| 35 | + %% Azure Infrastructure |
| 36 | + subgraph Azure["☁️ Azure Infrastructure"] |
| 37 | + direction TB |
| 38 | + subgraph AzureCompute["Compute Layer"] |
| 39 | + FunctionCore[⚡ Function App<br/>Core Application] |
| 40 | + FunctionUpload[⚡ Function App<br/>Upload Handler] |
| 41 | + end |
| 42 | + |
| 43 | + subgraph AzureStorage["Storage Layer"] |
| 44 | + StorageKFD[🗄️ Storage Account<br/>KFD Files] |
| 45 | + StorageForms[🗄️ Storage Account<br/>Form Files] |
| 46 | + CosmosDB[🗃️ Cosmos DB<br/>Sessions] |
| 47 | + end |
| 48 | + |
| 49 | + subgraph AzureMonitoring["Monitoring"] |
| 50 | + AppInsights[📊 Application Insights<br/>Monitoring] |
| 51 | + end |
| 52 | + |
| 53 | + subgraph AzureSecurity["Security"] |
| 54 | + KeyVault[🔐 Key Vault<br/>Secrets & Keys] |
| 55 | + end |
| 56 | + end |
| 57 | + |
| 58 | + %% Connections |
| 59 | + Users --> LambdaCore |
| 60 | + Users --> FunctionCore |
| 61 | + |
| 62 | + GitHub --> AWS |
| 63 | + GitHub --> Azure |
| 64 | + |
| 65 | + LambdaCore --> S3KFD |
| 66 | + LambdaCore --> S3Forms |
| 67 | + LambdaCore --> DynamoDB |
| 68 | + LambdaUpload --> S3KFD |
| 69 | + |
| 70 | + FunctionCore --> StorageKFD |
| 71 | + FunctionCore --> StorageForms |
| 72 | + FunctionCore --> CosmosDB |
| 73 | + FunctionUpload --> StorageKFD |
| 74 | + |
| 75 | + %% Monitoring connections |
| 76 | + LambdaCore -.-> CloudWatch |
| 77 | + LambdaUpload -.-> CloudWatch |
| 78 | + FunctionCore -.-> AppInsights |
| 79 | + FunctionUpload -.-> AppInsights |
| 80 | + |
| 81 | + %% Security connections |
| 82 | + LambdaCore -.-> KMS |
| 83 | + LambdaCore -.-> Secrets |
| 84 | + FunctionCore -.-> KeyVault |
| 85 | + |
| 86 | + %% Styling |
| 87 | + classDef aws fill:#FF9900,stroke:#232F3E,stroke-width:2px,color:#fff |
| 88 | + classDef azure fill:#0078D4,stroke:#fff,stroke-width:2px,color:#fff |
| 89 | + classDef app fill:#28A745,stroke:#fff,stroke-width:2px,color:#fff |
| 90 | + classDef external fill:#6C757D,stroke:#fff,stroke-width:2px,color:#fff |
| 91 | + |
| 92 | + class AWS,AWSCompute,AWSStorage,AWSMonitoring,AWSSecurity,LambdaCore,LambdaUpload,S3KFD,S3Forms,DynamoDB,CloudWatch,KMS,Secrets aws |
| 93 | + class Azure,AzureCompute,AzureStorage,AzureMonitoring,AzureSecurity,FunctionCore,FunctionUpload,StorageKFD,StorageForms,CosmosDB,AppInsights,KeyVault azure |
| 94 | + class Users,GitHub external |
| 95 | +``` |
| 96 | + |
| 97 | +## Architecture Overview |
| 98 | + |
| 99 | +### Multi-Cloud Design |
| 100 | +The Kainos Studio infrastructure supports deployment to both AWS and Azure, providing flexibility and avoiding vendor lock-in. |
| 101 | + |
| 102 | +### Core Components |
| 103 | + |
| 104 | +#### Compute Layer |
| 105 | +- **AWS**: Lambda functions for serverless execution |
| 106 | +- **Azure**: Function Apps for serverless execution |
| 107 | +- **Purpose**: Handle form processing, file uploads, and user interactions |
| 108 | + |
| 109 | +#### Storage Layer |
| 110 | +- **KFD Files**: Store Kainos Form Definition files |
| 111 | +- **Form Files**: Store user-submitted form data and attachments |
| 112 | +- **Sessions**: Maintain user session state and form progress |
| 113 | + |
| 114 | +#### Security Layer |
| 115 | +- **Encryption**: All data encrypted at rest and in transit |
| 116 | +- **Secrets Management**: Secure storage of application secrets and keys |
| 117 | +- **Access Control**: Least-privilege access patterns |
| 118 | + |
| 119 | +#### Monitoring Layer |
| 120 | +- **AWS**: CloudWatch for logs, metrics, and alarms |
| 121 | +- **Azure**: Application Insights for comprehensive monitoring |
| 122 | +- **Purpose**: Performance monitoring, error tracking, and operational insights |
| 123 | + |
| 124 | +### Data Flow |
| 125 | +1. Users interact with the application through serverless functions |
| 126 | +2. Functions process requests and store data in appropriate storage services |
| 127 | +3. Upload handlers manage file processing and storage |
| 128 | +4. All activities are monitored and logged for operational visibility |
| 129 | +5. CI/CD pipeline manages deployments across environments |
0 commit comments