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

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

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

## Overview

This repository describes a Flask message-board application and its deployment on AWS as a two-tier Flask/MySQL service. A user views stored messages or submits a new one; the Flask app reads from or writes to MySQL and renders the page or returns JSON. Separately, the documented CI/CD workflow has a developer push code to GitHub, after which Jenkins builds the container image and deploys the Compose services on EC2. App behavior is evidenced by sampled app.py; deployment links follow the README, whose Jenkinsfile excerpt is incomplete.

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

## Diagram (Mermaid)

```mermaid
flowchart TD

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

subgraph group_data["Message storage"]
  node_mysql[("MySQL service<br/>[docker-compose.yml]")]
  node_schema[("Message table<br/>[app.py]")]
end

subgraph group_delivery["CI/CD delivery"]
  node_pipeline["Jenkins pipeline"]
  node_image["Flask image"]
  node_compose["Compose deployment<br/>[docker-compose.yml]"]
end

subgraph group_runtime["AWS runtime"]
  node_ec2["AWS EC2 host"]
end

node_user(("Web user"))
node_developer(("Developer"))
node_github["GitHub repository"]
node_jenkins["Jenkins"]

node_user -->|"requests"| node_flask
node_flask -->|"reads messages"| node_schema
node_flask -->|"inserts message"| node_schema
node_flask -->|"renders page"| node_page
node_flask -->|"returns JSON"| node_user
node_schema -->|"stored in"| node_mysql
node_developer -->|"pushes code"| node_github
node_github -->|"triggers pipeline"| node_jenkins
node_jenkins -->|"runs"| node_pipeline
node_pipeline -->|"clones code"| node_github
node_pipeline -->|"builds image"| node_image
node_pipeline -->|"runs deployment"| node_compose
node_compose -->|"deploys services"| node_ec2
node_compose -->|"starts service"| node_mysql
node_compose -->|"starts service"| node_flask

click node_flask "https://github.com/amodkakarmath/devops-project-two-tier-flask-app/blob/main/app.py"
click node_page "https://github.com/amodkakarmath/devops-project-two-tier-flask-app/blob/main/templates/index.html"
click node_mysql "https://github.com/amodkakarmath/devops-project-two-tier-flask-app/blob/main/docker-compose.yml"
click node_schema "https://github.com/amodkakarmath/devops-project-two-tier-flask-app/blob/main/app.py"
click node_pipeline "https://github.com/amodkakarmath/devops-project-two-tier-flask-app/blob/main/Jenkinsfile"
click node_image "https://github.com/amodkakarmath/devops-project-two-tier-flask-app/blob/main/Dockerfile"
click node_compose "https://github.com/amodkakarmath/devops-project-two-tier-flask-app/blob/main/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_page,node_user toneBlue
class node_mysql,node_schema toneAmber
class node_pipeline,node_image,node_compose toneMint
class node_ec2 toneRose
class node_developer,node_github,node_jenkins toneIndigo
```

## Components

### Web application

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

### Message storage

- [MySQL service](https://github.com/amodkakarmath/devops-project-two-tier-flask-app/blob/main/docker-compose.yml): `docker-compose.yml`
- [Message table](https://github.com/amodkakarmath/devops-project-two-tier-flask-app/blob/main/app.py): `app.py`

### CI/CD delivery

- [Jenkins pipeline](https://github.com/amodkakarmath/devops-project-two-tier-flask-app/blob/main/Jenkinsfile): `Jenkinsfile`
- [Flask image](https://github.com/amodkakarmath/devops-project-two-tier-flask-app/blob/main/Dockerfile): `Dockerfile`
- [Compose deployment](https://github.com/amodkakarmath/devops-project-two-tier-flask-app/blob/main/docker-compose.yml): `docker-compose.yml`

### AWS runtime

- **AWS EC2 host**

### Other components

- **Web user**
- **Developer**
- **GitHub repository**
- **Jenkins**

## Connections

- Web user → Flask app: requests
- Flask app → Message table: reads messages
- Flask app → Message table: inserts message
- Flask app → Message page: renders page
- Flask app → Web user: returns JSON
- Message table → MySQL service: stored in
- Developer → GitHub repository: pushes code
- GitHub repository → Jenkins: triggers pipeline
- Jenkins → Jenkins pipeline: runs
- Jenkins pipeline → GitHub repository: clones code
- Jenkins pipeline → Flask image: builds image
- Jenkins pipeline → Compose deployment: runs deployment
- Compose deployment → AWS EC2 host: deploys services
- Compose deployment → MySQL service: starts service
- Compose deployment → Flask app: starts service
