# aws-samples/aws-three-tier-web-architecture-workshop architecture

> Architecture diagram of the GitHub repository aws-samples/aws-three-tier-web-architecture-workshop, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aws-samples/aws-three-tier-web-architecture-workshop
- Repository: https://github.com/aws-samples/aws-three-tier-web-architecture-workshop

## Overview

This repository is a workshop demo of a three-tier AWS web application. A browser user visits the React web tier; its home page presents the architecture, while the database demo sends transaction requests through the documented Nginx/API path to the Node.js service and Aurora MySQL. The app exposes transaction CRUD and a health check; the service performs SQL operations using configured database credentials. The README documents load balancers, EC2 tiers, health checks, and autoscaling, but their AWS provisioning is outside the provided application source. Links between those infrastructure components therefore cite the README.

Main entry points: [`application-code/web-tier/src/App.js`](https://github.com/aws-samples/aws-three-tier-web-architecture-workshop/blob/main/application-code/web-tier/src/App.js) (React app and routes), [`application-code/nginx.conf`](https://github.com/aws-samples/aws-three-tier-web-architecture-workshop/blob/main/application-code/nginx.conf) (Nginx web servers), [`application-code/app-tier/TransactionService.js`](https://github.com/aws-samples/aws-three-tier-web-architecture-workshop/blob/main/application-code/app-tier/TransactionService.js) (Transaction service), [`application-code/web-tier/src/components/DatabaseDemo/DatabaseDemo.js`](https://github.com/aws-samples/aws-three-tier-web-architecture-workshop/blob/main/application-code/web-tier/src/components/DatabaseDemo/DatabaseDemo.js) (Transaction demo)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web tier"]
  node_nginx["Nginx web servers<br/>[nginx.conf]"]
  node_react_app["React app and routes<br/>[App.js]"]
  node_home["Architecture home<br/>[Home.js]"]
  node_db_demo["Transaction demo<br/>[DatabaseDemo.js]"]
  node_menu["Navigation menu<br/>[Menu.js]"]
  node_menu_style["Menu styling<br/>[Menu.styled.js]"]
  node_burger["Menu toggle<br/>[Burger.js]"]
  node_burger_style["Toggle styling<br/>[Burger.styled.js]"]
end

subgraph group_api["Application tier"]
  node_express_api["Express API routes<br/>[index.js]"]
  node_transaction_service["Transaction service"]
  node_db_config["Database credentials<br/>[DbConfig.js]"]
end

subgraph group_data["Database tier"]
  node_aurora[("Aurora MySQL")]
end

subgraph group_aws["AWS infrastructure"]
  node_public_alb{{"Public load balancer"}}
  node_internal_alb{{"Internal load balancer"}}
  node_web_ec2["Web-tier EC2"]
  node_app_ec2["App-tier EC2"]
end

node_visitor(("Browser user"))

node_visitor -->|"requests pages"| node_public_alb
node_public_alb -->|"forwards traffic"| node_web_ec2
node_web_ec2 -->|"hosts"| node_nginx
node_nginx -->|"serves site"| node_react_app
node_react_app -->|"routes to"| node_home
node_react_app -->|"routes to"| node_db_demo
node_react_app -->|"renders"| node_menu
node_react_app -->|"renders"| node_burger
node_menu -->|"uses styles"| node_menu_style
node_burger -->|"uses styles"| node_burger_style
node_db_demo -->|"requests /api"| node_nginx
node_nginx -->|"redirects API calls"| node_internal_alb
node_internal_alb -->|"forwards traffic"| node_app_ec2
node_app_ec2 -->|"hosts"| node_express_api
node_express_api -->|"calls"| node_transaction_service
node_transaction_service -->|"loads credentials"| node_db_config
node_transaction_service -->|"queries transactions"| node_aurora

click node_nginx "https://github.com/aws-samples/aws-three-tier-web-architecture-workshop/blob/main/application-code/nginx.conf"
click node_react_app "https://github.com/aws-samples/aws-three-tier-web-architecture-workshop/blob/main/application-code/web-tier/src/App.js"
click node_home "https://github.com/aws-samples/aws-three-tier-web-architecture-workshop/blob/main/application-code/web-tier/src/components/Home/Home.js"
click node_db_demo "https://github.com/aws-samples/aws-three-tier-web-architecture-workshop/blob/main/application-code/web-tier/src/components/DatabaseDemo/DatabaseDemo.js"
click node_menu "https://github.com/aws-samples/aws-three-tier-web-architecture-workshop/blob/main/application-code/web-tier/src/components/Menu/Menu.js"
click node_menu_style "https://github.com/aws-samples/aws-three-tier-web-architecture-workshop/blob/main/application-code/web-tier/src/components/Menu/Menu.styled.js"
click node_burger "https://github.com/aws-samples/aws-three-tier-web-architecture-workshop/blob/main/application-code/web-tier/src/components/Burger/Burger.js"
click node_burger_style "https://github.com/aws-samples/aws-three-tier-web-architecture-workshop/blob/main/application-code/web-tier/src/components/Burger/Burger.styled.js"
click node_express_api "https://github.com/aws-samples/aws-three-tier-web-architecture-workshop/blob/main/application-code/app-tier/index.js"
click node_transaction_service "https://github.com/aws-samples/aws-three-tier-web-architecture-workshop/blob/main/application-code/app-tier/TransactionService.js"
click node_db_config "https://github.com/aws-samples/aws-three-tier-web-architecture-workshop/blob/main/application-code/app-tier/DbConfig.js"

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_nginx,node_react_app,node_home,node_db_demo,node_menu,node_menu_style,node_burger,node_burger_style,node_visitor toneBlue
class node_express_api,node_transaction_service,node_db_config toneAmber
class node_aurora toneMint
class node_public_alb,node_internal_alb,node_web_ec2,node_app_ec2 toneRose
```

## Components

### Web tier

- [Nginx web servers](https://github.com/aws-samples/aws-three-tier-web-architecture-workshop/blob/main/application-code/nginx.conf): `application-code/nginx.conf`
- [React app and routes](https://github.com/aws-samples/aws-three-tier-web-architecture-workshop/blob/main/application-code/web-tier/src/App.js): `application-code/web-tier/src/App.js`
- [Architecture home](https://github.com/aws-samples/aws-three-tier-web-architecture-workshop/blob/main/application-code/web-tier/src/components/Home/Home.js): `application-code/web-tier/src/components/Home/Home.js`
- [Transaction demo](https://github.com/aws-samples/aws-three-tier-web-architecture-workshop/blob/main/application-code/web-tier/src/components/DatabaseDemo/DatabaseDemo.js): `application-code/web-tier/src/components/DatabaseDemo/DatabaseDemo.js`
- [Navigation menu](https://github.com/aws-samples/aws-three-tier-web-architecture-workshop/blob/main/application-code/web-tier/src/components/Menu/Menu.js): `application-code/web-tier/src/components/Menu/Menu.js`
- [Menu styling](https://github.com/aws-samples/aws-three-tier-web-architecture-workshop/blob/main/application-code/web-tier/src/components/Menu/Menu.styled.js): `application-code/web-tier/src/components/Menu/Menu.styled.js`
- [Menu toggle](https://github.com/aws-samples/aws-three-tier-web-architecture-workshop/blob/main/application-code/web-tier/src/components/Burger/Burger.js): `application-code/web-tier/src/components/Burger/Burger.js`
- [Toggle styling](https://github.com/aws-samples/aws-three-tier-web-architecture-workshop/blob/main/application-code/web-tier/src/components/Burger/Burger.styled.js): `application-code/web-tier/src/components/Burger/Burger.styled.js`

### Application tier

- [Express API routes](https://github.com/aws-samples/aws-three-tier-web-architecture-workshop/blob/main/application-code/app-tier/index.js): `application-code/app-tier/index.js`
- [Transaction service](https://github.com/aws-samples/aws-three-tier-web-architecture-workshop/blob/main/application-code/app-tier/TransactionService.js): `application-code/app-tier/TransactionService.js`
- [Database credentials](https://github.com/aws-samples/aws-three-tier-web-architecture-workshop/blob/main/application-code/app-tier/DbConfig.js): `application-code/app-tier/DbConfig.js`

### Database tier

- **Aurora MySQL**

### AWS infrastructure

- **Public load balancer**
- **Internal load balancer**
- **Web-tier EC2**
- **App-tier EC2**

### Other components

- **Browser user**

## Connections

- Browser user → Public load balancer: requests pages (evidence: `README.md`)
- Public load balancer → Web-tier EC2: forwards traffic (evidence: `README.md`)
- Web-tier EC2 → Nginx web servers: hosts (evidence: `README.md`)
- Nginx web servers → React app and routes: serves site (evidence: `README.md`)
- React app and routes → Architecture home: routes to (evidence: `application-code/web-tier/src/App.js`)
- React app and routes → Transaction demo: routes to (evidence: `application-code/web-tier/src/App.js`)
- React app and routes → Navigation menu: renders (evidence: `application-code/web-tier/src/App.js`)
- React app and routes → Menu toggle: renders (evidence: `application-code/web-tier/src/App.js`)
- Navigation menu → Menu styling: uses styles (evidence: `application-code/web-tier/src/components/Menu/Menu.js`)
- Menu toggle → Toggle styling: uses styles (evidence: `application-code/web-tier/src/components/Burger/Burger.js`)
- Transaction demo → Nginx web servers: requests /api (evidence: `application-code/web-tier/src/components/DatabaseDemo/DatabaseDemo.js`)
- Nginx web servers → Internal load balancer: redirects API calls (evidence: `README.md`)
- Internal load balancer → App-tier EC2: forwards traffic (evidence: `README.md`)
- App-tier EC2 → Express API routes: hosts (evidence: `README.md`)
- Express API routes → Transaction service: calls (evidence: `application-code/app-tier/index.js`)
- Transaction service → Database credentials: loads credentials (evidence: `application-code/app-tier/TransactionService.js`)
- Transaction service → Aurora MySQL: queries transactions (evidence: `README.md`)
