# ga4gh/ga4gh_service_info_sidecar_gsoc_2026 architecture

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

- Interactive diagram: https://gitdiagram.com/ga4gh/ga4gh_service_info_sidecar_gsoc_2026
- Repository: https://github.com/ga4gh/ga4gh_service_info_sidecar_gsoc_2026

## Overview

This is a standalone GA4GH ServiceInfo HTTP microservice. A client reaches it through Kubernetes Ingress; the service reads validated metadata from a mounted configuration file, serves it at `/service-info`, and exposes health and Prometheus metrics endpoints. Configuration hot-reloads in the background, while the server handles signal-driven graceful shutdown. The graph reflects the sampled runtime wiring and README-described Kubernetes integration; deployment manifests and unsampled implementation details are not mapped.

Main entry points: [`cmd/server/main.go`](https://github.com/ga4gh/ga4gh_service_info_sidecar_gsoc_2026/blob/main/cmd/server/main.go) (Server startup and shutdown), [`internal/config/config.go`](https://github.com/ga4gh/ga4gh_service_info_sidecar_gsoc_2026/blob/main/internal/config/config.go) (Config watcher), [`internal/handler/service_info.go`](https://github.com/ga4gh/ga4gh_service_info_sidecar_gsoc_2026/blob/main/internal/handler/service_info.go) (ServiceInfo endpoint), [`internal/handler/health.go`](https://github.com/ga4gh/ga4gh_service_info_sidecar_gsoc_2026/blob/main/internal/handler/health.go) (Health endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Startup and lifecycle"]
  node_server["Server startup and shutdown<br/>[main.go]"]
end

subgraph group_metadata["Metadata configuration"]
  node_watcher["Config watcher<br/>[config.go]"]
  node_serviceinfo["ServiceInfo model<br/>[service_info.go]"]
end

subgraph group_http["HTTP API"]
  node_serviceendpoint["ServiceInfo endpoint<br/>[service_info.go]"]
  node_cors["CORS middleware<br/>[cors.go]"]
end

subgraph group_observability["Health and metrics"]
  node_health["Health endpoints<br/>[health.go]"]
  node_metricsmiddleware["Request metrics<br/>[metrics.go]"]
  node_metricsendpoint["Metrics endpoint<br/>[main.go]"]
end

node_client(("API client"))
node_ingress["Kubernetes Ingress"]
node_configmap["Mounted ConfigMap file"]
node_prometheus(("Prometheus scraper"))

node_client -->|"sends requests"| node_ingress
node_ingress -->|"routes service-info"| node_server
node_configmap -->|"provides configuration"| node_watcher
node_server -->|"initializes and watches"| node_watcher
node_watcher -->|"reads and reloads"| node_configmap
node_watcher -->|"parses metadata"| node_serviceinfo
node_server -->|"registers route"| node_serviceendpoint
node_serviceendpoint -->|"gets current config"| node_watcher
node_server -->|"registers probes"| node_health
node_health -->|"checks readiness"| node_watcher
node_server -->|"wraps HTTP handlers"| node_cors
node_server -->|"wraps HTTP handlers"| node_metricsmiddleware
node_server -->|"starts metrics server"| node_metricsendpoint
node_prometheus -->|"scrapes metrics"| node_metricsendpoint

click node_server "https://github.com/ga4gh/ga4gh_service_info_sidecar_gsoc_2026/blob/main/cmd/server/main.go"
click node_watcher "https://github.com/ga4gh/ga4gh_service_info_sidecar_gsoc_2026/blob/main/internal/config/config.go"
click node_serviceinfo "https://github.com/ga4gh/ga4gh_service_info_sidecar_gsoc_2026/blob/main/internal/model/service_info.go"
click node_serviceendpoint "https://github.com/ga4gh/ga4gh_service_info_sidecar_gsoc_2026/blob/main/internal/handler/service_info.go"
click node_cors "https://github.com/ga4gh/ga4gh_service_info_sidecar_gsoc_2026/blob/main/internal/middleware/cors.go"
click node_health "https://github.com/ga4gh/ga4gh_service_info_sidecar_gsoc_2026/blob/main/internal/handler/health.go"
click node_metricsmiddleware "https://github.com/ga4gh/ga4gh_service_info_sidecar_gsoc_2026/blob/main/internal/middleware/metrics.go"
click node_metricsendpoint "https://github.com/ga4gh/ga4gh_service_info_sidecar_gsoc_2026/blob/main/cmd/server/main.go"

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_client toneBlue
class node_watcher,node_serviceinfo toneAmber
class node_serviceendpoint,node_cors toneMint
class node_health,node_metricsmiddleware,node_metricsendpoint toneRose
class node_ingress,node_configmap,node_prometheus toneIndigo
```

## Components

### Startup and lifecycle

- [Server startup and shutdown](https://github.com/ga4gh/ga4gh_service_info_sidecar_gsoc_2026/blob/main/cmd/server/main.go): `cmd/server/main.go`

### Metadata configuration

- [Config watcher](https://github.com/ga4gh/ga4gh_service_info_sidecar_gsoc_2026/blob/main/internal/config/config.go): `internal/config/config.go`
- [ServiceInfo model](https://github.com/ga4gh/ga4gh_service_info_sidecar_gsoc_2026/blob/main/internal/model/service_info.go): `internal/model/service_info.go`

### HTTP API

- [ServiceInfo endpoint](https://github.com/ga4gh/ga4gh_service_info_sidecar_gsoc_2026/blob/main/internal/handler/service_info.go): `internal/handler/service_info.go`
- [CORS middleware](https://github.com/ga4gh/ga4gh_service_info_sidecar_gsoc_2026/blob/main/internal/middleware/cors.go): `internal/middleware/cors.go`

### Health and metrics

- [Health endpoints](https://github.com/ga4gh/ga4gh_service_info_sidecar_gsoc_2026/blob/main/internal/handler/health.go): `internal/handler/health.go`
- [Request metrics](https://github.com/ga4gh/ga4gh_service_info_sidecar_gsoc_2026/blob/main/internal/middleware/metrics.go): `internal/middleware/metrics.go`
- [Metrics endpoint](https://github.com/ga4gh/ga4gh_service_info_sidecar_gsoc_2026/blob/main/cmd/server/main.go): `cmd/server/main.go`

### Other components

- **API client**
- **Kubernetes Ingress**
- **Mounted ConfigMap file**
- **Prometheus scraper**

## Connections

- API client → Kubernetes Ingress: sends requests (evidence: `README.md`)
- Kubernetes Ingress → Server startup and shutdown: routes service-info (evidence: `README.md`)
- Mounted ConfigMap file → Config watcher: provides configuration (evidence: `README.md`)
- Server startup and shutdown → Config watcher: initializes and watches (evidence: `cmd/server/main.go`)
- Config watcher → Mounted ConfigMap file: reads and reloads (evidence: `internal/config/config.go`)
- Config watcher → ServiceInfo model: parses metadata (evidence: `internal/config/config.go`)
- Server startup and shutdown → ServiceInfo endpoint: registers route (evidence: `cmd/server/main.go`)
- ServiceInfo endpoint → Config watcher: gets current config (evidence: `internal/handler/service_info.go`)
- Server startup and shutdown → Health endpoints: registers probes (evidence: `cmd/server/main.go`)
- Health endpoints → Config watcher: checks readiness (evidence: `internal/handler/health.go`)
- Server startup and shutdown → CORS middleware: wraps HTTP handlers (evidence: `cmd/server/main.go`)
- Server startup and shutdown → Request metrics: wraps HTTP handlers (evidence: `cmd/server/main.go`)
- Server startup and shutdown → Metrics endpoint: starts metrics server (evidence: `cmd/server/main.go`)
- Prometheus scraper → Metrics endpoint: scrapes metrics (evidence: `README.md`)
