# yashwanthkothakota9/myportfolio-aws architecture

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

- Interactive diagram: https://gitdiagram.com/yashwanthkothakota9/myportfolio-aws
- Repository: https://github.com/yashwanthkothakota9/myportfolio-aws

## Overview

##### Project Type & Purpose
- This repository supports a cloud resume project deployed on AWS. The README indicates that it leverages AWS services (Route 53, CloudFront, S3, API Gateway, Lambda, DynamoDB) to deliver a resume site, coupled with infrastructure as code (Terraform) and CI/CD pipelines (GitHub Actions).
- It’s a full-stack application with a Next.js-based frontend and a Python-based backend.

##### File Structure Analysis
- Top-Level Directories:
- .github: Contains separate workflows for frontend, backend, and infrastructure CI/CD tasks.
- backend: Houses the Python application (app.py), requirements, and tests. This demonstrates clear separation of backend logic.
- frontend: Contains a Next.js project (pages/app layout, components, Tailwind CSS, Cypress configuration, etc.), marking the client-side part.
- Root-level Terraform files (.terraform.lock.hcl, main.tf, providers.tf) indicate that the AWS resources are provisioned via Infrastructure as Code.
- The separation of concerns is clear—with one part managing the UI and client experiences, another handling server-side logic, and a third for infrastructure provisioning.

##### README Insights
- Listed tools, including AWS services for hosting and API management, and testing, give insight on how components interact, for example:
- Frontend (built with Next.js and Tailwind CSS) connects to backend APIs.
- The backend (Python, tested with Pytest) likely serves API endpoints for the frontend.
- AWS services (API Gateway, Lambda, DynamoDB) are used to implement scalable serverless endpoints, while S3 and CloudFront serve static assets.
- CI/CD pipelines configured via GitHub Actions trigger deployments and infrastructure provisioning using Terraform.

a. Main Components:
- Frontend Component:
- Next.js application
- Tailwind CSS for styling
- Cypress for UI testing
- Deployment behind CloudFront (managed by AWS)
- Backend Component:
- Python application (app.py)
- API endpoints, tests via Pytest
- Possibly serverless endpoints deployed via API Gateway and Lambda
- Infrastructure Management:
- Terraform scripts managing AWS resource provisioning (Route 53, S3, CloudFront, API Gateway, Lambda, DynamoDB)
- CI/CD Pipeline:
- GitHub Actions workflows for frontend, backend, and infrastructure
b. Relationships & Data flows:
- End-user requests hit DNS (Route 53) and arrive at CloudFront, which serves static assets from S3 (for the frontend) and routes API calls through API Gateway to Lambda or the backend service.
- The frontend (Next.js) communicates with backend APIs.
- CI/CD pipelines push code changes, which trigger builds, tests (via Cypress and Pytest), and then deploy with Terraform to update AWS infrastructure.
c. Architectural Patterns & Design Principles:
- Separation of concerns: distinct directories for frontend, backend, and infrastructure.
- CI/CD-driven automated deployment ensuring continuous progress across components.
- Use of Infrastructure as Code (Terraform) to standardize AWS provisioning.
- Use of serverless patterns (Lambda, API Gateway) to build scalable endpoints.
d. Technologies and Frameworks:
- Next.js, Tailwind CSS, Cypress on the frontend.
- Python and Pytest on the backend.
- AWS services (Route 53, CloudFront, S3, API Gateway, Lambda, DynamoDB).
- Terraform for infrastructure.
- GitHub Actions for CI/CD.

##### Instructing the Principal Software Engineer
- Frontend (Next.js, static assets from S3 via CloudFront)
- Backend (Python API service with tests)
- AWS services such as Route 53, CloudFront, S3, API Gateway, Lambda, DynamoDB.
- CI/CD pipelines (GitHub Actions workflows)
- Infrastructure as Code tool (Terraform)
- How user requests traverse from the internet to various AWS components.
- Data flow and dependency between the frontend and backend.
- Deployment flows from GitHub Actions to Terraform and ultimately AWS.
- Application code (frontend and backend),
- Infrastructure components,
- External services (AWS components),
- CI/CD pipelines.

## Diagram (Mermaid)

