# joshuaonaiwu/foodie-app architecture

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

- Interactive diagram: https://gitdiagram.com/joshuaonaiwu/foodie-app
- Repository: https://github.com/joshuaonaiwu/foodie-app

## Overview

Foodie is a small restaurant-discovery demo wrapped in a documented AWS delivery and observability platform. Its user workflow is login with a demo account, then browse restaurant menus and delivery estimates, with logout returning to login. The README also describes automated image delivery to ECS, smoke and load testing, and New Relic alerting. App behavior is supported by the sampled JavaScript; platform relationships are documented in the README, while infrastructure and workflow implementation details were not sampled.

Main entry points: [`.github/workflows/ci.yml`](https://github.com/joshuaonaiwu/foodie-app/blob/main/.github/workflows/ci.yml) (GitHub Actions), [`infra/ecs.tf`](https://github.com/joshuaonaiwu/foodie-app/blob/main/infra/ecs.tf) (ECS Fargate), [`foodieapp/src/main.js`](https://github.com/joshuaonaiwu/foodie-app/blob/main/foodieapp/src/main.js) (Demo login), [`infra`](https://github.com/joshuaonaiwu/foodie-app/tree/main/infra) (Terraform infrastructure)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Foodie app"]
  node_login["Demo login<br/>[main.js]"]
  node_catalog["Restaurant catalog<br/>[main.js]"]
  node_styles["App styles<br/>[styles.css]"]
end

subgraph group_delivery["Delivery platform"]
  node_actions["GitHub Actions<br/>[ci.yml]"]
  node_container["Docker image"]
  node_iac["Terraform infrastructure"]
  node_smoke["Smoke test<br/>[smoke.sh]"]
  node_load["k6 load test<br/>[load.js]"]
end

subgraph group_runtime["AWS runtime"]
  node_registry[("ECR registry<br/>[ecr.tf]")]
  node_alb["Application Load Balancer<br/>[alb.tf]"]
  node_ecs["ECS Fargate<br/>[ecs.tf]"]
  node_nginx["NGINX static server<br/>[nginx.conf]"]
end

subgraph group_observability["Observability"]
  node_newrelic["New Relic agent<br/>[ecs.tf]"]
  node_alerts["NRQL alerts"]
end

node_user(("Foodie user"))

node_user -->|"signs in"| node_login
node_login -->|"opens on success"| node_catalog
node_catalog -->|"logs out to"| node_login
node_login -->|"imports"| node_styles
node_actions -->|"builds image"| node_container
node_actions -->|"pushes image"| node_registry
node_actions -->|"runs apply"| node_iac
node_iac -->|"provisions"| node_ecs
node_ecs -->|"uses image"| node_registry
node_alb -->|"routes traffic"| node_ecs
node_ecs -->|"runs static serving"| node_nginx
node_actions -->|"runs after deploy"| node_smoke
node_actions -->|"runs load test"| node_load
node_load -->|"generates traffic"| node_alb
node_ecs -->|"runs sidecar"| node_newrelic
node_newrelic -->|"feeds signals"| node_alerts

click node_login "https://github.com/joshuaonaiwu/foodie-app/blob/main/foodieapp/src/main.js"
click node_catalog "https://github.com/joshuaonaiwu/foodie-app/blob/main/foodieapp/src/main.js"
click node_styles "https://github.com/joshuaonaiwu/foodie-app/blob/main/foodieapp/src/styles.css"
click node_actions "https://github.com/joshuaonaiwu/foodie-app/blob/main/.github/workflows/ci.yml"
click node_container "https://github.com/joshuaonaiwu/foodie-app/blob/main/Dockerfile"
click node_iac "https://github.com/joshuaonaiwu/foodie-app/tree/main/infra"
click node_smoke "https://github.com/joshuaonaiwu/foodie-app/blob/main/tests/smoke.sh"
click node_load "https://github.com/joshuaonaiwu/foodie-app/blob/main/tests/load.js"
click node_registry "https://github.com/joshuaonaiwu/foodie-app/blob/main/infra/ecr.tf"
click node_alb "https://github.com/joshuaonaiwu/foodie-app/blob/main/infra/alb.tf"
click node_ecs "https://github.com/joshuaonaiwu/foodie-app/blob/main/infra/ecs.tf"
click node_nginx "https://github.com/joshuaonaiwu/foodie-app/blob/main/nginx.conf"
click node_newrelic "https://github.com/joshuaonaiwu/foodie-app/blob/main/infra/ecs.tf"
click node_alerts "https://github.com/joshuaonaiwu/foodie-app/tree/main/infra"

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_styles,node_user toneBlue
class node_actions,node_container,node_iac,node_smoke,node_load toneAmber
class node_registry,node_alb,node_ecs,node_nginx toneMint
class node_newrelic,node_alerts toneRose
```

## Components

### Foodie app

- [Demo login](https://github.com/joshuaonaiwu/foodie-app/blob/main/foodieapp/src/main.js): `foodieapp/src/main.js`
- [Restaurant catalog](https://github.com/joshuaonaiwu/foodie-app/blob/main/foodieapp/src/main.js): `foodieapp/src/main.js`
- [App styles](https://github.com/joshuaonaiwu/foodie-app/blob/main/foodieapp/src/styles.css): `foodieapp/src/styles.css`

### Delivery platform

- [GitHub Actions](https://github.com/joshuaonaiwu/foodie-app/blob/main/.github/workflows/ci.yml): `.github/workflows/ci.yml`
- [Docker image](https://github.com/joshuaonaiwu/foodie-app/blob/main/Dockerfile): `Dockerfile`
- [Terraform infrastructure](https://github.com/joshuaonaiwu/foodie-app/tree/main/infra): `infra`
- [Smoke test](https://github.com/joshuaonaiwu/foodie-app/blob/main/tests/smoke.sh): `tests/smoke.sh`
- [k6 load test](https://github.com/joshuaonaiwu/foodie-app/blob/main/tests/load.js): `tests/load.js`

### AWS runtime

- [ECR registry](https://github.com/joshuaonaiwu/foodie-app/blob/main/infra/ecr.tf): `infra/ecr.tf`
- [Application Load Balancer](https://github.com/joshuaonaiwu/foodie-app/blob/main/infra/alb.tf): `infra/alb.tf`
- [ECS Fargate](https://github.com/joshuaonaiwu/foodie-app/blob/main/infra/ecs.tf): `infra/ecs.tf`
- [NGINX static server](https://github.com/joshuaonaiwu/foodie-app/blob/main/nginx.conf): `nginx.conf`

### Observability

- [New Relic agent](https://github.com/joshuaonaiwu/foodie-app/blob/main/infra/ecs.tf): `infra/ecs.tf`
- [NRQL alerts](https://github.com/joshuaonaiwu/foodie-app/tree/main/infra): `infra`

### Other components

- **Foodie user**

## Connections

- Foodie user → Demo login: signs in (evidence: `foodieapp/src/main.js`)
- Demo login → Restaurant catalog: opens on success (evidence: `foodieapp/src/main.js`)
- Restaurant catalog → Demo login: logs out to (evidence: `foodieapp/src/main.js`)
- Demo login → App styles: imports (evidence: `foodieapp/src/main.js`)
- GitHub Actions → Docker image: builds image (evidence: `README.md`)
- GitHub Actions → ECR registry: pushes image (evidence: `README.md`)
- GitHub Actions → Terraform infrastructure: runs apply (evidence: `README.md`)
- Terraform infrastructure → ECS Fargate: provisions (evidence: `README.md`)
- ECS Fargate → ECR registry: uses image (evidence: `README.md`)
- Application Load Balancer → ECS Fargate: routes traffic (evidence: `README.md`)
- ECS Fargate → NGINX static server: runs static serving (evidence: `README.md`)
- GitHub Actions → Smoke test: runs after deploy (evidence: `README.md`)
- GitHub Actions → k6 load test: runs load test (evidence: `README.md`)
- k6 load test → Application Load Balancer: generates traffic (evidence: `README.md`)
- ECS Fargate → New Relic agent: runs sidecar (evidence: `README.md`)
- New Relic agent → NRQL alerts: feeds signals (evidence: `README.md`)
