# agrim-09/2-tier-test architecture

> Architecture diagram of the GitHub repository agrim-09/2-tier-test, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/agrim-09/2-tier-test
- Repository: https://github.com/agrim-09/2-tier-test

## Overview

##### Project type and purpose
- From the file tree and README we see this is an “2-tier‐test” Terraform project. Its goal is to provision a two‐tier infrastructure (e.g., web/app tier + data tier) likely in a cloud provider (AWS, Azure, GCP).
- The presence of a GitHub workflow (deploy.yml) tells us there’s a CI/CD pipeline that runs Terraform to apply infrastructure changes.

##### File structure
- Top level:
- .github/workflows/deploy.yml – CI/CD workflow definition
- terraform/infra/2-tier/main.tf – Terraform code for the 2-tier infrastructure
- .gitignore, README.md
- There are no separate “modules” or multiple environments here; everything lives under a single 2-tier folder.
- We can infer the architecture will have at least two sets of resources: one for the “application/web” tier and one for the “database” tier, connected by networking components.

##### README for additional insights
- The README is minimal. No details on provider, resource types, or networking. We’ll assume a typical two-tier layout:
– VPC / Virtual Network
– Public subnet(s) for frontend
– Private subnet(s) for database
– Security groups / firewall rules
– CI/CD pipeline invoking Terraform

##### Final checklist
- Data flows with arrowheads
- Subnets inside a VPC boundary
- Separation of public vs. private zones
- Security group rules or access restrictions, if desired

## Diagram (Mermaid)

```mermaid
flowchart TD
    GitHubActions["Infrastructure Provisioning Pipeline<br/>(GitHub Actions CI/CD)"]:::control
    Terraform["Terraform Infrastructure as Code<br/>(2-tier deployment)"]:::control
    README["Project Documentation and Overview<br/>(README.md)"]:::doc
    Gitignore["General Ignore Rules<br/>(.gitignore)"]:::doc
    Internet["Internet"]:::external

    subgraph "Cloud Infrastructure"
        subgraph "VPC / Networking"
            VPC["VPC / Virtual Network"]:::network
            subgraph "Public Subnet"
                LB["Load Balancer"]:::compute
                App["Application Servers"]:::compute
            end
            subgraph "Private Subnet"
                DB["Database (RDS)"]:::data
            end
        end
    end

    GitHubActions -->|"triggers"| Terraform
    Terraform -->|"provisions"| VPC
    Internet -->|"external traffic"| LB
    LB -->|"routes requests"| App
    App -->|"connects to"| DB

    click GitHubActions "https://github.com/agrim-09/2-tier-test/blob/main/.github/workflows/deploy.yml"
    click Terraform "https://github.com/agrim-09/2-tier-test/blob/main/terraform/infra/2-tier/main.tf"
    click README "https://github.com/agrim-09/2-tier-test/blob/main/README.md"
    click Gitignore "https://github.com/agrim-09/2-tier-test/blob/main/.gitignore"

    classDef control fill:#bbdefb,stroke:#0d47a1,color:#0d47a1;
    classDef network fill:#c8e6c9,stroke:#1b5e20,color:#1b5e20;
    classDef compute fill:#ffe0b2,stroke:#e65100,color:#e65100;
    classDef data fill:#ffcccb,stroke:#b71c1c,color:#b71c1c;
    classDef doc fill:#f5f5f5,stroke:#424242,color:#424242;
    classDef external fill:#e0e0e0,stroke:#616161,color:#616161;
```
