# technovaid/alfresco-client architecture

> Architecture diagram of the GitHub repository technovaid/alfresco-client, 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/technovaid/alfresco-client
- Repository: https://github.com/technovaid/alfresco-client

## Overview

This Go service exposes a small HTTP façade over Alfresco Content Services: callers browse sites and blogs or perform path-based file CRUD, and receive JSON or file content. The router dispatches requests to handlers; those handlers own calls to the Alfresco client, which performs REST requests and path/node operations. Blog detail responses also pass HTML through a cleaner. The README documents all endpoint capabilities; the sampled source supports the wiring shown here, while omitted client sections limit finer-grained details.

Main entry points: [`alfresco-client/main.go`](https://github.com/technovaid/alfresco-client/blob/master/alfresco-client/main.go) (HTTP server and routes), [`alfresco-client/file_handlers.go`](https://github.com/technovaid/alfresco-client/blob/master/alfresco-client/file_handlers.go) (File path handlers), [`alfresco-client/handlers.go`](https://github.com/technovaid/alfresco-client/blob/master/alfresco-client/handlers.go) (Site and blog handlers), [`alfresco-client/api_client.go`](https://github.com/technovaid/alfresco-client/blob/master/alfresco-client/api_client.go) (Alfresco REST client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_server["HTTP server and routes<br/>[main.go]"]
  node_health["Health endpoint<br/>[main.go]"]
  node_responses["JSON responses<br/>[http_json.go]"]
  node_config["Runtime configuration<br/>[config.go]"]
end

subgraph group_browse["Site Browsing"]
  node_sitehandlers["Site and blog handlers<br/>[handlers.go]"]
  node_html["HTML cleanup<br/>[html_cleaner.go]"]
end

subgraph group_files["File Management"]
  node_filehandlers["File path handlers<br/>[file_handlers.go]"]
  node_upload["Upload parsing<br/>[file_handlers.go]"]
end

subgraph group_alfresco["Alfresco Access"]
  node_alfclient["Alfresco REST client<br/>[api_client.go]"]
  node_types["API data types<br/>[api_types.go]"]
  node_errors["Not-found detection<br/>[errors.go]"]
end

node_caller(("API caller"))
node_acs["Alfresco Content Services"]

node_caller -->|"sends requests"| node_server
node_server -->|"loads settings"| node_config
node_server -->|"routes health"| node_health
node_server -->|"dispatches browsing"| node_sitehandlers
node_server -->|"dispatches file requests"| node_filehandlers
node_health -->|"writes JSON"| node_responses
node_sitehandlers -->|"requests site and node data"| node_alfclient
node_sitehandlers -->|"cleans blog content"| node_html
node_sitehandlers -->|"writes JSON"| node_responses
node_filehandlers -->|"parses uploads"| node_upload
node_filehandlers -->|"resolves and changes files"| node_alfclient
node_filehandlers -->|"checks not found"| node_errors
node_filehandlers -->|"writes JSON errors"| node_responses
node_alfclient -->|"calls public REST API"| node_acs
node_alfclient -->|"decodes responses"| node_types

click node_server "https://github.com/technovaid/alfresco-client/blob/master/alfresco-client/main.go"
click node_health "https://github.com/technovaid/alfresco-client/blob/master/alfresco-client/main.go"
click node_responses "https://github.com/technovaid/alfresco-client/blob/master/alfresco-client/http_json.go"
click node_config "https://github.com/technovaid/alfresco-client/blob/master/alfresco-client/config.go"
click node_sitehandlers "https://github.com/technovaid/alfresco-client/blob/master/alfresco-client/handlers.go"
click node_html "https://github.com/technovaid/alfresco-client/blob/master/alfresco-client/html_cleaner.go"
click node_filehandlers "https://github.com/technovaid/alfresco-client/blob/master/alfresco-client/file_handlers.go"
click node_upload "https://github.com/technovaid/alfresco-client/blob/master/alfresco-client/file_handlers.go"
click node_alfclient "https://github.com/technovaid/alfresco-client/blob/master/alfresco-client/api_client.go"
click node_types "https://github.com/technovaid/alfresco-client/blob/master/alfresco-client/api_types.go"
click node_errors "https://github.com/technovaid/alfresco-client/blob/master/alfresco-client/errors.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_health,node_responses,node_config toneBlue
class node_sitehandlers,node_html toneAmber
class node_filehandlers,node_upload,node_caller toneMint
class node_alfclient,node_types,node_errors toneRose
class node_acs toneIndigo
```

## Components

### HTTP API

- [HTTP server and routes](https://github.com/technovaid/alfresco-client/blob/master/alfresco-client/main.go): `alfresco-client/main.go`
- [Health endpoint](https://github.com/technovaid/alfresco-client/blob/master/alfresco-client/main.go): `alfresco-client/main.go`
- [JSON responses](https://github.com/technovaid/alfresco-client/blob/master/alfresco-client/http_json.go): `alfresco-client/http_json.go`
- [Runtime configuration](https://github.com/technovaid/alfresco-client/blob/master/alfresco-client/config.go): `alfresco-client/config.go`

### Site Browsing

- [Site and blog handlers](https://github.com/technovaid/alfresco-client/blob/master/alfresco-client/handlers.go): `alfresco-client/handlers.go`
- [HTML cleanup](https://github.com/technovaid/alfresco-client/blob/master/alfresco-client/html_cleaner.go): `alfresco-client/html_cleaner.go`

### File Management

- [File path handlers](https://github.com/technovaid/alfresco-client/blob/master/alfresco-client/file_handlers.go): `alfresco-client/file_handlers.go`
- [Upload parsing](https://github.com/technovaid/alfresco-client/blob/master/alfresco-client/file_handlers.go): `alfresco-client/file_handlers.go`

### Alfresco Access

- [Alfresco REST client](https://github.com/technovaid/alfresco-client/blob/master/alfresco-client/api_client.go): `alfresco-client/api_client.go`
- [API data types](https://github.com/technovaid/alfresco-client/blob/master/alfresco-client/api_types.go): `alfresco-client/api_types.go`
- [Not-found detection](https://github.com/technovaid/alfresco-client/blob/master/alfresco-client/errors.go): `alfresco-client/errors.go`

### Other components

- **API caller**
- **Alfresco Content Services**

## Connections

- API caller → HTTP server and routes: sends requests
- HTTP server and routes → Runtime configuration: loads settings
- HTTP server and routes → Health endpoint: routes health
- HTTP server and routes → Site and blog handlers: dispatches browsing
- HTTP server and routes → File path handlers: dispatches file requests
- Health endpoint → JSON responses: writes JSON
- Site and blog handlers → Alfresco REST client: requests site and node data
- Site and blog handlers → HTML cleanup: cleans blog content
- Site and blog handlers → JSON responses: writes JSON
- File path handlers → Upload parsing: parses uploads
- File path handlers → Alfresco REST client: resolves and changes files
- File path handlers → Not-found detection: checks not found
- File path handlers → JSON responses: writes JSON errors
- Alfresco REST client → Alfresco Content Services: calls public REST API
- Alfresco REST client → API data types: decodes responses
