# yogeshr45/devops-project-two-tier-flask-app architecture

> Architecture diagram of the GitHub repository yogeshr45/devops-project-two-tier-flask-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yogeshr45/devops-project-two-tier-flask-app
- Repository: https://github.com/yogeshr45/devops-project-two-tier-flask-app

## Overview

This repository is a Flask/MySQL message app packaged for deployment through a documented GitHub-to-Jenkins CI/CD workflow on AWS EC2. Users submit messages through the Flask app; it stores them in MySQL and renders stored messages in the page. The graph also preserves the documented pipeline and two-container deployment. Runtime relationships come from app.py; deployment relationships are documented in README.md, since Jenkinsfile and container configuration were not sampled directly.

Main entry points: [`app.py`](https://github.com/yogeshr45/devops-project-two-tier-flask-app/blob/master/app.py) (Flask app), [`Jenkinsfile`](https://github.com/yogeshr45/devops-project-two-tier-flask-app/blob/master/Jenkinsfile) (Jenkins pipeline), [`docker-compose.yml`](https://github.com/yogeshr45/devops-project-two-tier-flask-app/blob/master/docker-compose.yml) (Compose services), [`templates/index.html`](https://github.com/yogeshr45/devops-project-two-tier-flask-app/blob/master/templates/index.html) (Message page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_flask["Flask app<br/>[app.py]"]
  node_messages["Message page<br/>[index.html]"]
end

subgraph group_deploy["CI/CD deployment"]
  node_jenkins["Jenkins pipeline"]
  node_ec2["AWS EC2 host"]
end

subgraph group_infra["Container infrastructure"]
  node_compose["Compose services<br/>[docker-compose.yml]"]
  node_mysql[("MySQL database<br/>[docker-compose.yml]")]
end

node_developer(("Developer"))
node_github["GitHub repository"]
node_visitor(("Web visitor"))

node_developer -->|"pushes code"| node_github
node_github -->|"triggers build"| node_jenkins
node_jenkins -->|"clones code"| node_github
node_jenkins -->|"runs deployment"| node_compose
node_jenkins -->|"deploys on"| node_ec2
node_compose -->|"builds service"| node_flask
node_compose -->|"configures service"| node_mysql
node_visitor -.->|"requests page"| node_flask
node_flask -->|"reads messages"| node_mysql
node_flask -->|"writes message"| node_mysql
node_flask -->|"renders page"| node_messages
node_visitor -.->|"submits message"| node_flask

click node_jenkins "https://github.com/yogeshr45/devops-project-two-tier-flask-app/blob/master/Jenkinsfile"
click node_compose "https://github.com/yogeshr45/devops-project-two-tier-flask-app/blob/master/docker-compose.yml"
click node_flask "https://github.com/yogeshr45/devops-project-two-tier-flask-app/blob/master/app.py"
click node_messages "https://github.com/yogeshr45/devops-project-two-tier-flask-app/blob/master/templates/index.html"
click node_mysql "https://github.com/yogeshr45/devops-project-two-tier-flask-app/blob/master/docker-compose.yml"

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_flask,node_messages toneBlue
class node_jenkins,node_ec2 toneAmber
class node_compose,node_mysql toneMint
class node_developer,node_github,node_visitor toneIndigo
```

## Components

### Web application

- [Flask app](https://github.com/yogeshr45/devops-project-two-tier-flask-app/blob/master/app.py): `app.py`
- [Message page](https://github.com/yogeshr45/devops-project-two-tier-flask-app/blob/master/templates/index.html): `templates/index.html`

### CI/CD deployment

- [Jenkins pipeline](https://github.com/yogeshr45/devops-project-two-tier-flask-app/blob/master/Jenkinsfile): `Jenkinsfile`
- **AWS EC2 host**

### Container infrastructure

- [Compose services](https://github.com/yogeshr45/devops-project-two-tier-flask-app/blob/master/docker-compose.yml): `docker-compose.yml`
- [MySQL database](https://github.com/yogeshr45/devops-project-two-tier-flask-app/blob/master/docker-compose.yml): `docker-compose.yml`

### Other components

- **Developer**
- **GitHub repository**
- **Web visitor**

## Connections

- Developer → GitHub repository: pushes code (evidence: `README.md`)
- GitHub repository → Jenkins pipeline: triggers build (evidence: `README.md`)
- Jenkins pipeline → GitHub repository: clones code (evidence: `README.md`)
- Jenkins pipeline → Compose services: runs deployment (evidence: `README.md`)
- Jenkins pipeline → AWS EC2 host: deploys on (evidence: `README.md`)
- Compose services → Flask app: builds service (evidence: `README.md`)
- Compose services → MySQL database: configures service (evidence: `README.md`)
- Web visitor → Flask app: requests page
- Flask app → MySQL database: reads messages (evidence: `app.py`)
- Flask app → MySQL database: writes message (evidence: `app.py`)
- Flask app → Message page: renders page (evidence: `app.py`)
- Web visitor → Flask app: submits message
