# nersus15/mini-proxy architecture

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

- Interactive diagram: https://gitdiagram.com/nersus15/mini-proxy
- Repository: https://github.com/nersus15/mini-proxy

## Overview

Mini Proxy is a Go HTTP reverse proxy that accepts SIMFASKES requests, routes resource operations to configured targets, and returns their responses. Its service also handles Satusehat credential generation, background credential delivery, and request idempotency; FHIR mapping and reference-updater modules support resource processing. The excerpts establish handler-to-service, service-to-HTTP-client, and service-to-repository responsibilities, but do not show the complete route, task, or processor wiring, so those connections are limited. The README emphasizes deployment platforms rather than additional runtime capabilities.

Main entry points: [`modules/proxy/service/proxy.go`](https://github.com/nersus15/mini-proxy/blob/main/modules/proxy/service/proxy.go) (Proxy service), [`modules/proxy/module.go`](https://github.com/nersus15/mini-proxy/blob/main/modules/proxy/module.go) (Proxy module), [`modules/proxy/repository/repository.go`](https://github.com/nersus15/mini-proxy/blob/main/modules/proxy/repository/repository.go) (Proxy repository), [`modules/proxy/handler/http.go`](https://github.com/nersus15/mini-proxy/blob/main/modules/proxy/handler/http.go) (HTTP handlers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Application runtime"]
  node_main["Application entry<br/>[main.go]"]
  node_module["Proxy module<br/>[module.go]"]
  node_config["Proxy configuration<br/>[config.go]"]
end

subgraph group_proxy["Proxy and FHIR"]
  node_handler["HTTP handlers<br/>[http.go]"]
  node_service["Proxy service<br/>[proxy.go]"]
  node_processor["FHIR mapping<br/>[mapper.go]"]
  node_updaters["FHIR reference updates"]
  node_httpclient["HTTP client<br/>[httpclient.go]"]
end

subgraph group_state["State and tasks"]
  node_repository["Proxy repository<br/>[repository.go]"]
  node_entities["Persisted records<br/>[entity.go]"]
  node_tasks["Background tasks<br/>[task.go]"]
  node_database[("Database")]
end

subgraph group_external["External systems"]
  node_satusehat(("Satusehat API"))
  node_ildki(("ILDKI endpoint"))
end

node_simfaskes(("SIMFASKES client"))

node_main -->|"loads modules"| node_module
node_simfaskes -->|"sends HTTP"| node_handler
node_handler -->|"calls operations"| node_service
node_service -->|"sends requests"| node_httpclient
node_service -->|"proxies requests"| node_satusehat
node_service -.->|"forwards credentials"| node_ildki
node_service -->|"reads and writes"| node_repository
node_repository -->|"queries records"| node_database
node_repository -->|"persists"| node_entities
node_processor -->|"dispatches updates"| node_updaters
node_module -->|"registers handlers"| node_handler
node_module -->|"wires service"| node_service
node_module -->|"wires repository"| node_repository
node_service -->|"uses settings"| node_config

click node_main "https://github.com/nersus15/mini-proxy/blob/main/webcore/main.go"
click node_module "https://github.com/nersus15/mini-proxy/blob/main/modules/proxy/module.go"
click node_handler "https://github.com/nersus15/mini-proxy/blob/main/modules/proxy/handler/http.go"
click node_service "https://github.com/nersus15/mini-proxy/blob/main/modules/proxy/service/proxy.go"
click node_processor "https://github.com/nersus15/mini-proxy/blob/main/modules/proxy/helper/processor/mapper.go"
click node_updaters "https://github.com/nersus15/mini-proxy/tree/main/modules/proxy/helper/processor/updater"
click node_httpclient "https://github.com/nersus15/mini-proxy/blob/main/modules/proxy/helper/utils/httpclient.go"
click node_config "https://github.com/nersus15/mini-proxy/blob/main/modules/proxy/config/config.go"
click node_repository "https://github.com/nersus15/mini-proxy/blob/main/modules/proxy/repository/repository.go"
click node_entities "https://github.com/nersus15/mini-proxy/blob/main/modules/proxy/entity/entity.go"
click node_tasks "https://github.com/nersus15/mini-proxy/blob/main/modules/proxy/service/task.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_main,node_module,node_config,node_simfaskes toneBlue
class node_handler,node_service,node_processor,node_updaters,node_httpclient toneAmber
class node_repository,node_entities,node_tasks,node_database toneMint
class node_satusehat,node_ildki toneRose
```

## Components

### Application runtime

- [Application entry](https://github.com/nersus15/mini-proxy/blob/main/webcore/main.go): `webcore/main.go`
- [Proxy module](https://github.com/nersus15/mini-proxy/blob/main/modules/proxy/module.go): `modules/proxy/module.go`
- [Proxy configuration](https://github.com/nersus15/mini-proxy/blob/main/modules/proxy/config/config.go): `modules/proxy/config/config.go`

### Proxy and FHIR

- [HTTP handlers](https://github.com/nersus15/mini-proxy/blob/main/modules/proxy/handler/http.go): `modules/proxy/handler/http.go`
- [Proxy service](https://github.com/nersus15/mini-proxy/blob/main/modules/proxy/service/proxy.go): `modules/proxy/service/proxy.go`
- [FHIR mapping](https://github.com/nersus15/mini-proxy/blob/main/modules/proxy/helper/processor/mapper.go): `modules/proxy/helper/processor/mapper.go`
- [FHIR reference updates](https://github.com/nersus15/mini-proxy/tree/main/modules/proxy/helper/processor/updater): `modules/proxy/helper/processor/updater`
- [HTTP client](https://github.com/nersus15/mini-proxy/blob/main/modules/proxy/helper/utils/httpclient.go): `modules/proxy/helper/utils/httpclient.go`

### State and tasks

- [Proxy repository](https://github.com/nersus15/mini-proxy/blob/main/modules/proxy/repository/repository.go): `modules/proxy/repository/repository.go`
- [Persisted records](https://github.com/nersus15/mini-proxy/blob/main/modules/proxy/entity/entity.go): `modules/proxy/entity/entity.go`
- [Background tasks](https://github.com/nersus15/mini-proxy/blob/main/modules/proxy/service/task.go): `modules/proxy/service/task.go`
- **Database**

### External systems

- **Satusehat API**
- **ILDKI endpoint**

### Other components

- **SIMFASKES client**

## Connections

- Application entry → Proxy module: loads modules
- SIMFASKES client → HTTP handlers: sends HTTP
- HTTP handlers → Proxy service: calls operations
- Proxy service → HTTP client: sends requests
- Proxy service → Satusehat API: proxies requests
- Proxy service → ILDKI endpoint: forwards credentials
- Proxy service → Proxy repository: reads and writes
- Proxy repository → Database: queries records
- Proxy repository → Persisted records: persists
- FHIR mapping → FHIR reference updates: dispatches updates
- Proxy module → HTTP handlers: registers handlers
- Proxy module → Proxy service: wires service
- Proxy module → Proxy repository: wires repository
- Proxy service → Proxy configuration: uses settings
