# shumetworku/ea-foods-devops-assignment architecture

> Architecture diagram of the GitHub repository shumetworku/ea-foods-devops-assignment, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shumetworku/ea-foods-devops-assignment
- Repository: https://github.com/shumetworku/ea-foods-devops-assignment

## Overview

EA Foods is a small food-orders platform and its AWS delivery setup. The main user workflow is HTTPS through the load balancer to the Django orders API, which reads orders from MySQL; readiness checks verify database access. A separate Node service exposes notification and health endpoints. The README also documents image delivery, gated staging-to-production releases, rollback, logs, alarms, and backups. Application relationships are supported by the excerpts and README; infrastructure and delivery internals are mostly unsampled, so those links reflect documented architecture rather than inspected implementation.

Main entry points: [`apps/orders-api/orders/views.py`](https://github.com/shumetworku/ea-foods-devops-assignment/blob/main/apps/orders-api/orders/views.py) (Orders API), [`infra/modules/ecs-service`](https://github.com/shumetworku/ea-foods-devops-assignment/tree/main/infra/modules/ecs-service) (Fargate services), [`infra/modules/alb`](https://github.com/shumetworku/ea-foods-devops-assignment/tree/main/infra/modules/alb) (HTTPS load balancer), [`.github/workflows/deploy.yml`](https://github.com/shumetworku/ea-foods-devops-assignment/blob/main/.github/workflows/deploy.yml) (Deploy workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_apps["Application services"]
  node_orders_api["Orders API<br/>[views.py]"]
  node_order_model["Order records<br/>[models.py]"]
  node_health_middleware["Health check<br/>[middleware.py]"]
  node_django_routes["API routing<br/>[urls.py]"]
  node_notify["Notification service<br/>[server.js]"]
end

subgraph group_aws["AWS runtime"]
  node_alb["HTTPS load balancer"]
  node_rds[("RDS MySQL")]
  node_ecs["Fargate services"]
  node_network["VPC network"]
  node_ecr[("Container registry<br/>[registry.tf]")]
  node_secrets[("Secrets Manager<br/>[secrets.tf]")]
end

subgraph group_delivery["Release delivery"]
  node_github(("GitHub Actions"))
  node_deploy_workflow["Deploy workflow<br/>[deploy.yml]"]
  node_approval["Production approval<br/>[deploy.yml]"]
  node_rollback["Rollback workflow<br/>[rollback.yml]"]
end

subgraph group_reliability["Reliability"]
  node_monitoring["Logs and alarms"]
  node_sns["SNS alerts"]
end

node_internet(("Internet users"))

node_internet -->|"HTTPS requests"| node_alb
node_alb -->|"routes /orders"| node_orders_api
node_alb -->|"routes /notify"| node_notify
node_orders_api -->|"handled by"| node_django_routes
node_django_routes -->|"dispatches orders"| node_orders_api
node_orders_api -->|"queries orders"| node_order_model
node_health_middleware -->|"handles /health"| node_orders_api
node_orders_api -->|"reads orders"| node_rds
node_orders_api -->|"checks readiness"| node_rds
node_ecs -->|"runs service"| node_orders_api
node_ecs -->|"runs service"| node_notify
node_ecs -->|"injects at startup"| node_secrets
node_network -->|"isolates database"| node_rds
node_github -->|"triggers"| node_deploy_workflow
node_deploy_workflow -->|"pushes images"| node_ecr
node_deploy_workflow -->|"requests approval"| node_approval
node_approval -->|"permits production deploy"| node_ecs
node_rollback -->|"redeploys prior image"| node_ecs
node_orders_api -->|"emits logs"| node_monitoring
node_notify -->|"emits logs"| node_monitoring
node_monitoring -->|"sends alarms"| node_sns

click node_alb "https://github.com/shumetworku/ea-foods-devops-assignment/tree/main/infra/modules/alb"
click node_orders_api "https://github.com/shumetworku/ea-foods-devops-assignment/blob/main/apps/orders-api/orders/views.py"
click node_order_model "https://github.com/shumetworku/ea-foods-devops-assignment/blob/main/apps/orders-api/orders/models.py"
click node_health_middleware "https://github.com/shumetworku/ea-foods-devops-assignment/blob/main/apps/orders-api/orders_api/middleware.py"
click node_django_routes "https://github.com/shumetworku/ea-foods-devops-assignment/blob/main/apps/orders-api/orders_api/urls.py"
click node_notify "https://github.com/shumetworku/ea-foods-devops-assignment/blob/main/apps/notify-svc/server.js"
click node_rds "https://github.com/shumetworku/ea-foods-devops-assignment/tree/main/infra/modules/rds"
click node_ecs "https://github.com/shumetworku/ea-foods-devops-assignment/tree/main/infra/modules/ecs-service"
click node_network "https://github.com/shumetworku/ea-foods-devops-assignment/tree/main/infra/modules/network"
click node_ecr "https://github.com/shumetworku/ea-foods-devops-assignment/blob/main/infra/registry.tf"
click node_secrets "https://github.com/shumetworku/ea-foods-devops-assignment/blob/main/infra/secrets.tf"
click node_deploy_workflow "https://github.com/shumetworku/ea-foods-devops-assignment/blob/main/.github/workflows/deploy.yml"
click node_approval "https://github.com/shumetworku/ea-foods-devops-assignment/blob/main/.github/workflows/deploy.yml"
click node_rollback "https://github.com/shumetworku/ea-foods-devops-assignment/blob/main/.github/workflows/rollback.yml"
click node_monitoring "https://github.com/shumetworku/ea-foods-devops-assignment/tree/main/infra/modules/monitoring"
click node_sns "https://github.com/shumetworku/ea-foods-devops-assignment/tree/main/infra/modules/monitoring"

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_orders_api,node_order_model,node_health_middleware,node_django_routes,node_notify,node_internet toneBlue
class node_alb,node_rds,node_ecs,node_network,node_ecr,node_secrets toneAmber
class node_github,node_deploy_workflow,node_approval,node_rollback toneMint
class node_monitoring,node_sns toneRose
```

## Components

### Application services

- [Orders API](https://github.com/shumetworku/ea-foods-devops-assignment/blob/main/apps/orders-api/orders/views.py): `apps/orders-api/orders/views.py`
- [Order records](https://github.com/shumetworku/ea-foods-devops-assignment/blob/main/apps/orders-api/orders/models.py): `apps/orders-api/orders/models.py`
- [Health check](https://github.com/shumetworku/ea-foods-devops-assignment/blob/main/apps/orders-api/orders_api/middleware.py): `apps/orders-api/orders_api/middleware.py`
- [API routing](https://github.com/shumetworku/ea-foods-devops-assignment/blob/main/apps/orders-api/orders_api/urls.py): `apps/orders-api/orders_api/urls.py`
- [Notification service](https://github.com/shumetworku/ea-foods-devops-assignment/blob/main/apps/notify-svc/server.js): `apps/notify-svc/server.js`

### AWS runtime

- [HTTPS load balancer](https://github.com/shumetworku/ea-foods-devops-assignment/tree/main/infra/modules/alb): `infra/modules/alb`
- [RDS MySQL](https://github.com/shumetworku/ea-foods-devops-assignment/tree/main/infra/modules/rds): `infra/modules/rds`
- [Fargate services](https://github.com/shumetworku/ea-foods-devops-assignment/tree/main/infra/modules/ecs-service): `infra/modules/ecs-service`
- [VPC network](https://github.com/shumetworku/ea-foods-devops-assignment/tree/main/infra/modules/network): `infra/modules/network`
- [Container registry](https://github.com/shumetworku/ea-foods-devops-assignment/blob/main/infra/registry.tf): `infra/registry.tf`
- [Secrets Manager](https://github.com/shumetworku/ea-foods-devops-assignment/blob/main/infra/secrets.tf): `infra/secrets.tf`

### Release delivery

- **GitHub Actions**
- [Deploy workflow](https://github.com/shumetworku/ea-foods-devops-assignment/blob/main/.github/workflows/deploy.yml): `.github/workflows/deploy.yml`
- [Production approval](https://github.com/shumetworku/ea-foods-devops-assignment/blob/main/.github/workflows/deploy.yml): `.github/workflows/deploy.yml`
- [Rollback workflow](https://github.com/shumetworku/ea-foods-devops-assignment/blob/main/.github/workflows/rollback.yml): `.github/workflows/rollback.yml`

### Reliability

- [Logs and alarms](https://github.com/shumetworku/ea-foods-devops-assignment/tree/main/infra/modules/monitoring): `infra/modules/monitoring`
- [SNS alerts](https://github.com/shumetworku/ea-foods-devops-assignment/tree/main/infra/modules/monitoring): `infra/modules/monitoring`

### Other components

- **Internet users**

## Connections

- Internet users → HTTPS load balancer: HTTPS requests (evidence: `README.md`)
- HTTPS load balancer → Orders API: routes /orders (evidence: `README.md`)
- HTTPS load balancer → Notification service: routes /notify (evidence: `README.md`)
- Orders API → API routing: handled by (evidence: `apps/orders-api/orders_api/urls.py`)
- API routing → Orders API: dispatches orders (evidence: `apps/orders-api/orders_api/urls.py`)
- Orders API → Order records: queries orders (evidence: `apps/orders-api/orders/views.py`)
- Health check → Orders API: handles /health (evidence: `apps/orders-api/orders_api/middleware.py`)
- Orders API → RDS MySQL: reads orders (evidence: `README.md`)
- Orders API → RDS MySQL: checks readiness (evidence: `apps/orders-api/orders/views.py`)
- Fargate services → Orders API: runs service (evidence: `README.md`)
- Fargate services → Notification service: runs service (evidence: `README.md`)
- Fargate services → Secrets Manager: injects at startup (evidence: `README.md`)
- VPC network → RDS MySQL: isolates database (evidence: `README.md`)
- GitHub Actions → Deploy workflow: triggers (evidence: `README.md`)
- Deploy workflow → Container registry: pushes images (evidence: `README.md`)
- Deploy workflow → Production approval: requests approval (evidence: `README.md`)
- Production approval → Fargate services: permits production deploy (evidence: `README.md`)
- Rollback workflow → Fargate services: redeploys prior image (evidence: `README.md`)
- Orders API → Logs and alarms: emits logs (evidence: `README.md`)
- Notification service → Logs and alarms: emits logs (evidence: `README.md`)
- Logs and alarms → SNS alerts: sends alarms (evidence: `README.md`)
