# josenetoo/fiap-dclt-aula03 architecture

> Architecture diagram of the GitHub repository josenetoo/fiap-dclt-aula03, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/josenetoo/fiap-dclt-aula03
- Repository: https://github.com/josenetoo/fiap-dclt-aula03

## Overview

This repository is a Docker/Kubernetes deployment lesson centered on a Todo API. The runtime workflow is a client request entering the Express server, where routes validate and process todo operations against in-memory state and return JSON; health and statistics endpoints expose service and deployment details. The documented infrastructure workflow builds and publishes a container image, then deploys it with Kustomize, including Blue/Green and Canary examples. Workflow and Kubernetes manifest contents were not sampled, so their detailed triggers and wiring are not inferred.

Main entry points: [`app/src/app.js`](https://github.com/josenetoo/fiap-dclt-aula03/blob/main/app/src/app.js) (Express API), [`.github/workflows/docker-build.yml`](https://github.com/josenetoo/fiap-dclt-aula03/blob/main/.github/workflows/docker-build.yml) (Docker build workflow), [`.github/workflows/k8s-deploy.yml`](https://github.com/josenetoo/fiap-dclt-aula03/blob/main/.github/workflows/k8s-deploy.yml) (Kubernetes deploy workflow), [`app/src/server.js`](https://github.com/josenetoo/fiap-dclt-aula03/blob/main/app/src/server.js) (HTTP server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Todo API"]
  node_server["HTTP server<br/>[server.js]"]
  node_apiapp["Express API<br/>[app.js]"]
  node_todos[("In-memory todos<br/>[app.js]")]
end

subgraph group_image["Image delivery"]
  node_dockerfile["Container image"]
  node_dockerflow["Docker build workflow<br/>[docker-build.yml]"]
end

subgraph group_kube["Kubernetes deployment"]
  node_k8sflow["Kubernetes deploy workflow<br/>[k8s-deploy.yml]"]
  node_canaryflow["Canary deploy workflow<br/>[canary-deploy.yml]"]
  node_base["Base manifests"]
  node_production["Production overlay"]
  node_bluegreen["Blue-Green manifests"]
  node_canary["Canary Istio manifests"]
end

node_client(("API client"))
node_ecr[("AWS ECR")]
node_cluster["Kubernetes cluster"]
node_user(("Todo user"))

node_user -->|"sends requests"| node_client
node_client -->|"HTTP requests"| node_server
node_server -->|"starts app"| node_apiapp
node_apiapp -->|"reads/writes"| node_todos
node_apiapp -->|"returns JSON"| node_client
node_dockerflow -->|"builds image"| node_dockerfile
node_dockerflow -->|"publishes image"| node_ecr
node_k8sflow -->|"deploys manifests"| node_base
node_base -->|"overlaid by"| node_production
node_k8sflow -->|"deploys to"| node_cluster
node_canaryflow -->|"deploys manifests"| node_canary
node_canary -->|"configures routing"| node_cluster
node_bluegreen -->|"configures versions"| node_cluster

click node_server "https://github.com/josenetoo/fiap-dclt-aula03/blob/main/app/src/server.js"
click node_apiapp "https://github.com/josenetoo/fiap-dclt-aula03/blob/main/app/src/app.js"
click node_todos "https://github.com/josenetoo/fiap-dclt-aula03/blob/main/app/src/app.js"
click node_dockerfile "https://github.com/josenetoo/fiap-dclt-aula03/blob/main/Dockerfile"
click node_dockerflow "https://github.com/josenetoo/fiap-dclt-aula03/blob/main/.github/workflows/docker-build.yml"
click node_k8sflow "https://github.com/josenetoo/fiap-dclt-aula03/blob/main/.github/workflows/k8s-deploy.yml"
click node_canaryflow "https://github.com/josenetoo/fiap-dclt-aula03/blob/main/.github/workflows/canary-deploy.yml"
click node_base "https://github.com/josenetoo/fiap-dclt-aula03/tree/main/k8s/base"
click node_production "https://github.com/josenetoo/fiap-dclt-aula03/tree/main/k8s/overlays/production"
click node_bluegreen "https://github.com/josenetoo/fiap-dclt-aula03/tree/main/k8s/blue-green"
click node_canary "https://github.com/josenetoo/fiap-dclt-aula03/tree/main/k8s/canary-istio"

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_server,node_apiapp,node_todos,node_client,node_user toneBlue
class node_dockerfile,node_dockerflow,node_ecr toneAmber
class node_k8sflow,node_canaryflow,node_base,node_production,node_bluegreen,node_canary toneMint
class node_cluster toneIndigo
```

## Components

### Todo API

- [HTTP server](https://github.com/josenetoo/fiap-dclt-aula03/blob/main/app/src/server.js): `app/src/server.js`
- [Express API](https://github.com/josenetoo/fiap-dclt-aula03/blob/main/app/src/app.js): `app/src/app.js`
- [In-memory todos](https://github.com/josenetoo/fiap-dclt-aula03/blob/main/app/src/app.js): `app/src/app.js`

### Image delivery

- [Container image](https://github.com/josenetoo/fiap-dclt-aula03/blob/main/Dockerfile): `Dockerfile`
- [Docker build workflow](https://github.com/josenetoo/fiap-dclt-aula03/blob/main/.github/workflows/docker-build.yml): `.github/workflows/docker-build.yml`

### Kubernetes deployment

- [Kubernetes deploy workflow](https://github.com/josenetoo/fiap-dclt-aula03/blob/main/.github/workflows/k8s-deploy.yml): `.github/workflows/k8s-deploy.yml`
- [Canary deploy workflow](https://github.com/josenetoo/fiap-dclt-aula03/blob/main/.github/workflows/canary-deploy.yml): `.github/workflows/canary-deploy.yml`
- [Base manifests](https://github.com/josenetoo/fiap-dclt-aula03/tree/main/k8s/base): `k8s/base`
- [Production overlay](https://github.com/josenetoo/fiap-dclt-aula03/tree/main/k8s/overlays/production): `k8s/overlays/production`
- [Blue-Green manifests](https://github.com/josenetoo/fiap-dclt-aula03/tree/main/k8s/blue-green): `k8s/blue-green`
- [Canary Istio manifests](https://github.com/josenetoo/fiap-dclt-aula03/tree/main/k8s/canary-istio): `k8s/canary-istio`

### Other components

- **API client**
- **AWS ECR**
- **Kubernetes cluster**
- **Todo user**

## Connections

- Todo user → API client: sends requests
- API client → HTTP server: HTTP requests
- HTTP server → Express API: starts app
- Express API → In-memory todos: reads/writes
- Express API → API client: returns JSON
- Docker build workflow → Container image: builds image
- Docker build workflow → AWS ECR: publishes image
- Kubernetes deploy workflow → Base manifests: deploys manifests
- Base manifests → Production overlay: overlaid by
- Kubernetes deploy workflow → Kubernetes cluster: deploys to
- Canary deploy workflow → Canary Istio manifests: deploys manifests
- Canary Istio manifests → Kubernetes cluster: configures routing
- Blue-Green manifests → Kubernetes cluster: configures versions
