# tirrenotechnologies/tirreno architecture

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

- Interactive diagram: https://gitdiagram.com/tirrenotechnologies/tirreno
- Repository: https://github.com/tirrenotechnologies/tirreno

## Overview

Tirreno is a self-hosted, in-application security framework: products send contextual events to its sensor/API, which enriches and records them for the operator console to analyze. The console supports dashboards and entity activity views, automated risk rules, manual review, and field-audit trails. The diagram shows the sampled event-ingestion calls and the application’s aggregator structure; major README capabilities with unsampled implementations are retained as subsystem nodes. Some links to those unsampled features are dashed and unverified.

Main entry points: [`sensor/src/Controller/CreateEventController.php`](https://github.com/tirrenotechnologies/tirreno/blob/master/sensor/src/Controller/CreateEventController.php) (Event controller), [`app/Controllers/Services/Main.php`](https://github.com/tirrenotechnologies/tirreno/blob/master/app/Controllers/Services/Main.php) (Page services), [`app/Models/UserScore.php`](https://github.com/tirrenotechnologies/tirreno/blob/master/app/Models/UserScore.php) (Risk scoring), [`app/Core/Services/Controllers.php`](https://github.com/tirrenotechnologies/tirreno/blob/master/app/Core/Services/Controllers.php) (Controller registry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Event ingestion"]
  node_event_api["Event controller"]
  node_enrichment["Data enrichment"]
  node_query_parse["URL query parsing<br/>[QueryParser.php]"]
  node_ua_store[("User-agent records")]
  node_query_store[("URL query records")]
  node_event_store[("Event persistence")]
  node_storage[("Event database")]
end

subgraph group_analysis["Security analysis"]
  node_risk_rules["Risk rules<br/>[Rules.php]"]
  node_risk_score["Risk scoring<br/>[UserScore.php]"]
  node_review[("Review queue<br/>[ReviewQueue.php]")]
  node_field_audit[("Field audit trail")]
end

subgraph group_console["Operator console"]
  node_dashboard["Security dashboard<br/>[Dashboard.php]"]
  node_entity_view["Single-user view<br/>[User.php]"]
  node_page_main["Console entry<br/>[Main.php]"]
  node_page_services["Page services<br/>[Main.php]"]
end

subgraph group_core["Application core"]
  node_controllers["Controller registry<br/>[Controllers.php]"]
  node_entity_registry["Entity registry<br/>[Entities.php]"]
  node_model_registry["Model registry<br/>[Models.php]"]
end

node_sdk(("Product SDK"))

node_sdk -->|"sends events"| node_event_api
node_event_api -->|"requests enrichment"| node_enrichment
node_event_api -->|"parses URL"| node_query_parse
node_event_api -->|"inserts event"| node_event_store
node_event_api -.->|"detects device"| node_ua_store
node_event_api -.->|"stores query"| node_query_store
node_event_api -->|"records event"| node_storage
node_page_main -->|"uses registry"| node_controllers
node_page_services -->|"uses registry"| node_controllers
node_page_services -->|"resolves entities"| node_entity_registry
node_page_services -->|"resolves models"| node_model_registry
node_dashboard -.->|"powers dashboard"| node_page_services
node_entity_view -.->|"serves entity view"| node_page_services
node_risk_rules -.->|"calculates scores"| node_risk_score
node_risk_score -.->|"flags risky entities"| node_review
node_field_audit -.->|"supports audit view"| node_page_services

click node_event_api "https://github.com/tirrenotechnologies/tirreno/blob/master/sensor/src/Controller/CreateEventController.php"
click node_enrichment "https://github.com/tirrenotechnologies/tirreno/tree/master/sensor/src/Service/Enrichment"
click node_query_parse "https://github.com/tirrenotechnologies/tirreno/blob/master/sensor/src/Service/QueryParser.php"
click node_ua_store "https://github.com/tirrenotechnologies/tirreno/blob/master/sensor/src/Repository/UserAgentRepository.php"
click node_query_store "https://github.com/tirrenotechnologies/tirreno/blob/master/sensor/src/Repository/UrlQueryRepository.php"
click node_event_store "https://github.com/tirrenotechnologies/tirreno/tree/master/sensor/src/Repository"
click node_dashboard "https://github.com/tirrenotechnologies/tirreno/blob/master/app/Models/Dashboard.php"
click node_entity_view "https://github.com/tirrenotechnologies/tirreno/blob/master/app/Controllers/Services/User.php"
click node_risk_rules "https://github.com/tirrenotechnologies/tirreno/blob/master/app/Models/Rules.php"
click node_risk_score "https://github.com/tirrenotechnologies/tirreno/blob/master/app/Models/UserScore.php"
click node_review "https://github.com/tirrenotechnologies/tirreno/blob/master/app/Models/ReviewQueue.php"
click node_field_audit "https://github.com/tirrenotechnologies/tirreno/blob/master/app/Models/FieldAuditTrail.php"
click node_page_main "https://github.com/tirrenotechnologies/tirreno/blob/master/app/Controllers/Pages/Main.php"
click node_page_services "https://github.com/tirrenotechnologies/tirreno/blob/master/app/Controllers/Services/Main.php"
click node_controllers "https://github.com/tirrenotechnologies/tirreno/blob/master/app/Core/Services/Controllers.php"
click node_entity_registry "https://github.com/tirrenotechnologies/tirreno/blob/master/app/Core/Services/Entities.php"
click node_model_registry "https://github.com/tirrenotechnologies/tirreno/blob/master/app/Core/Services/Models.php"
click node_storage "https://github.com/tirrenotechnologies/tirreno/tree/master/sensor/src/Repository"

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_event_api,node_enrichment,node_query_parse,node_ua_store,node_query_store,node_event_store,node_storage toneBlue
class node_risk_rules,node_risk_score,node_review,node_field_audit toneAmber
class node_dashboard,node_entity_view,node_page_main,node_page_services toneMint
class node_controllers,node_entity_registry,node_model_registry toneRose
class node_sdk toneIndigo
```

## Components

### Event ingestion

- [Event controller](https://github.com/tirrenotechnologies/tirreno/blob/master/sensor/src/Controller/CreateEventController.php): `sensor/src/Controller/CreateEventController.php`
- [Data enrichment](https://github.com/tirrenotechnologies/tirreno/tree/master/sensor/src/Service/Enrichment): `sensor/src/Service/Enrichment`
- [URL query parsing](https://github.com/tirrenotechnologies/tirreno/blob/master/sensor/src/Service/QueryParser.php): `sensor/src/Service/QueryParser.php`
- [User-agent records](https://github.com/tirrenotechnologies/tirreno/blob/master/sensor/src/Repository/UserAgentRepository.php): `sensor/src/Repository/UserAgentRepository.php`
- [URL query records](https://github.com/tirrenotechnologies/tirreno/blob/master/sensor/src/Repository/UrlQueryRepository.php): `sensor/src/Repository/UrlQueryRepository.php`
- [Event persistence](https://github.com/tirrenotechnologies/tirreno/tree/master/sensor/src/Repository): `sensor/src/Repository`
- [Event database](https://github.com/tirrenotechnologies/tirreno/tree/master/sensor/src/Repository): `sensor/src/Repository`

### Security analysis

- [Risk rules](https://github.com/tirrenotechnologies/tirreno/blob/master/app/Models/Rules.php): `app/Models/Rules.php`
- [Risk scoring](https://github.com/tirrenotechnologies/tirreno/blob/master/app/Models/UserScore.php): `app/Models/UserScore.php`
- [Review queue](https://github.com/tirrenotechnologies/tirreno/blob/master/app/Models/ReviewQueue.php): `app/Models/ReviewQueue.php`
- [Field audit trail](https://github.com/tirrenotechnologies/tirreno/blob/master/app/Models/FieldAuditTrail.php): `app/Models/FieldAuditTrail.php`

### Operator console

- [Security dashboard](https://github.com/tirrenotechnologies/tirreno/blob/master/app/Models/Dashboard.php): `app/Models/Dashboard.php`
- [Single-user view](https://github.com/tirrenotechnologies/tirreno/blob/master/app/Controllers/Services/User.php): `app/Controllers/Services/User.php`
- [Console entry](https://github.com/tirrenotechnologies/tirreno/blob/master/app/Controllers/Pages/Main.php): `app/Controllers/Pages/Main.php`
- [Page services](https://github.com/tirrenotechnologies/tirreno/blob/master/app/Controllers/Services/Main.php): `app/Controllers/Services/Main.php`

### Application core

- [Controller registry](https://github.com/tirrenotechnologies/tirreno/blob/master/app/Core/Services/Controllers.php): `app/Core/Services/Controllers.php`
- [Entity registry](https://github.com/tirrenotechnologies/tirreno/blob/master/app/Core/Services/Entities.php): `app/Core/Services/Entities.php`
- [Model registry](https://github.com/tirrenotechnologies/tirreno/blob/master/app/Core/Services/Models.php): `app/Core/Services/Models.php`

### Other components

- **Product SDK**

## Connections

- Product SDK → Event controller: sends events (evidence: `README.md`)
- Event controller → Data enrichment: requests enrichment (evidence: `sensor/src/Controller/CreateEventController.php`)
- Event controller → URL query parsing: parses URL (evidence: `sensor/src/Controller/CreateEventController.php`)
- Event controller → Event persistence: inserts event (evidence: `sensor/src/Controller/CreateEventController.php`)
- Event controller → User-agent records: detects device
- Event controller → URL query records: stores query
- Event controller → Event database: records event (evidence: `sensor/src/Controller/CreateEventController.php`)
- Console entry → Controller registry: uses registry (evidence: `app/Controllers/Pages/Main.php`)
- Page services → Controller registry: uses registry (evidence: `app/Controllers/Services/Main.php`)
- Page services → Entity registry: resolves entities (evidence: `app/Controllers/Services/Main.php`)
- Page services → Model registry: resolves models (evidence: `app/Controllers/Services/Main.php`)
- Security dashboard → Page services: powers dashboard
- Single-user view → Page services: serves entity view
- Risk rules → Risk scoring: calculates scores
- Risk scoring → Review queue: flags risky entities
- Field audit trail → Page services: supports audit view
