# molktru13/projeto-korp architecture

> Architecture diagram of the GitHub repository molktru13/projeto-korp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/molktru13/projeto-korp
- Repository: https://github.com/molktru13/projeto-korp

## Overview

Projeto Korp is a small Go HTTP service delivered as a Docker-based DevOps stack. The main user flow is HTTP through NGINX to a JSON endpoint returning the project name and UTC time. Prometheus separately scrapes application metrics, which Grafana visualizes for administrators. The README also documents Ansible provisioning and automatic Grafana setup. Source excerpts show the Go handlers and instrumentation; infrastructure relationships rely on README statements because those configuration files were not sampled.

Main entry points: [`docker/docker-compose.yml`](https://github.com/molktru13/projeto-korp/blob/main/docker/docker-compose.yml) (Docker Services), [`app/main.go`](https://github.com/molktru13/projeto-korp/blob/main/app/main.go) (Go HTTP Server), [`grafana/provisioning/dashboards/http-server-projeto-korp-dashboard.json`](https://github.com/molktru13/projeto-korp/blob/main/grafana/provisioning/dashboards/http-server-projeto-korp-dashboard.json) (Grafana Dashboards), [`docker/nginx/http-server-projeto-korp.conf`](https://github.com/molktru13/projeto-korp/blob/main/docker/nginx/http-server-projeto-korp.conf) (NGINX Proxy)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_delivery["Deployment"]
  node_ansible["Ansible Provisioning<br/>[playbook.yml]"]
  node_compose["Docker Services<br/>[docker-compose.yml]"]
  node_nginx["NGINX Proxy"]
end

subgraph group_service["HTTP Service"]
  node_app["Go HTTP Server<br/>[main.go]"]
  node_api["Project JSON Endpoint<br/>[main.go]"]
  node_instrumentation["Request Instrumentation<br/>[main.go]"]
end

subgraph group_observability["Observability"]
  node_metrics["Metrics Endpoint<br/>[main.go]"]
  node_promconfig["Scrape Configuration<br/>[prometheus.yml]"]
  node_prometheus[("Prometheus<br/>[docker-compose.yml]")]
  node_grafana["Grafana Dashboards"]
  node_datasource["Prometheus Datasource<br/>[datasource.yml]"]
  node_dashboardconfig["Dashboard Provisioning<br/>[dashboards.yml]"]
end

node_user(("User / cURL"))
node_admin(("Administrator"))

node_user -->|"HTTP request"| node_nginx
node_nginx -->|"proxies request"| node_app
node_app -->|"routes endpoint"| node_api
node_api -->|"wrapped by"| node_instrumentation
node_app -->|"serves metrics"| node_metrics
node_prometheus -->|"scrapes metrics"| node_metrics
node_promconfig -->|"configures scrape"| node_prometheus
node_admin -->|"views dashboards"| node_grafana
node_grafana -->|"queries datasource"| node_prometheus
node_datasource -->|"provisions datasource"| node_grafana
node_dashboardconfig -->|"provisions dashboard"| node_grafana
node_ansible -->|"starts services"| node_compose
node_compose -->|"orchestrates service"| node_nginx
node_compose -->|"orchestrates service"| node_app
node_compose -->|"orchestrates service"| node_prometheus

click node_ansible "https://github.com/molktru13/projeto-korp/blob/main/ansible/playbook.yml"
click node_compose "https://github.com/molktru13/projeto-korp/blob/main/docker/docker-compose.yml"
click node_nginx "https://github.com/molktru13/projeto-korp/blob/main/docker/nginx/http-server-projeto-korp.conf"
click node_app "https://github.com/molktru13/projeto-korp/blob/main/app/main.go"
click node_api "https://github.com/molktru13/projeto-korp/blob/main/app/main.go"
click node_instrumentation "https://github.com/molktru13/projeto-korp/blob/main/app/main.go"
click node_metrics "https://github.com/molktru13/projeto-korp/blob/main/app/main.go"
click node_promconfig "https://github.com/molktru13/projeto-korp/blob/main/docker/prometheus/prometheus.yml"
click node_prometheus "https://github.com/molktru13/projeto-korp/blob/main/docker/docker-compose.yml"
click node_grafana "https://github.com/molktru13/projeto-korp/blob/main/grafana/provisioning/dashboards/http-server-projeto-korp-dashboard.json"
click node_datasource "https://github.com/molktru13/projeto-korp/blob/main/grafana/provisioning/datasources/datasource.yml"
click node_dashboardconfig "https://github.com/molktru13/projeto-korp/blob/main/grafana/provisioning/dashboards/dashboards.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_ansible,node_compose,node_nginx,node_user toneBlue
class node_app,node_api,node_instrumentation toneAmber
class node_metrics,node_promconfig,node_prometheus,node_grafana,node_datasource,node_dashboardconfig toneMint
class node_admin toneIndigo
```

## Components

### Deployment

- [Ansible Provisioning](https://github.com/molktru13/projeto-korp/blob/main/ansible/playbook.yml): `ansible/playbook.yml`
- [Docker Services](https://github.com/molktru13/projeto-korp/blob/main/docker/docker-compose.yml): `docker/docker-compose.yml`
- [NGINX Proxy](https://github.com/molktru13/projeto-korp/blob/main/docker/nginx/http-server-projeto-korp.conf): `docker/nginx/http-server-projeto-korp.conf`

### HTTP Service

- [Go HTTP Server](https://github.com/molktru13/projeto-korp/blob/main/app/main.go): `app/main.go`
- [Project JSON Endpoint](https://github.com/molktru13/projeto-korp/blob/main/app/main.go): `app/main.go`
- [Request Instrumentation](https://github.com/molktru13/projeto-korp/blob/main/app/main.go): `app/main.go`

### Observability

- [Metrics Endpoint](https://github.com/molktru13/projeto-korp/blob/main/app/main.go): `app/main.go`
- [Scrape Configuration](https://github.com/molktru13/projeto-korp/blob/main/docker/prometheus/prometheus.yml): `docker/prometheus/prometheus.yml`
- [Prometheus](https://github.com/molktru13/projeto-korp/blob/main/docker/docker-compose.yml): `docker/docker-compose.yml`
- [Grafana Dashboards](https://github.com/molktru13/projeto-korp/blob/main/grafana/provisioning/dashboards/http-server-projeto-korp-dashboard.json): `grafana/provisioning/dashboards/http-server-projeto-korp-dashboard.json`
- [Prometheus Datasource](https://github.com/molktru13/projeto-korp/blob/main/grafana/provisioning/datasources/datasource.yml): `grafana/provisioning/datasources/datasource.yml`
- [Dashboard Provisioning](https://github.com/molktru13/projeto-korp/blob/main/grafana/provisioning/dashboards/dashboards.yml): `grafana/provisioning/dashboards/dashboards.yml`

### Other components

- **User / cURL**
- **Administrator**

## Connections

- User / cURL → NGINX Proxy: HTTP request (evidence: `README.md`)
- NGINX Proxy → Go HTTP Server: proxies request (evidence: `README.md`)
- Go HTTP Server → Project JSON Endpoint: routes endpoint (evidence: `app/main.go`)
- Project JSON Endpoint → Request Instrumentation: wrapped by (evidence: `app/main.go`)
- Go HTTP Server → Metrics Endpoint: serves metrics (evidence: `app/main.go`)
- Prometheus → Metrics Endpoint: scrapes metrics (evidence: `README.md`)
- Scrape Configuration → Prometheus: configures scrape (evidence: `README.md`)
- Administrator → Grafana Dashboards: views dashboards (evidence: `README.md`)
- Grafana Dashboards → Prometheus: queries datasource (evidence: `README.md`)
- Prometheus Datasource → Grafana Dashboards: provisions datasource (evidence: `README.md`)
- Dashboard Provisioning → Grafana Dashboards: provisions dashboard (evidence: `README.md`)
- Ansible Provisioning → Docker Services: starts services (evidence: `README.md`)
- Docker Services → NGINX Proxy: orchestrates service (evidence: `README.md`)
- Docker Services → Go HTTP Server: orchestrates service (evidence: `README.md`)
- Docker Services → Prometheus: orchestrates service (evidence: `README.md`)
