# femiblaze/foodie-platform-engineering architecture

> Architecture diagram of the GitHub repository femiblaze/foodie-platform-engineering, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/femiblaze/foodie-platform-engineering
- Repository: https://github.com/femiblaze/foodie-platform-engineering

## Overview

Foodie is both a demo food-delivery frontend and an AWS deployment example. The user workflow is login with a demo account, then browse restaurant menus; the documented delivery workflow builds an image, pushes it to ECR, updates ECS, and checks the live endpoint. Terraform provisions the runtime and supporting services. App behavior is grounded in the sampled JavaScript; infrastructure and deployment links are based on README descriptions because those source files were not sampled.

Main entry points: [`infra/ecs.tf`](https://github.com/femiblaze/foodie-platform-engineering/blob/main/infra/ecs.tf) (ECS service), [`.github/workflows/pipeline.yml`](https://github.com/femiblaze/foodie-platform-engineering/blob/main/.github/workflows/pipeline.yml) (Build and deploy), [`app/src/main.js`](https://github.com/femiblaze/foodie-platform-engineering/blob/main/app/src/main.js) (Demo login), [`infra/alb.tf`](https://github.com/femiblaze/foodie-platform-engineering/blob/main/infra/alb.tf) (Application load balancer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Foodie frontend"]
  node_login["Demo login<br/>[main.js]"]
  node_catalog["Restaurant menus<br/>[main.js]"]
  node_static["Static hosting<br/>[nginx.conf]"]
  node_image["Container image"]
end

subgraph group_delivery["Image delivery"]
  node_pipeline["Build and deploy<br/>[pipeline.yml]"]
end

subgraph group_runtime["AWS runtime"]
  node_registry["ECR repository<br/>[ecr.tf]"]
  node_cluster["ECS service<br/>[ecs.tf]"]
  node_scaling["Service scaling<br/>[autoscaling.tf]"]
  node_alb["Application load balancer<br/>[alb.tf]"]
  node_logs["CloudWatch logs<br/>[logging.tf]"]
  node_newrelic["New Relic sidecar<br/>[ecs.tf]"]
end

subgraph group_foundation["Cloud foundation"]
  node_oidc["GitHub OIDC role<br/>[oidc.tf]"]
  node_network["VPC and subnets<br/>[vpc.tf]"]
  node_security["Network security<br/>[security.tf]"]
  node_iam["ECS IAM roles<br/>[iam.tf]"]
  node_state[("Terraform state<br/>[backend.tf]")]
end

node_visitor(("Foodie visitor"))
node_push(("Code push"))
node_aws{{"AWS account"}}

node_visitor -->|"opens app"| node_login
node_login -->|"renders after login"| node_catalog
node_catalog -->|"logs out to"| node_login
node_push -->|"triggers"| node_pipeline
node_pipeline -->|"assumes role"| node_oidc
node_pipeline -->|"builds image"| node_image
node_pipeline -->|"pushes image"| node_registry
node_pipeline -->|"updates task"| node_cluster
node_pipeline -->|"smoke tests"| node_alb
node_visitor -->|"requests app"| node_alb
node_alb -->|"forwards traffic"| node_cluster
node_cluster -->|"serves content"| node_static
node_static -->|"delivers frontend"| node_login
node_cluster -->|"scales tasks"| node_scaling
node_cluster -->|"writes logs"| node_logs
node_cluster -->|"runs sidecar"| node_newrelic
node_aws -->|"provisioned by"| node_network
node_aws -->|"provisioned by"| node_security
node_aws -->|"provisioned by"| node_iam
node_aws -->|"provisioned by"| node_alb
node_aws -->|"provisioned by"| node_cluster
node_aws -->|"provisioned by"| node_registry
node_aws -->|"provisioned by"| node_logs
node_state -->|"stores state in"| node_aws

click node_login "https://github.com/femiblaze/foodie-platform-engineering/blob/main/app/src/main.js"
click node_catalog "https://github.com/femiblaze/foodie-platform-engineering/blob/main/app/src/main.js"
click node_static "https://github.com/femiblaze/foodie-platform-engineering/blob/main/nginx.conf"
click node_image "https://github.com/femiblaze/foodie-platform-engineering/blob/main/Dockerfile"
click node_pipeline "https://github.com/femiblaze/foodie-platform-engineering/blob/main/.github/workflows/pipeline.yml"
click node_oidc "https://github.com/femiblaze/foodie-platform-engineering/blob/main/infra/oidc.tf"
click node_registry "https://github.com/femiblaze/foodie-platform-engineering/blob/main/infra/ecr.tf"
click node_cluster "https://github.com/femiblaze/foodie-platform-engineering/blob/main/infra/ecs.tf"
click node_scaling "https://github.com/femiblaze/foodie-platform-engineering/blob/main/infra/autoscaling.tf"
click node_alb "https://github.com/femiblaze/foodie-platform-engineering/blob/main/infra/alb.tf"
click node_logs "https://github.com/femiblaze/foodie-platform-engineering/blob/main/infra/logging.tf"
click node_newrelic "https://github.com/femiblaze/foodie-platform-engineering/blob/main/infra/ecs.tf"
click node_network "https://github.com/femiblaze/foodie-platform-engineering/blob/main/infra/vpc.tf"
click node_security "https://github.com/femiblaze/foodie-platform-engineering/blob/main/infra/security.tf"
click node_iam "https://github.com/femiblaze/foodie-platform-engineering/blob/main/infra/iam.tf"
click node_state "https://github.com/femiblaze/foodie-platform-engineering/blob/main/infra/backend.tf"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_login,node_catalog,node_static,node_image toneBlue
class node_pipeline toneAmber
class node_registry,node_cluster,node_scaling,node_alb,node_logs,node_newrelic toneMint
class node_oidc,node_network,node_security,node_iam,node_state toneRose
class node_visitor,node_push,node_aws toneIndigo
```

## Components

### Foodie frontend

- [Demo login](https://github.com/femiblaze/foodie-platform-engineering/blob/main/app/src/main.js): `app/src/main.js`
- [Restaurant menus](https://github.com/femiblaze/foodie-platform-engineering/blob/main/app/src/main.js): `app/src/main.js`
- [Static hosting](https://github.com/femiblaze/foodie-platform-engineering/blob/main/nginx.conf): `nginx.conf`
- [Container image](https://github.com/femiblaze/foodie-platform-engineering/blob/main/Dockerfile): `Dockerfile`

### Image delivery

- [Build and deploy](https://github.com/femiblaze/foodie-platform-engineering/blob/main/.github/workflows/pipeline.yml): `.github/workflows/pipeline.yml`

### AWS runtime

- [ECR repository](https://github.com/femiblaze/foodie-platform-engineering/blob/main/infra/ecr.tf): `infra/ecr.tf`
- [ECS service](https://github.com/femiblaze/foodie-platform-engineering/blob/main/infra/ecs.tf): `infra/ecs.tf`
- [Service scaling](https://github.com/femiblaze/foodie-platform-engineering/blob/main/infra/autoscaling.tf): `infra/autoscaling.tf`
- [Application load balancer](https://github.com/femiblaze/foodie-platform-engineering/blob/main/infra/alb.tf): `infra/alb.tf`
- [CloudWatch logs](https://github.com/femiblaze/foodie-platform-engineering/blob/main/infra/logging.tf): `infra/logging.tf`
- [New Relic sidecar](https://github.com/femiblaze/foodie-platform-engineering/blob/main/infra/ecs.tf): `infra/ecs.tf`

### Cloud foundation

- [GitHub OIDC role](https://github.com/femiblaze/foodie-platform-engineering/blob/main/infra/oidc.tf): `infra/oidc.tf`
- [VPC and subnets](https://github.com/femiblaze/foodie-platform-engineering/blob/main/infra/vpc.tf): `infra/vpc.tf`
- [Network security](https://github.com/femiblaze/foodie-platform-engineering/blob/main/infra/security.tf): `infra/security.tf`
- [ECS IAM roles](https://github.com/femiblaze/foodie-platform-engineering/blob/main/infra/iam.tf): `infra/iam.tf`
- [Terraform state](https://github.com/femiblaze/foodie-platform-engineering/blob/main/infra/backend.tf): `infra/backend.tf`

### Other components

- **Foodie visitor**
- **Code push**
- **AWS account**

## Connections

- Foodie visitor → Demo login: opens app (evidence: `README.md`)
- Demo login → Restaurant menus: renders after login (evidence: `app/src/main.js`)
- Restaurant menus → Demo login: logs out to (evidence: `app/src/main.js`)
- Code push → Build and deploy: triggers (evidence: `README.md`)
- Build and deploy → GitHub OIDC role: assumes role (evidence: `README.md`)
- Build and deploy → Container image: builds image (evidence: `README.md`)
- Build and deploy → ECR repository: pushes image (evidence: `README.md`)
- Build and deploy → ECS service: updates task (evidence: `README.md`)
- Build and deploy → Application load balancer: smoke tests (evidence: `README.md`)
- Foodie visitor → Application load balancer: requests app (evidence: `README.md`)
- Application load balancer → ECS service: forwards traffic (evidence: `README.md`)
- ECS service → Static hosting: serves content (evidence: `README.md`)
- Static hosting → Demo login: delivers frontend (evidence: `README.md`)
- ECS service → Service scaling: scales tasks (evidence: `README.md`)
- ECS service → CloudWatch logs: writes logs (evidence: `README.md`)
- ECS service → New Relic sidecar: runs sidecar (evidence: `README.md`)
- AWS account → VPC and subnets: provisioned by (evidence: `README.md`)
- AWS account → Network security: provisioned by (evidence: `README.md`)
- AWS account → ECS IAM roles: provisioned by (evidence: `README.md`)
- AWS account → Application load balancer: provisioned by (evidence: `README.md`)
- AWS account → ECS service: provisioned by (evidence: `README.md`)
- AWS account → ECR repository: provisioned by (evidence: `README.md`)
- AWS account → CloudWatch logs: provisioned by (evidence: `README.md`)
- Terraform state → AWS account: stores state in (evidence: `README.md`)
