# Getting Started

This page covers the environment go-web-monitor needs, how to install it, and how to add your first monitored site.

## Prerequisites

| Item | Requirement |
|------|-------------|
| Go | 1.21 or higher (`go.mod` declares `go 1.21`) |
| Terminal | ANSI color support and enough width for a six-column table plus the side panel |
| Network | Reachability to the target sites; the SSL check needs outbound access to port 443 |
| SMTP account | Optional, required only for email alerts |

## Installation

### Run Directly

```bash
git clone https://github.com/pardnchiu/go-web-monitor.git
cd go-web-monitor
go run ./cmd/tui
```

### Build a Binary

```bash
git clone https://github.com/pardnchiu/go-web-monitor.git
cd go-web-monitor
go build -o go-web-monitor ./cmd/tui
./go-web-monitor
```

The module name in `go.mod` is `website-monitor`, which differs from the GitHub path, so `go install github.com/pardnchiu/go-web-monitor/...` does not work; build from source instead.

## First Run

1. Start the program in the directory where you want to keep its data. It looks for `.webMonitor.json` in the **current working directory** and creates an empty config when the file is missing (`cmd/tui/main.go:12`).
2. The Monitor table sits on the left, the System panel at the top right, and the Command input at the bottom right. The cursor starts in the input.
3. Type a command and press Enter:

```bash
add example.com
add https://api.example.com/health
```

`add` checks the site immediately and writes the result to `.webMonitor.json`; after that, every site is checked concurrently once a minute.

4. Type `quit` (or press <kbd>Ctrl+C</kbd>) to exit.

## Next Steps

- Alerts need SMTP; see [Email Alert Setup](/smtp-setup)
- Every command and key binding: [CLI Reference](/cli-reference)
- Config file fields: [Config File](/configuration)
