# sandeep-9553/aws-3-tier-web-app architecture

> Architecture diagram of the GitHub repository sandeep-9553/aws-3-tier-web-app, 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/sandeep-9553/aws-3-tier-web-app
- Repository: https://github.com/sandeep-9553/aws-3-tier-web-app

## Overview

This repository demonstrates a two-tier AWS deployment: a public PHP registration application writes user records to a MySQL database in a private subnet. The README documents the surrounding network, compute, and security design; the sampled PHP source shows the registration and database interaction. Infrastructure relationships below are documented in the README, not verified from deployment code.

Main entry points: [`README.md`](https://github.com/sandeep-9553/aws-3-tier-web-app/blob/main/README.md) (Database EC2), [`index.php`](https://github.com/sandeep-9553/aws-3-tier-web-app/blob/main/index.php) (Registration handler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_network["Network &amp; Routing"]
  node_vpc["VPC<br/>[README.md]"]
  node_public_subnet["Public subnet<br/>[README.md]"]
  node_private_subnet["Private subnet<br/>[README.md]"]
  node_internet_gateway["Internet gateway<br/>[README.md]"]
  node_nat_gateway["NAT gateway<br/>[README.md]"]
  node_public_routes["Public route table<br/>[README.md]"]
  node_private_routes["Private route table<br/>[README.md]"]
end

subgraph group_compute["Compute &amp; Security"]
  node_web_ec2["Web EC2<br/>[README.md]"]
  node_database_ec2["Database EC2<br/>[README.md]"]
  node_security_groups["Security groups<br/>[README.md]"]
end

subgraph group_appdata["Application &amp; Data"]
  node_registration["Registration handler<br/>[index.php]"]
  node_mysql[("MySQL loginapp<br/>[README.md]")]
end

node_visitor(("Web visitor"))

node_visitor -->|"submits form"| node_registration
node_registration -->|"connects and inserts"| node_mysql
node_vpc -->|"contains"| node_public_subnet
node_vpc -->|"contains"| node_private_subnet
node_public_subnet -->|"hosts"| node_web_ec2
node_private_subnet -->|"hosts"| node_database_ec2
node_database_ec2 -->|"runs"| node_mysql
node_internet_gateway -->|"attaches to"| node_vpc
node_public_routes -->|"routes through"| node_internet_gateway
node_private_routes -->|"routes through"| node_nat_gateway
node_nat_gateway -->|"allows outbound updates"| node_visitor
node_security_groups -->|"controls ingress"| node_database_ec2
node_security_groups -->|"protects instance"| node_web_ec2
node_web_ec2 -->|"connects on 3306"| node_database_ec2

click node_vpc "https://github.com/sandeep-9553/aws-3-tier-web-app/blob/main/README.md"
click node_public_subnet "https://github.com/sandeep-9553/aws-3-tier-web-app/blob/main/README.md"
click node_private_subnet "https://github.com/sandeep-9553/aws-3-tier-web-app/blob/main/README.md"
click node_internet_gateway "https://github.com/sandeep-9553/aws-3-tier-web-app/blob/main/README.md"
click node_nat_gateway "https://github.com/sandeep-9553/aws-3-tier-web-app/blob/main/README.md"
click node_public_routes "https://github.com/sandeep-9553/aws-3-tier-web-app/blob/main/README.md"
click node_private_routes "https://github.com/sandeep-9553/aws-3-tier-web-app/blob/main/README.md"
click node_web_ec2 "https://github.com/sandeep-9553/aws-3-tier-web-app/blob/main/README.md"
click node_database_ec2 "https://github.com/sandeep-9553/aws-3-tier-web-app/blob/main/README.md"
click node_security_groups "https://github.com/sandeep-9553/aws-3-tier-web-app/blob/main/README.md"
click node_registration "https://github.com/sandeep-9553/aws-3-tier-web-app/blob/main/index.php"
click node_mysql "https://github.com/sandeep-9553/aws-3-tier-web-app/blob/main/README.md"

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_vpc,node_public_subnet,node_private_subnet,node_internet_gateway,node_nat_gateway,node_public_routes,node_private_routes toneBlue
class node_web_ec2,node_database_ec2,node_security_groups toneAmber
class node_registration,node_mysql toneMint
class node_visitor toneIndigo
```

## Components

### Network & Routing

- [VPC](https://github.com/sandeep-9553/aws-3-tier-web-app/blob/main/README.md): `README.md`
- [Public subnet](https://github.com/sandeep-9553/aws-3-tier-web-app/blob/main/README.md): `README.md`
- [Private subnet](https://github.com/sandeep-9553/aws-3-tier-web-app/blob/main/README.md): `README.md`
- [Internet gateway](https://github.com/sandeep-9553/aws-3-tier-web-app/blob/main/README.md): `README.md`
- [NAT gateway](https://github.com/sandeep-9553/aws-3-tier-web-app/blob/main/README.md): `README.md`
- [Public route table](https://github.com/sandeep-9553/aws-3-tier-web-app/blob/main/README.md): `README.md`
- [Private route table](https://github.com/sandeep-9553/aws-3-tier-web-app/blob/main/README.md): `README.md`

### Compute & Security

- [Web EC2](https://github.com/sandeep-9553/aws-3-tier-web-app/blob/main/README.md): `README.md`
- [Database EC2](https://github.com/sandeep-9553/aws-3-tier-web-app/blob/main/README.md): `README.md`
- [Security groups](https://github.com/sandeep-9553/aws-3-tier-web-app/blob/main/README.md): `README.md`

### Application & Data

- [Registration handler](https://github.com/sandeep-9553/aws-3-tier-web-app/blob/main/index.php): `index.php`
- [MySQL loginapp](https://github.com/sandeep-9553/aws-3-tier-web-app/blob/main/README.md): `README.md`

### Other components

- **Web visitor**

## Connections

- Web visitor → Registration handler: submits form (evidence: `README.md`)
- Registration handler → MySQL loginapp: connects and inserts (evidence: `index.php`)
- VPC → Public subnet: contains (evidence: `README.md`)
- VPC → Private subnet: contains (evidence: `README.md`)
- Public subnet → Web EC2: hosts (evidence: `README.md`)
- Private subnet → Database EC2: hosts (evidence: `README.md`)
- Database EC2 → MySQL loginapp: runs (evidence: `README.md`)
- Internet gateway → VPC: attaches to (evidence: `README.md`)
- Public route table → Internet gateway: routes through (evidence: `README.md`)
- Private route table → NAT gateway: routes through (evidence: `README.md`)
- NAT gateway → Web visitor: allows outbound updates (evidence: `README.md`)
- Security groups → Database EC2: controls ingress (evidence: `README.md`)
- Security groups → Web EC2: protects instance (evidence: `README.md`)
- Web EC2 → Database EC2: connects on 3306 (evidence: `README.md`)
