# chahdd/robot-logs-analysis architecture

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

- Interactive diagram: https://gitdiagram.com/chahdd/robot-logs-analysis
- Repository: https://github.com/chahdd/robot-logs-analysis

## Overview

Robot Logs is a robot-event analysis assistant: security staff view mission summaries and alerts in a Flutter app, while a FastAPI backend parses logs and produces summaries. The documented product also supports date-based log browsing. Backend excerpts show parsing, incident processing, and an Ollama request; Flutter source was not sampled, so its internal wiring and the app-to-backend connection are not verified here.

Main entry points: [`robot logs backend/api.py`](https://github.com/chahdd/robot-logs-analysis/blob/main/robot%20logs%20backend/api.py) (FastAPI endpoints), [`robot logs flutter/lib/main.dart`](https://github.com/chahdd/robot-logs-analysis/blob/main/robot%20logs%20flutter/lib/main.dart) (Mobile app), [`robot logs flutter/lib/services/api_service.dart`](https://github.com/chahdd/robot-logs-analysis/blob/main/robot%20logs%20flutter/lib/services/api_service.dart) (API client), [`robot logs flutter/lib/screens/home_screen.dart`](https://github.com/chahdd/robot-logs-analysis/blob/main/robot%20logs%20flutter/lib/screens/home_screen.dart) (Home screen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Mobile experience"]
  node_flutter_app["Mobile app<br/>[main.dart]"]
  node_home["Home screen<br/>[home_screen.dart]"]
  node_dashboard["Dashboard<br/>[dashboard_tab.dart]"]
  node_events_view["Events view<br/>[events_tab.dart]"]
  node_report_view["AI report<br/>[ai_report_tab.dart]"]
  node_api_client["API client<br/>[api_service.dart]"]
end

subgraph group_api["Backend API"]
  node_api["FastAPI endpoints<br/>[api.py]"]
end

subgraph group_logs["Log processing"]
  node_date_index["Date discovery<br/>[api.py]"]
  node_log_parsers["Log parsers<br/>[api.py]"]
end

subgraph group_analysis["Summarization"]
  node_pipeline["Analysis pipeline<br/>[api.py]"]
  node_event_facts["Event facts<br/>[api.py]"]
  node_incident_processing["Incident processing<br/>[api.py]"]
end

node_guard(("Security guard"))
node_ollama["Ollama model"]
node_log_files[("Robot logs")]

node_guard -->|"views reports"| node_flutter_app
node_flutter_app -.->|"opens"| node_home
node_api_client -.->|"requests"| node_api
node_api -->|"lists dates"| node_date_index
node_api -->|"loads events"| node_log_parsers
node_log_files -.->|"reads"| node_log_parsers
node_api -->|"runs analysis"| node_pipeline
node_pipeline -->|"processes incidents"| node_incident_processing
node_pipeline -->|"requests generation"| node_ollama
node_pipeline -.->|"extracts facts"| node_event_facts

click node_flutter_app "https://github.com/chahdd/robot-logs-analysis/blob/main/robot%20logs%20flutter/lib/main.dart"
click node_home "https://github.com/chahdd/robot-logs-analysis/blob/main/robot%20logs%20flutter/lib/screens/home_screen.dart"
click node_dashboard "https://github.com/chahdd/robot-logs-analysis/blob/main/robot%20logs%20flutter/lib/screens/dashboard_tab.dart"
click node_events_view "https://github.com/chahdd/robot-logs-analysis/blob/main/robot%20logs%20flutter/lib/screens/events_tab.dart"
click node_report_view "https://github.com/chahdd/robot-logs-analysis/blob/main/robot%20logs%20flutter/lib/screens/ai_report_tab.dart"
click node_api_client "https://github.com/chahdd/robot-logs-analysis/blob/main/robot%20logs%20flutter/lib/services/api_service.dart"
click node_api "https://github.com/chahdd/robot-logs-analysis/blob/main/robot%20logs%20backend/api.py"
click node_date_index "https://github.com/chahdd/robot-logs-analysis/blob/main/robot%20logs%20backend/api.py"
click node_log_parsers "https://github.com/chahdd/robot-logs-analysis/blob/main/robot%20logs%20backend/api.py"
click node_pipeline "https://github.com/chahdd/robot-logs-analysis/blob/main/robot%20logs%20backend/api.py"
click node_event_facts "https://github.com/chahdd/robot-logs-analysis/blob/main/robot%20logs%20backend/api.py"
click node_incident_processing "https://github.com/chahdd/robot-logs-analysis/blob/main/robot%20logs%20backend/api.py"

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_flutter_app,node_home,node_dashboard,node_events_view,node_report_view,node_api_client toneBlue
class node_api,node_log_files toneAmber
class node_date_index,node_log_parsers toneMint
class node_pipeline,node_event_facts,node_incident_processing toneRose
class node_guard,node_ollama toneIndigo
```

## Components

### Mobile experience

- [Mobile app](https://github.com/chahdd/robot-logs-analysis/blob/main/robot%20logs%20flutter/lib/main.dart): `robot logs flutter/lib/main.dart`
- [Home screen](https://github.com/chahdd/robot-logs-analysis/blob/main/robot%20logs%20flutter/lib/screens/home_screen.dart): `robot logs flutter/lib/screens/home_screen.dart`
- [Dashboard](https://github.com/chahdd/robot-logs-analysis/blob/main/robot%20logs%20flutter/lib/screens/dashboard_tab.dart): `robot logs flutter/lib/screens/dashboard_tab.dart`
- [Events view](https://github.com/chahdd/robot-logs-analysis/blob/main/robot%20logs%20flutter/lib/screens/events_tab.dart): `robot logs flutter/lib/screens/events_tab.dart`
- [AI report](https://github.com/chahdd/robot-logs-analysis/blob/main/robot%20logs%20flutter/lib/screens/ai_report_tab.dart): `robot logs flutter/lib/screens/ai_report_tab.dart`
- [API client](https://github.com/chahdd/robot-logs-analysis/blob/main/robot%20logs%20flutter/lib/services/api_service.dart): `robot logs flutter/lib/services/api_service.dart`

### Backend API

- [FastAPI endpoints](https://github.com/chahdd/robot-logs-analysis/blob/main/robot%20logs%20backend/api.py): `robot logs backend/api.py`

### Log processing

- [Date discovery](https://github.com/chahdd/robot-logs-analysis/blob/main/robot%20logs%20backend/api.py): `robot logs backend/api.py`
- [Log parsers](https://github.com/chahdd/robot-logs-analysis/blob/main/robot%20logs%20backend/api.py): `robot logs backend/api.py`

### Summarization

- [Analysis pipeline](https://github.com/chahdd/robot-logs-analysis/blob/main/robot%20logs%20backend/api.py): `robot logs backend/api.py`
- [Event facts](https://github.com/chahdd/robot-logs-analysis/blob/main/robot%20logs%20backend/api.py): `robot logs backend/api.py`
- [Incident processing](https://github.com/chahdd/robot-logs-analysis/blob/main/robot%20logs%20backend/api.py): `robot logs backend/api.py`

### Other components

- **Security guard**
- **Ollama model**
- **Robot logs**

## Connections

- Security guard → Mobile app: views reports (evidence: `README.md`)
- Mobile app → Home screen: opens
- API client → FastAPI endpoints: requests
- FastAPI endpoints → Date discovery: lists dates (evidence: `robot logs backend/api.py`)
- FastAPI endpoints → Log parsers: loads events (evidence: `robot logs backend/api.py`)
- Robot logs → Log parsers: reads
- FastAPI endpoints → Analysis pipeline: runs analysis (evidence: `robot logs backend/api.py`)
- Analysis pipeline → Incident processing: processes incidents (evidence: `robot logs backend/api.py`)
- Analysis pipeline → Ollama model: requests generation (evidence: `robot logs backend/api.py`)
- Analysis pipeline → Event facts: extracts facts (evidence: `robot logs backend/api.py`)
