AWS Production Architecture
Complete AWS infrastructure for the MiFamilias platform.
flowchart TB
subgraph Internet
Users["Users"]
end
subgraph AWS["AWS Cloud (eu-west-2)"]
subgraph Edge["Edge Services"]
Route53["Route53 DNS"]
CF["CloudFront CDN"]
WAF["WAF"]
end
subgraph Auth["Authentication"]
Cognito["Cognito User Pool"]
CognitoID["Cognito Identity Pool"]
end
subgraph API["API Layer"]
APIG["API Gateway"]
Lambda1["Lambda: Users"]
Lambda2["Lambda: Families"]
Lambda3["Lambda: Content"]
Lambda4["Lambda: Capsules"]
end
subgraph Data["Data Layer"]
DDB[("DynamoDB")]
S3Upload["S3: Uploads"]
S3Process["S3: Processed"]
S3Content["S3: Content"]
OS["OpenSearch"]
end
subgraph Media["Media Processing"]
MC["MediaConvert"]
Transcribe["Transcribe"]
end
subgraph Events["Event Processing"]
EB["EventBridge"]
SQS["SQS Queues"]
SNS["SNS Topics"]
end
subgraph Monitoring["Monitoring"]
CW["CloudWatch"]
XRay["X-Ray"]
end
end
Users --> Route53
Route53 --> CF
CF --> WAF
WAF --> APIG
CF --> S3Content
APIG --> Cognito
Cognito --> CognitoID
APIG --> Lambda1 & Lambda2 & Lambda3 & Lambda4
Lambda1 & Lambda2 & Lambda3 & Lambda4 --> DDB
Lambda3 --> S3Upload
S3Upload --> MC
MC --> S3Process
S3Process --> Transcribe
Transcribe --> OS
EB --> SQS
SQS --> Lambda4
Lambda1 & Lambda2 & Lambda3 & Lambda4 --> CW
Local Development Environment
Docker-based local setup that mirrors AWS services.
flowchart TB
subgraph Browser["Development Machine"]
Dev["Developer"]
App["Ionic App :4200"]
API["Backend API :3000"]
end
subgraph Docker["Docker Compose"]
subgraph Proxy["Reverse Proxy"]
Traefik["Traefik :443"]
end
subgraph Storage["Storage Services"]
MinIO["MinIO (S3) :9000"]
DynamoDB["DynamoDB Local :8000"]
Redis["Redis :6379"]
end
subgraph Search["Search"]
OpenSearch["OpenSearch :9200"]
end
subgraph AWS["AWS Emulation"]
LocalStack["LocalStack :4566"]
end
subgraph Media["Media"]
FFmpeg["FFmpeg Worker"]
end
subgraph Email["Email"]
Mailpit["Mailpit :8025"]
end
end
subgraph RealAWS["AWS (Dev Pool)"]
CognitoDev["Cognito Dev Pool"]
end
Dev --> App
App --> Traefik
Traefik --> API
API --> MinIO
API --> DynamoDB
API --> Redis
API --> OpenSearch
API --> LocalStack
MinIO --> FFmpeg
API --> CognitoDev
API --> Mailpit
Service Parity
Same code runs in both environments with configuration-only differences.
flowchart LR
subgraph Code["Application Code"]
Provider["Service Provider Interface"]
end
subgraph Local["Local Environment"]
MinIO["MinIO"]
DDBLocal["DynamoDB Local"]
LSStack["LocalStack"]
FFmpeg["FFmpeg"]
Mailpit["Mailpit"]
end
subgraph AWS["AWS Environment"]
S3["Amazon S3"]
DDB["DynamoDB"]
SQS["SQS/SNS"]
MC["MediaConvert"]
SES["SES"]
end
Provider --> |S3_ENDPOINT set| MinIO
Provider --> |S3_ENDPOINT unset| S3
Provider --> |DYNAMODB_ENDPOINT set| DDBLocal
Provider --> |DYNAMODB_ENDPOINT unset| DDB
Provider --> |LOCALSTACK_ENDPOINT set| LSStack
Provider --> |LOCALSTACK_ENDPOINT unset| SQS
Provider --> |Local| FFmpeg
Provider --> |AWS| MC
Provider --> |Local| Mailpit
Provider --> |AWS| SES
CDK Stack Dependencies
AWS CDK stacks and their deployment order.
flowchart TD
Auth["AuthStack\n(Cognito)"]
Storage["StorageStack\n(S3 + DynamoDB)"]
API["ApiStack\n(API Gateway + Lambdas)"]
Media["MediaStack\n(MediaConvert + Transcribe)"]
Monitoring["MonitoringStack\n(CloudWatch)"]
Auth --> API
Storage --> API
Storage --> Media
API --> Monitoring
Storage --> Monitoring
Service Mapping
| Purpose | AWS Service | Local Emulation | Port |
|---|---|---|---|
| Object Storage | S3 | MinIO | 9000, 9001 |
| Database | DynamoDB | DynamoDB Local | 8000 |
| Authentication | Cognito | Real AWS Dev Pool | - |
| Video Processing | MediaConvert | FFmpeg Worker | - |
| Search | OpenSearch Service | OpenSearch | 9200 |
| SES | Mailpit | 1025, 8025 | |
| Queues/Events | SQS/SNS/EventBridge | LocalStack | 4566 |
| Caching | ElastiCache | Redis | 6379 |