# naveen-prakash-sk/smart-sprinkler architecture

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

- Interactive diagram: https://gitdiagram.com/naveen-prakash-sk/smart-sprinkler
- Repository: https://github.com/naveen-prakash-sk/smart-sprinkler

## Overview

This tree contains only Firebase configuration and structure files; the firmware, dashboard, and alert server described in the README are not present here. The graph therefore maps the documented product at a high level and includes the available configuration files without inferring their runtime behavior. Relationships are based on the README, not inspected source code.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_edge["Edge irrigation"]
  node_firmware["ESP8266 firmware"]
  node_moisture["Moisture sensor"]
  node_flow["Flow sensor"]
  node_valve["Bypass valve"]
  node_ota["OTA portal"]
end

subgraph group_cloud["Cloud data"]
  node_firebase[("Firebase RTDB")]
  node_db_rules["Database rules"]
  node_db_structure["Database structure"]
  node_firebase_config["Firebase configuration<br/>[firebase.json]"]
end

subgraph group_client["User dashboard"]
  node_dashboard["Web dashboard"]
  node_auth["Firebase Auth"]
end

subgraph group_alerts["Alerting"]
  node_alert_server["Alert server"]
  node_telegram_api["Telegram Bot API"]
end

node_grower(("Grower"))
node_telegram_user(("Telegram client"))

node_grower -->|"controls"| node_dashboard
node_grower -->|"authenticates"| node_auth
node_dashboard -->|"reads and writes"| node_firebase
node_firmware -->|"samples"| node_moisture
node_firmware -->|"measures"| node_flow
node_firmware -->|"controls"| node_valve
node_firmware -->|"reads and writes"| node_firebase
node_firmware -->|"serves"| node_ota
node_alert_server -.->|"monitors"| node_firebase
node_alert_server -->|"sends alerts"| node_telegram_api
node_telegram_api -->|"pushes notifications"| node_telegram_user

click node_db_rules "https://github.com/naveen-prakash-sk/smart-sprinkler/blob/main/database.rules.json"
click node_db_structure "https://github.com/naveen-prakash-sk/smart-sprinkler/blob/main/firebase_structure.json"
click node_firebase_config "https://github.com/naveen-prakash-sk/smart-sprinkler/blob/main/firebase.json"

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_firmware,node_moisture,node_flow,node_valve,node_ota,node_telegram_user toneBlue
class node_firebase,node_db_rules,node_db_structure,node_firebase_config toneAmber
class node_dashboard,node_auth toneMint
class node_alert_server,node_telegram_api toneRose
class node_grower toneIndigo
```

## Components

### Edge irrigation

- **ESP8266 firmware**
- **Moisture sensor**
- **Flow sensor**
- **Bypass valve**
- **OTA portal**

### Cloud data

- **Firebase RTDB**
- [Database rules](https://github.com/naveen-prakash-sk/smart-sprinkler/blob/main/database.rules.json): `database.rules.json`
- [Database structure](https://github.com/naveen-prakash-sk/smart-sprinkler/blob/main/firebase_structure.json): `firebase_structure.json`
- [Firebase configuration](https://github.com/naveen-prakash-sk/smart-sprinkler/blob/main/firebase.json): `firebase.json`

### User dashboard

- **Web dashboard**
- **Firebase Auth**

### Alerting

- **Alert server**
- **Telegram Bot API**

### Other components

- **Grower**
- **Telegram client**

## Connections

- Grower → Web dashboard: controls (evidence: `README.md`)
- Grower → Firebase Auth: authenticates (evidence: `README.md`)
- Web dashboard → Firebase RTDB: reads and writes (evidence: `README.md`)
- ESP8266 firmware → Moisture sensor: samples (evidence: `README.md`)
- ESP8266 firmware → Flow sensor: measures (evidence: `README.md`)
- ESP8266 firmware → Bypass valve: controls (evidence: `README.md`)
- ESP8266 firmware → Firebase RTDB: reads and writes (evidence: `README.md`)
- ESP8266 firmware → OTA portal: serves (evidence: `README.md`)
- Alert server → Firebase RTDB: monitors (evidence: `README.md`)
- Alert server → Telegram Bot API: sends alerts (evidence: `README.md`)
- Telegram Bot API → Telegram client: pushes notifications (evidence: `README.md`)
