# sbezhuk/beebase-gateway architecture

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

- Interactive diagram: https://gitdiagram.com/sbezhuk/beebase-gateway
- Repository: https://github.com/sbezhuk/beebase-gateway

## Overview

BeeBase Gateway is a stateless HTTP reverse proxy: clients send requests to one entry point, which routes each request to the backend service that owns that API path. The gateway also answers its own health and readiness checks and forwards paths, queries, and authorization headers without business logic or token verification. Configuration supplies each upstream URL. Routing details are documented in the README and sampled router source; backend services are external to this repository.

Main entry points: [`internal/proxy/proxy.go`](https://github.com/sbezhuk/beebase-gateway/blob/main/internal/proxy/proxy.go) (Reverse proxy), [`cmd/gateway/main.go`](https://github.com/sbezhuk/beebase-gateway/blob/main/cmd/gateway/main.go) (Gateway process), [`internal/transport/http/router.go`](https://github.com/sbezhuk/beebase-gateway/blob/main/internal/transport/http/router.go) (HTTP router), [`internal/config/config.go`](https://github.com/sbezhuk/beebase-gateway/blob/main/internal/config/config.go) (Runtime configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Gateway entry"]
  node_gateway["Gateway process<br/>[main.go]"]
  node_config["Runtime configuration<br/>[config.go]"]
end

subgraph group_routing["Routing and proxy"]
  node_router["HTTP router<br/>[router.go]"]
  node_proxy["Reverse proxy<br/>[proxy.go]"]
end

node_client(("HTTP client"))
node_auth["Auth service"]
node_apiary["Apiary service"]
node_hive["Hive service"]
node_inspection["Inspection service"]
node_harvest["Harvest service"]
node_media["Media service"]
node_statistics["Statistics service"]
node_subscription["Subscription service"]
node_notification["Notification service"]

node_client -->|"sends request"| node_gateway
node_gateway -->|"loads settings"| node_config
node_gateway -->|"builds proxies"| node_proxy
node_gateway -->|"installs handler"| node_router
node_gateway -->|"serves response"| node_client
node_router -->|"dispatches request"| node_proxy
node_proxy -->|"forwards request"| node_auth
node_proxy -->|"forwards request"| node_apiary
node_proxy -->|"forwards request"| node_hive
node_proxy -->|"forwards request"| node_inspection
node_proxy -->|"forwards request"| node_harvest
node_proxy -->|"forwards request"| node_media
node_proxy -->|"forwards request"| node_statistics
node_proxy -->|"forwards request"| node_subscription
node_proxy -->|"forwards request"| node_notification

click node_gateway "https://github.com/sbezhuk/beebase-gateway/blob/main/cmd/gateway/main.go"
click node_config "https://github.com/sbezhuk/beebase-gateway/blob/main/internal/config/config.go"
click node_router "https://github.com/sbezhuk/beebase-gateway/blob/main/internal/transport/http/router.go"
click node_proxy "https://github.com/sbezhuk/beebase-gateway/blob/main/internal/proxy/proxy.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_gateway,node_config,node_client toneBlue
class node_router,node_proxy toneAmber
class node_auth,node_hive,node_inspection,node_harvest,node_media,node_statistics,node_subscription,node_notification toneIndigo
class node_apiary toneMint
```

## Components

### Gateway entry

- [Gateway process](https://github.com/sbezhuk/beebase-gateway/blob/main/cmd/gateway/main.go): `cmd/gateway/main.go`
- [Runtime configuration](https://github.com/sbezhuk/beebase-gateway/blob/main/internal/config/config.go): `internal/config/config.go`

### Routing and proxy

- [HTTP router](https://github.com/sbezhuk/beebase-gateway/blob/main/internal/transport/http/router.go): `internal/transport/http/router.go`
- [Reverse proxy](https://github.com/sbezhuk/beebase-gateway/blob/main/internal/proxy/proxy.go): `internal/proxy/proxy.go`

### Other components

- **HTTP client**
- **Auth service**
- **Apiary service**
- **Hive service**
- **Inspection service**
- **Harvest service**
- **Media service**
- **Statistics service**
- **Subscription service**
- **Notification service**

## Connections

- HTTP client → Gateway process: sends request
- Gateway process → Runtime configuration: loads settings
- Gateway process → Reverse proxy: builds proxies
- Gateway process → HTTP router: installs handler
- Gateway process → HTTP client: serves response
- HTTP router → Reverse proxy: dispatches request
- Reverse proxy → Auth service: forwards request
- Reverse proxy → Apiary service: forwards request
- Reverse proxy → Hive service: forwards request
- Reverse proxy → Inspection service: forwards request
- Reverse proxy → Harvest service: forwards request
- Reverse proxy → Media service: forwards request
- Reverse proxy → Statistics service: forwards request
- Reverse proxy → Subscription service: forwards request
- Reverse proxy → Notification service: forwards request
