# zainab1411/cyber-mirage- architecture

> Architecture diagram of the GitHub repository zainab1411/cyber-mirage-, 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/zainab1411/cyber-mirage-
- Repository: https://github.com/zainab1411/cyber-mirage-

## Overview

Cyber-Mirage is a honeypot-attack reporting dashboard. Its main user flow is login, view dashboard data, and inspect/filter/export attack attempts; the backend serves a JSON summary from a local file. Separate update scripts can build summaries from Elasticsearch events or an exported Kibana CSV. The README describes broader behavioral analysis, while the sampled updater and dashboard use differing summary schemas, so their data compatibility is not established. The Elasticsearch updater’s scheduled loop is defined but not enabled by its main block.

Main entry points: [`app.py`](https://github.com/zainab1411/cyber-mirage-/blob/main/app.py) (Flask routes), [`data/results.json`](https://github.com/zainab1411/cyber-mirage-/blob/main/data/results.json) (Dashboard results), [`scripts/update_results.py`](https://github.com/zainab1411/cyber-mirage-/blob/main/scripts/update_results.py) (Elasticsearch updater), [`scripts/update_results_v2.py`](https://github.com/zainab1411/cyber-mirage-/blob/main/scripts/update_results_v2.py) (CSV processor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_browser["Browser dashboard"]
  node_flask["Flask routes<br/>[app.py]"]
  node_login["Login page<br/>[login.html]"]
  node_dashboard["Dashboard page<br/>[dashboard.html]"]
  node_frontend["Dashboard behavior<br/>[script.js]"]
  node_loader["JSON loader<br/>[app.py]"]
  node_landing["Landing page<br/>[index.html]"]
end

subgraph group_analysis["Data preparation"]
  node_elastic_updater["Elasticsearch updater<br/>[update_results.py]"]
  node_csv_updater["CSV processor"]
end

subgraph group_state["Dashboard data"]
  node_results["Dashboard results<br/>[results.json]"]
end

node_user(("Dashboard user"))
node_elastic[("Elasticsearch")]
node_csv["Kibana export CSV"]

node_user -->|"uses"| node_browser
node_browser -->|"requests pages"| node_flask
node_flask -->|"renders"| node_login
node_flask -->|"renders"| node_dashboard
node_flask -->|"renders"| node_landing
node_flask -->|"serves dashboard"| node_frontend
node_frontend -->|"fetches data"| node_flask
node_flask -->|"calls"| node_loader
node_loader -->|"reads"| node_results
node_elastic_updater -.->|"queries events"| node_elastic
node_elastic_updater -.->|"writes summary"| node_results
node_csv_updater -.->|"reads"| node_csv
node_csv_updater -.->|"writes summary"| node_results

click node_flask "https://github.com/zainab1411/cyber-mirage-/blob/main/app.py"
click node_login "https://github.com/zainab1411/cyber-mirage-/blob/main/templates/login.html"
click node_dashboard "https://github.com/zainab1411/cyber-mirage-/blob/main/templates/dashboard.html"
click node_frontend "https://github.com/zainab1411/cyber-mirage-/blob/main/static/script.js"
click node_elastic_updater "https://github.com/zainab1411/cyber-mirage-/blob/main/scripts/update_results.py"
click node_csv_updater "https://github.com/zainab1411/cyber-mirage-/blob/main/scripts/update_results_v2.py"
click node_csv "https://github.com/zainab1411/cyber-mirage-/blob/main/scripts/Untitled%20Discover%20session(1).csv"
click node_loader "https://github.com/zainab1411/cyber-mirage-/blob/main/app.py"
click node_results "https://github.com/zainab1411/cyber-mirage-/blob/main/data/results.json"
click node_landing "https://github.com/zainab1411/cyber-mirage-/blob/main/templates/index.html"

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_browser,node_flask,node_login,node_dashboard,node_frontend,node_loader,node_landing,node_user toneBlue
class node_elastic_updater,node_csv_updater,node_elastic toneAmber
class node_results toneMint
class node_csv toneTeal
```

## Components

### Web application

- **Browser dashboard**
- [Flask routes](https://github.com/zainab1411/cyber-mirage-/blob/main/app.py): `app.py`
- [Login page](https://github.com/zainab1411/cyber-mirage-/blob/main/templates/login.html): `templates/login.html`
- [Dashboard page](https://github.com/zainab1411/cyber-mirage-/blob/main/templates/dashboard.html): `templates/dashboard.html`
- [Dashboard behavior](https://github.com/zainab1411/cyber-mirage-/blob/main/static/script.js): `static/script.js`
- [JSON loader](https://github.com/zainab1411/cyber-mirage-/blob/main/app.py): `app.py`
- [Landing page](https://github.com/zainab1411/cyber-mirage-/blob/main/templates/index.html): `templates/index.html`

### Data preparation

- [Elasticsearch updater](https://github.com/zainab1411/cyber-mirage-/blob/main/scripts/update_results.py): `scripts/update_results.py`
- [CSV processor](https://github.com/zainab1411/cyber-mirage-/blob/main/scripts/update_results_v2.py): `scripts/update_results_v2.py`

### Dashboard data

- [Dashboard results](https://github.com/zainab1411/cyber-mirage-/blob/main/data/results.json): `data/results.json`

### Other components

- **Dashboard user**
- **Elasticsearch**
- [Kibana export CSV](https://github.com/zainab1411/cyber-mirage-/blob/main/scripts/Untitled%20Discover%20session(1).csv): `scripts/Untitled Discover session(1).csv`

## Connections

- Dashboard user → Browser dashboard: uses
- Browser dashboard → Flask routes: requests pages
- Flask routes → Login page: renders
- Flask routes → Dashboard page: renders
- Flask routes → Landing page: renders
- Flask routes → Dashboard behavior: serves dashboard
- Dashboard behavior → Flask routes: fetches data
- Flask routes → JSON loader: calls
- JSON loader → Dashboard results: reads
- Elasticsearch updater → Elasticsearch: queries events
- Elasticsearch updater → Dashboard results: writes summary
- CSV processor → Kibana export CSV: reads
- CSV processor → Dashboard results: writes summary
