> [!NOTE]
> This README was generated by [SKILL](https://github.com/agenvoy/skill-readme-generate), get the ZH version from [here](https://github.com/pardnchiu/go-web-monitor/blob/main/doc/README.zh.md).

***

<p align="center">
<strong>KEEP EVERY SITE IN SIGHT, RIGHT FROM YOUR TERMINAL!</strong>
</p>

<p align="center">
<a href="https://github.com/pardnchiu/go-web-monitor/releases"><img src="https://img.shields.io/github/v/tag/pardnchiu/go-web-monitor?include_prereleases&style=for-the-badge" alt="Release"></a>
<a href="https://github.com/pardnchiu/go-web-monitor/blob/main/LICENSE"><img src="https://img.shields.io/github/license/pardnchiu/go-web-monitor?include_prereleases&style=for-the-badge" alt="License"></a>
</p>

***

> A Go terminal website monitor with SSL expiry tracking, consecutive-failure email alerts, and HEAD-first health probes

## Table of Contents

- [Features](#features)
- [Architecture](#architecture)
- [License](#license)
- [Author](#author)

## Features

> `git clone https://github.com/pardnchiu/go-web-monitor && cd go-web-monitor && go run ./cmd/tui` · [Documentation](https://github.com/pardnchiu/go-web-monitor/blob/main/doc/doc.md)

- **Live Terminal Dashboard** — A TUI table shows each site's status, response time, status code, and overall uptime, refreshed concurrently every minute with no backend service to deploy.
- **HEAD First, GET Fallback** — Probes start with a lightweight HEAD request and switch to GET only on failure or 404, saving bandwidth while still handling servers that reject HEAD.
- **SSL Expiry Countdown** — Reads the certificate on port 443 to compute the days remaining and colors it green, yellow, or red at the 30- and 7-day thresholds.
- **Alert Only on Sustained Failure** — Sends an email only after 5 consecutive offline checks, filtering out false alarms from transient blips.
- **SMTP Configured by Command** — Set the host, credentials, and recipients inside the TUI; the client picks implicit TLS on 465 or STARTTLS on 587 and writes every change back to local JSON.

## Architecture

> [Full Architecture](https://github.com/pardnchiu/go-web-monitor/blob/main/doc/architecture.md)

```mermaid
graph TB
    Main[cmd/tui entry] --> Store[(.webMonitor.json)]
    Main --> UI[TUI]
    UI -->|every minute / refresh| Monitor[Monitor core]
    UI -->|commands| Monitor
    Monitor -->|HEAD → GET| Site[Target site]
    Monitor -->|TLS 443| SSL[SSL certificate check]
    Monitor -->|5 consecutive failures| SMTP[SMTP mailer]
    SMTP --> Mail[Mail server]
    Monitor -->|save| Store
```

## License

This project is licensed under the [MIT LICENSE](https://github.com/pardnchiu/go-web-monitor/blob/main/LICENSE).

## Author

Just [open an issue](https://github.com/pardnchiu/go-web-monitor/issues/new) to share an idea.

<a href="https://github.com/pardnchiu/go-web-monitor/graphs/contributors">
  <img src="https://contrib.rocks/image?repo=pardnchiu/go-web-monitor&cache_bust=2026-10-05" alt="go-web-monitor contributors" />
</a>

***

©️ 2025 [邱敬幃 Pardn Chiu](https://www.linkedin.com/in/pardnchiu)
