Skip to content

Commit 2aed824

Browse files
committed
refactor: replace Draw.io diagrams with high-level Mermaid diagrams
- Remove Draw.io files for better version control - Add high-level architecture diagram with AWS/Azure components - Add deployment flow diagrams for dev, staging, and production - Use Mermaid syntax for better GitHub integration and visibility - Include comprehensive documentation for each diagram - Maintain consistent color coding (AWS=orange, Azure=blue)
1 parent 59dc262 commit 2aed824

8 files changed

+456
-379
lines changed

playbook/diagrams/dev-deployment-flow.drawio

Lines changed: 0 additions & 99 deletions
This file was deleted.
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Development Environment - Deployment Flow
2+
3+
```mermaid
4+
flowchart LR
5+
%% Development Flow
6+
Dev[👨‍💻 Developer] --> Push[📤 Git Push<br/>Feature Branch]
7+
Push --> GHA[🔄 GitHub Actions<br/>Workflow Triggered]
8+
GHA --> Validate[✅ Pre-commit Checks<br/>& Validation]
9+
Validate --> Plan[📋 Terraform Plan<br/>Dev Environment]
10+
Plan --> Security[🔒 Security Scan<br/>Checkov]
11+
Security --> Deploy[🚀 Auto Deploy<br/>to Development]
12+
Deploy --> Test[🧪 Automated Tests<br/>Unit & Integration]
13+
Test --> Notify[📧 Notification<br/>to Developer]
14+
Notify --> Dev
15+
16+
%% Conditional paths
17+
Validate -->|❌ Fails| Fix[🔧 Fix Issues]
18+
Security -->|❌ Fails| Fix
19+
Test -->|❌ Fails| Fix
20+
Fix --> Dev
21+
22+
%% Styling
23+
classDef success fill:#28A745,stroke:#fff,stroke-width:2px,color:#fff
24+
classDef process fill:#17A2B8,stroke:#fff,stroke-width:2px,color:#fff
25+
classDef validation fill:#FFC107,stroke:#212529,stroke-width:2px,color:#212529
26+
classDef failure fill:#DC3545,stroke:#fff,stroke-width:2px,color:#fff
27+
classDef user fill:#6C757D,stroke:#fff,stroke-width:2px,color:#fff
28+
29+
class Deploy,Test,Notify success
30+
class GHA,Plan process
31+
class Validate,Security validation
32+
class Fix failure
33+
class Dev user
34+
```
35+
36+
## Development Deployment Characteristics
37+
38+
### Trigger Conditions
39+
- **Event**: Push to any feature branch
40+
- **Frequency**: On every commit
41+
- **Approval**: None required
42+
43+
### Workflow Steps
44+
45+
1. **Code Push**: Developer pushes changes to feature branch
46+
2. **Workflow Trigger**: GitHub Actions automatically starts
47+
3. **Pre-commit Validation**:
48+
- Code formatting checks
49+
- Terraform syntax validation
50+
- Basic linting
51+
4. **Terraform Plan**: Generate infrastructure changes preview
52+
5. **Security Scan**: Checkov security analysis
53+
6. **Auto Deployment**: Deploy to development environment
54+
7. **Testing**: Run automated test suite
55+
8. **Notification**: Inform developer of results
56+
57+
### Environment Characteristics
58+
59+
| Aspect | Configuration |
60+
|--------|---------------|
61+
| **Infrastructure** | Minimal resources for cost efficiency |
62+
| **Monitoring** | Basic logging and metrics |
63+
| **Security** | Standard encryption, basic access controls |
64+
| **Availability** | Single AZ, no redundancy |
65+
| **Data Retention** | 7-30 days |
66+
67+
### Success Criteria
68+
- ✅ All validation checks pass
69+
- ✅ Security scan shows no critical issues
70+
- ✅ Deployment completes successfully
71+
- ✅ Basic functionality tests pass
72+
- ✅ Developer receives success notification
73+
74+
### Failure Handling
75+
- ❌ Immediate notification to developer
76+
- 🔧 Automatic rollback if deployment fails
77+
- 📝 Detailed error logs provided
78+
- 🔄 Easy re-trigger after fixes

playbook/diagrams/kainos-studio-architecture.drawio

Lines changed: 0 additions & 41 deletions
This file was deleted.
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
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

Comments
 (0)