# bariskisir/websitedowntracker architecture

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

- Interactive diagram: https://gitdiagram.com/bariskisir/websitedowntracker
- Repository: https://github.com/bariskisir/websitedowntracker

## Overview

Website Down Tracker is a .NET background service that periodically checks configured websites and sends Telegram alerts after repeated unsuccessful checks. Its workflow is configuration, scheduled probing, failure-count tracking, then notification. The tracker keeps failure counts in memory and resets them after a successful response. Startup wiring and the message-service abstraction form the internal layer separating monitoring from Telegram delivery. The README documents configuration and alerting; source excerpts support the runtime links shown here.

Main entry points: [`src/WebsiteDownTracker/WebsiteDownTrackService.cs`](https://github.com/bariskisir/websitedowntracker/blob/master/src/WebsiteDownTracker/WebsiteDownTrackService.cs) (Tracking service), [`src/WebsiteDownTracker/Program.cs`](https://github.com/bariskisir/websitedowntracker/blob/master/src/WebsiteDownTracker/Program.cs) (Host startup), [`src/WebsiteDownTracker/TelegramService.cs`](https://github.com/bariskisir/websitedowntracker/blob/master/src/WebsiteDownTracker/TelegramService.cs) (Telegram service), [`src/WebsiteDownTracker/AppSettings.cs`](https://github.com/bariskisir/websitedowntracker/blob/master/src/WebsiteDownTracker/AppSettings.cs) (App settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Startup and configuration"]
  node_settingsfile["appsettings.json<br/>[appsettings.json]"]
  node_program["Host startup<br/>[Program.cs]"]
  node_settings["App settings<br/>[AppSettings.cs]"]
end

subgraph group_monitoring["Website monitoring"]
  node_tracker["Tracking service"]
  node_downinfo["Failure count record<br/>[WebsiteDownInfo.cs]"]
end

subgraph group_messaging["Telegram notifications"]
  node_messageinterface["Message service interface<br/>[IMessageService.cs]"]
  node_telegramservice["Telegram service<br/>[TelegramService.cs]"]
end

node_operator(("Operator"))
node_environment["Environment variables"]
node_website(("Configured websites"))
node_telegramapi(("Telegram Bot API"))

node_operator -->|"sets values"| node_environment
node_environment -->|"provides configuration"| node_program
node_settingsfile -->|"read by"| node_program
node_program -->|"configures"| node_settings
node_program -->|"registers hosted service"| node_tracker
node_program -->|"registers implementation"| node_telegramservice
node_tracker -->|"reads settings"| node_settings
node_tracker -->|"sends HTTP checks"| node_website
node_website -->|"returns responses"| node_tracker
node_tracker -->|"updates failure counts"| node_downinfo
node_tracker -->|"dispatches alert"| node_messageinterface
node_messageinterface -->|"implemented by"| node_telegramservice
node_telegramservice -->|"reads credentials"| node_settings
node_telegramservice -->|"sends message"| node_telegramapi

click node_settingsfile "https://github.com/bariskisir/websitedowntracker/blob/master/src/WebsiteDownTracker/appsettings.json"
click node_program "https://github.com/bariskisir/websitedowntracker/blob/master/src/WebsiteDownTracker/Program.cs"
click node_settings "https://github.com/bariskisir/websitedowntracker/blob/master/src/WebsiteDownTracker/AppSettings.cs"
click node_tracker "https://github.com/bariskisir/websitedowntracker/blob/master/src/WebsiteDownTracker/WebsiteDownTrackService.cs"
click node_downinfo "https://github.com/bariskisir/websitedowntracker/blob/master/src/WebsiteDownTracker/WebsiteDownInfo.cs"
click node_messageinterface "https://github.com/bariskisir/websitedowntracker/blob/master/src/WebsiteDownTracker/IMessageService.cs"
click node_telegramservice "https://github.com/bariskisir/websitedowntracker/blob/master/src/WebsiteDownTracker/TelegramService.cs"

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_settingsfile,node_program,node_settings toneBlue
class node_tracker,node_downinfo toneAmber
class node_messageinterface,node_telegramservice,node_telegramapi toneMint
class node_operator,node_environment,node_website toneIndigo
```

## Components

### Startup and configuration

- [appsettings.json](https://github.com/bariskisir/websitedowntracker/blob/master/src/WebsiteDownTracker/appsettings.json): `src/WebsiteDownTracker/appsettings.json`
- [Host startup](https://github.com/bariskisir/websitedowntracker/blob/master/src/WebsiteDownTracker/Program.cs): `src/WebsiteDownTracker/Program.cs`
- [App settings](https://github.com/bariskisir/websitedowntracker/blob/master/src/WebsiteDownTracker/AppSettings.cs): `src/WebsiteDownTracker/AppSettings.cs`

### Website monitoring

- [Tracking service](https://github.com/bariskisir/websitedowntracker/blob/master/src/WebsiteDownTracker/WebsiteDownTrackService.cs): `src/WebsiteDownTracker/WebsiteDownTrackService.cs`
- [Failure count record](https://github.com/bariskisir/websitedowntracker/blob/master/src/WebsiteDownTracker/WebsiteDownInfo.cs): `src/WebsiteDownTracker/WebsiteDownInfo.cs`

### Telegram notifications

- [Message service interface](https://github.com/bariskisir/websitedowntracker/blob/master/src/WebsiteDownTracker/IMessageService.cs): `src/WebsiteDownTracker/IMessageService.cs`
- [Telegram service](https://github.com/bariskisir/websitedowntracker/blob/master/src/WebsiteDownTracker/TelegramService.cs): `src/WebsiteDownTracker/TelegramService.cs`

### Other components

- **Operator**
- **Environment variables**
- **Configured websites**
- **Telegram Bot API**

## Connections

- Operator → Environment variables: sets values
- Environment variables → Host startup: provides configuration
- appsettings.json → Host startup: read by
- Host startup → App settings: configures
- Host startup → Tracking service: registers hosted service
- Host startup → Telegram service: registers implementation
- Tracking service → App settings: reads settings
- Tracking service → Configured websites: sends HTTP checks
- Configured websites → Tracking service: returns responses
- Tracking service → Failure count record: updates failure counts
- Tracking service → Message service interface: dispatches alert
- Message service interface → Telegram service: implemented by
- Telegram service → App settings: reads credentials
- Telegram service → Telegram Bot API: sends message
