# allinurl/goaccess architecture

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

- Interactive diagram: https://gitdiagram.com/allinurl/goaccess
- Repository: https://github.com/allinurl/goaccess

## Overview

GoAccess is a real-time web-log analyzer with terminal and browser-based reporting. The principal workflow is to configure log interpretation, parse incoming access-log records, aggregate traffic metrics, and present the resulting panels or reports. Its documented capabilities also include incremental on-disk persistence, GeoIP enrichment, and authenticated live WebSocket reporting. The source index identifies the main runtime modules, but excerpts do not expose every call site; documented links are used for the broader workflow, and uncertain internal dispatches are omitted.

Main entry points: [`src/goaccess.c`](https://github.com/allinurl/goaccess/blob/master/src/goaccess.c) (Application entry), [`src/gstorage.c`](https://github.com/allinurl/goaccess/blob/master/src/gstorage.c) (Metric aggregation), [`src/parser.c`](https://github.com/allinurl/goaccess/blob/master/src/parser.c) (Log parser), [`src/gholder.c`](https://github.com/allinurl/goaccess/blob/master/src/gholder.c) (Panel data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Ingestion and configuration"]
  node_cli["Application entry<br/>[goaccess.c]"]
  node_options["Options and formats<br/>[options.c]"]
  node_parser["Log parser<br/>[parser.c]"]
  node_fileio["Log input<br/>[fileio.c]"]
  node_utm["Campaign tracking<br/>[utm.c]"]
end

subgraph group_analysis["Analysis and state"]
  node_browsers["Browser classification<br/>[browsers.c]"]
  node_geo["GeoIP enrichment<br/>[geolocation.c]"]
  node_storage["Metric aggregation<br/>[gstorage.c]"]
  node_hashes[("Hash storage<br/>[gkhash.c]")]
  node_holder["Panel data<br/>[gholder.c]"]
  node_persistence[("Disk persistence<br/>[persistence.c]")]
end

subgraph group_reporting["Reports and interfaces"]
  node_terminal["Terminal dashboard<br/>[ui.c]"]
  node_dashboard["HTML dashboard<br/>[gdashboard.c]"]
  node_charts["Dashboard charts<br/>[gchart.c]"]
  node_exports["Report output<br/>[output.c]"]
  node_csv["CSV reports<br/>[csv.c]"]
  node_json["JSON reports<br/>[json.c]"]
end

subgraph group_live["Live delivery and security"]
  node_websocket["WebSocket server<br/>[websocket.c]"]
  node_auth["JWT authentication<br/>[wsauth.c]"]
end

node_operator(("Operator"))
node_logfiles["Web logs"]
node_browserclient(("Browser viewer"))

node_operator -->|"runs"| node_cli
node_logfiles -->|"provides logs"| node_parser
node_cli -->|"configures"| node_options
node_cli -->|"starts parsing"| node_parser
node_parser -->|"records metrics"| node_storage
node_parser -->|"extracts campaigns"| node_utm
node_storage -->|"aggregates in"| node_hashes
node_storage -.->|"classifies traffic"| node_browsers
node_storage -.->|"enriches traffic"| node_geo
node_hashes -->|"persists data"| node_persistence
node_storage -.->|"supplies metrics"| node_holder
node_holder -.->|"renders panels"| node_terminal
node_holder -.->|"renders panels"| node_dashboard
node_dashboard -.->|"uses charts"| node_charts
node_cli -->|"generates reports"| node_exports
node_exports -.->|"writes CSV"| node_csv
node_exports -.->|"writes JSON"| node_json
node_cli -->|"serves live reports"| node_websocket
node_websocket -.->|"verifies tokens"| node_auth
node_websocket -->|"streams dashboard"| node_browserclient

click node_cli "https://github.com/allinurl/goaccess/blob/master/src/goaccess.c"
click node_options "https://github.com/allinurl/goaccess/blob/master/src/options.c"
click node_parser "https://github.com/allinurl/goaccess/blob/master/src/parser.c"
click node_fileio "https://github.com/allinurl/goaccess/blob/master/src/fileio.c"
click node_utm "https://github.com/allinurl/goaccess/blob/master/src/utm.c"
click node_browsers "https://github.com/allinurl/goaccess/blob/master/src/browsers.c"
click node_geo "https://github.com/allinurl/goaccess/blob/master/src/geolocation.c"
click node_storage "https://github.com/allinurl/goaccess/blob/master/src/gstorage.c"
click node_hashes "https://github.com/allinurl/goaccess/blob/master/src/gkhash.c"
click node_holder "https://github.com/allinurl/goaccess/blob/master/src/gholder.c"
click node_persistence "https://github.com/allinurl/goaccess/blob/master/src/persistence.c"
click node_terminal "https://github.com/allinurl/goaccess/blob/master/src/ui.c"
click node_dashboard "https://github.com/allinurl/goaccess/blob/master/src/gdashboard.c"
click node_charts "https://github.com/allinurl/goaccess/blob/master/src/gchart.c"
click node_exports "https://github.com/allinurl/goaccess/blob/master/src/output.c"
click node_csv "https://github.com/allinurl/goaccess/blob/master/src/csv.c"
click node_json "https://github.com/allinurl/goaccess/blob/master/src/json.c"
click node_websocket "https://github.com/allinurl/goaccess/blob/master/src/websocket.c"
click node_auth "https://github.com/allinurl/goaccess/blob/master/src/wsauth.c"

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_cli,node_options,node_parser,node_fileio,node_utm,node_browserclient toneBlue
class node_browsers,node_geo,node_storage,node_hashes,node_holder,node_persistence toneAmber
class node_terminal,node_dashboard,node_charts,node_exports,node_csv,node_json toneMint
class node_websocket,node_auth toneRose
class node_operator,node_logfiles toneIndigo
```

## Components

### Ingestion and configuration

- [Application entry](https://github.com/allinurl/goaccess/blob/master/src/goaccess.c): `src/goaccess.c`
- [Options and formats](https://github.com/allinurl/goaccess/blob/master/src/options.c): `src/options.c`
- [Log parser](https://github.com/allinurl/goaccess/blob/master/src/parser.c): `src/parser.c`
- [Log input](https://github.com/allinurl/goaccess/blob/master/src/fileio.c): `src/fileio.c`
- [Campaign tracking](https://github.com/allinurl/goaccess/blob/master/src/utm.c): `src/utm.c`

### Analysis and state

- [Browser classification](https://github.com/allinurl/goaccess/blob/master/src/browsers.c): `src/browsers.c`
- [GeoIP enrichment](https://github.com/allinurl/goaccess/blob/master/src/geolocation.c): `src/geolocation.c`
- [Metric aggregation](https://github.com/allinurl/goaccess/blob/master/src/gstorage.c): `src/gstorage.c`
- [Hash storage](https://github.com/allinurl/goaccess/blob/master/src/gkhash.c): `src/gkhash.c`
- [Panel data](https://github.com/allinurl/goaccess/blob/master/src/gholder.c): `src/gholder.c`
- [Disk persistence](https://github.com/allinurl/goaccess/blob/master/src/persistence.c): `src/persistence.c`

### Reports and interfaces

- [Terminal dashboard](https://github.com/allinurl/goaccess/blob/master/src/ui.c): `src/ui.c`
- [HTML dashboard](https://github.com/allinurl/goaccess/blob/master/src/gdashboard.c): `src/gdashboard.c`
- [Dashboard charts](https://github.com/allinurl/goaccess/blob/master/src/gchart.c): `src/gchart.c`
- [Report output](https://github.com/allinurl/goaccess/blob/master/src/output.c): `src/output.c`
- [CSV reports](https://github.com/allinurl/goaccess/blob/master/src/csv.c): `src/csv.c`
- [JSON reports](https://github.com/allinurl/goaccess/blob/master/src/json.c): `src/json.c`

### Live delivery and security

- [WebSocket server](https://github.com/allinurl/goaccess/blob/master/src/websocket.c): `src/websocket.c`
- [JWT authentication](https://github.com/allinurl/goaccess/blob/master/src/wsauth.c): `src/wsauth.c`

### Other components

- **Operator**
- **Web logs**
- **Browser viewer**

## Connections

- Operator → Application entry: runs
- Web logs → Log parser: provides logs
- Application entry → Options and formats: configures (evidence: `src/goaccess.c`)
- Application entry → Log parser: starts parsing
- Log parser → Metric aggregation: records metrics
- Log parser → Campaign tracking: extracts campaigns
- Metric aggregation → Hash storage: aggregates in (evidence: `src/gstorage.c`)
- Metric aggregation → Browser classification: classifies traffic
- Metric aggregation → GeoIP enrichment: enriches traffic
- Hash storage → Disk persistence: persists data (evidence: `src/gkhash.c`)
- Metric aggregation → Panel data: supplies metrics
- Panel data → Terminal dashboard: renders panels
- Panel data → HTML dashboard: renders panels
- HTML dashboard → Dashboard charts: uses charts
- Application entry → Report output: generates reports
- Report output → CSV reports: writes CSV
- Report output → JSON reports: writes JSON
- Application entry → WebSocket server: serves live reports
- WebSocket server → JWT authentication: verifies tokens
- WebSocket server → Browser viewer: streams dashboard
