# Live Checking System

Monitors the SmartCoin automation environment and triggers notification emails when important checks fail.

## Checks

- SmartCoin app health URL
- Smile.one balance threshold
- queue status file
- browser heartbeat file
- Smile.one session status file

## Commands

```bash
npm run check
npm start
```

`npm run check` runs one pass. `npm start` runs continuously.

## Dry Run

`LIVE_CHECK_DRY_RUN=true` logs alerts without sending email. Set it to `false` after `notification/.env` has real Gmail credentials.

## State File Examples

`state/queue-status.json`

```json
{
  "ok": true,
  "pending": 0,
  "failed": 0
}
```

`state/browser-heartbeat.json`

```json
{
  "ok": true,
  "timestamp": "2026-05-06T10:00:00.000Z"
}
```

`state/session-status.json`

```json
{
  "valid": true,
  "account": "Smile.one main account"
}
```