```mermaid
flowchart TD
    User["User (Client)"]:::external

    %% AWS Infrastructure Subgraph
    subgraph "AWS Infrastructure"
        R53["Route 53"]:::aws
        CF["CloudFront"]:::aws
        S3["S3 (Static Assets)"]:::aws
        APIGW["API Gateway"]:::aws
        Lambda["Lambda / Backend Service"]:::aws
        Dynamo["DynamoDB"]:::aws
    end

    %% Source Code Subgraph
    subgraph "Source Code"
        subgraph "Frontend Code"
            FE1["App"]:::frontend
            FE2["Components"]:::frontend
            FE3["Public"]:::frontend
            FE4["next.config.ts"]:::frontend
            FE5["tailwind.config.ts"]:::frontend
        end
        subgraph "Backend Code"
            BE1["app.py"]:::backend
            BE2["Tests"]:::backend
            BE3["requirements.txt"]:::backend
            BE4["requirements-dev.txt"]:::backend
        end
        subgraph "Infrastructure Code"
            TF1["main.tf"]:::infrastructure
            TF2["providers.tf"]:::infrastructure
            TF3[".terraform.lock.hcl"]:::infrastructure
            TF4["terraform-output.json"]:::infrastructure
        end
        subgraph "CI/CD Pipeline"
            CICD["GitHub Actions Workflows"]:::cicd
        end
    end

    %% AWS Infrastructure Flow
    User -->|"DNS_request"| R53
    R53 -->|"routes_to"| CF
    CF -->|"serves_static"| S3
    CF -->|"routes_API_calls"| APIGW
    APIGW -->|"invokes"| Lambda
    Lambda -->|"uses"| Dynamo

    %% Deployment Flow from CI/CD Pipeline to AWS Infra
    CICD -->|"deploys_frontend"| S3
    CICD -->|"deploys_backend"| Lambda
    CICD -->|"provisions_infra"| R53
    CICD -->|"provisions_infra"| CF
    CICD -->|"provisions_infra"| S3
    CICD -->|"provisions_infra"| APIGW
    CICD -->|"provisions_infra"| Lambda
    CICD -->|"provisions_infra"| Dynamo

    %% Source Code pushes to CI/CD Pipeline
    FE1 -->|"push_code"| CICD
    FE2 -->|"push_code"| CICD
    FE3 -->|"push_code"| CICD
    FE4 -->|"push_code"| CICD
    FE5 -->|"push_code"| CICD

    BE1 -->|"push_code"| CICD
    BE2 -->|"push_code"| CICD
    BE3 -->|"push_code"| CICD
    BE4 -->|"push_code"| CICD

    TF1 -->|"IaC"| CICD
    TF2 -->|"IaC"| CICD
    TF3 -->|"IaC"| CICD
    TF4 -->|"IaC"| CICD

    %% Frontend and Backend Interaction
    S3 -.->|"calls_API"| APIGW
    APIGW -.->|"forwards_to"| Lambda

    %% Class Definitions
    classDef aws fill:#FFF8E1,stroke:#FFB300,stroke-width:2px;
    classDef frontend fill:#E3F2FD,stroke:#1E88E5,stroke-width:2px;
    classDef backend fill:#E8F5E9,stroke:#43A047,stroke-width:2px;
    classDef infrastructure fill:#F3E5F5,stroke:#8E24AA,stroke-width:2px;
    classDef cicd fill:#FFF3E0,stroke:#FB8C00,stroke-width:2px;
    classDef external fill:#FFCDD2,stroke:#E53935,stroke-width:2px;

    %% Click Events for Frontend Code
    click FE1 "https://github.com/yashwanthkothakota9/myportfolio-aws/tree/main/frontend/app"
    click FE2 "https://github.com/yashwanthkothakota9/myportfolio-aws/tree/main/frontend/components"
    click FE3 "https://github.com/yashwanthkothakota9/myportfolio-aws/tree/main/frontend/public"
    click FE4 "https://github.com/yashwanthkothakota9/myportfolio-aws/blob/main/frontend/next.config.ts"
    click FE5 "https://github.com/yashwanthkothakota9/myportfolio-aws/blob/main/frontend/tailwind.config.ts"

    %% Click Events for Backend Code
    click BE1 "https://github.com/yashwanthkothakota9/myportfolio-aws/blob/main/backend/app.py"
    click BE2 "https://github.com/yashwanthkothakota9/myportfolio-aws/tree/main/backend/tests"
    click BE3 "https://github.com/yashwanthkothakota9/myportfolio-aws/blob/main/backend/requirements.txt"
    click BE4 "https://github.com/yashwanthkothakota9/myportfolio-aws/blob/main/backend/requirements-dev.txt"

    %% Click Events for Infrastructure Code
    click TF1 "https://github.com/yashwanthkothakota9/myportfolio-aws/blob/main/main.tf"
    click TF2 "https://github.com/yashwanthkothakota9/myportfolio-aws/blob/main/providers.tf"
    click TF3 "https://github.com/yashwanthkothakota9/myportfolio-aws/blob/main/.terraform.lock.hcl"
    click TF4 "https://github.com/yashwanthkothakota9/myportfolio-aws/blob/main/terraform-output.json"

    %% Click Event for CI/CD Pipeline
    click CICD "https://github.com/yashwanthkothakota9/myportfolio-aws/tree/main/.github/workflows"
```
