# dcutivao/my-website-app architecture

> Architecture diagram of the GitHub repository dcutivao/my-website-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dcutivao/my-website-app
- Repository: https://github.com/dcutivao/my-website-app

## Overview

##### Project Type and Purpose
- This is an infrastructure-as-code project that uses Terraform to deploy AWS resources. The project is intended to practice AWS CodePipeline along with setting up supporting AWS components such as S3 for hosting (i.e., a website) and IAM for managing permissions.
- The README (“Repocitorio para practica AWS codepipeline”) confirms that this repository is focused on practicing AWS CodePipeline.

##### Analyzing the File Structure
- Top-Level Files: Files like .gitignore, index.html, error.html, main.tf, outputs.tf, terraform.tfstate, terraform.tfvars, and variables.tf indicate that Terraform is used to provision resources.
- Modules Directory: Contains separate subdirectories for each AWS component:
- modules/codepipeline: Contains Terraform scripts for setting up the CodePipeline (with variables, outputs, and main definitions).
- modules/iam: Contains Terraform code for IAM resources.
- modules/s3: Contains Terraform code for S3 resources.
- The “web” Directory contains static HTML files (index.html and error.html), which likely represent the content of the website hosted on S3.

##### Key Components
a. AWS CodePipeline: Highlight this as the central component driving continuous delivery/deployment.
b. AWS IAM: Represents the security and permissions layer used by CodePipeline and other AWS services.
c. AWS S3: Acts as the storage layer for static web content (hosted website) and may hold artifacts during the pipeline execution.
d. Terraform Infrastructure: Indicate that Terraform automates the provisioning and management of these resources.
e. Web Content: Represents the static website resources (HTML files) that are deployed to S3.

##### Relationships and Interactions
- The Terraform code orchestrates the creation of all AWS resources.
- CodePipeline will manage the CI/CD flow, which likely pulls the website content and deploys it to S3.
- IAM roles/policies (defined within the IAM module) secure the interactions between CodePipeline, S3, and any other AWS services involved.
- S3 not only serves as a storage repository for the website files but possibly also serves the website directly to end users.

## Diagram (Mermaid)

```mermaid
flowchart TD
    TERRAFORM["Terraform Infrastructure"]:::terraform
    CODEPIPELINE["AWS CodePipeline"]:::codepipeline
    IAM["AWS IAM"]:::iam
    S3["AWS S3"]:::s3
    WEB["Web Content"]:::web
    USER["End User"]:::user

    TERRAFORM -->|"provisions"| CODEPIPELINE
    TERRAFORM -->|"provisions"| IAM
    TERRAFORM -->|"provisions"| S3

    CODEPIPELINE -->|"deploys"| S3

    IAM -->|"secures"| CODEPIPELINE
    IAM -->|"secures"| S3

    S3 -->|"hosts"| WEB
    WEB -->|"served_to"| USER

    click TERRAFORM "https://github.com/dcutivao/my-website-app/blob/main/main.tf"
    click CODEPIPELINE "https://github.com/dcutivao/my-website-app/tree/main/modules/codepipeline"
    click IAM "https://github.com/dcutivao/my-website-app/tree/main/modules/iam"
    click S3 "https://github.com/dcutivao/my-website-app/tree/main/modules/s3"
    click WEB "https://github.com/dcutivao/my-website-app/tree/main/web"

    classDef terraform fill:#B376E6,stroke:#4B0082,stroke-width:2px;
    classDef codepipeline fill:#8ecae6,stroke:#219ebc,stroke-width:2px;
    classDef iam fill:#ffcc00,stroke:#e6ac00,stroke-width:2px;
    classDef s3 fill:#f4a261,stroke:#e76f51,stroke-width:2px;
    classDef web fill:#a8dadc,stroke:#457b9d,stroke-width:2px;
    classDef user fill:#ffadad,stroke:#ff0000,stroke-width:2px;
```
