VIYAN MONITORING API V1 - MVP

Files:
config/database.php
config/bootstrap.php
api/v1/index.php
api/v1/register.php
api/v1/heartbeat.php
public/health.php

cPanel deployment:
1. Create the MySQL/MariaDB database and import viyan_monitoring.sql.
2. Put these files in the monitor.viyan.in document root.
3. Edit config/database.php with the database credentials.
4. Protect the config directory from web access if it is inside the document root.
5. Test:
   https://monitor.viyan.in/public/health.php
   https://monitor.viyan.in/api/v1/index.php

Registration:
POST /api/v1/register

Example JSON:
{
  "client_code": "ABC001",
  "client_name": "ABC Industries",
  "server_code": "ABC001-SRV01",
  "server_name": "WIN-SERVER01",
  "os": "Windows",
  "agent_version": "2.0"
}

The response contains an agent_token. The agent must store that token securely.

Heartbeat:
POST /api/v1/heartbeat
Authorization: Bearer <agent_token>

Example JSON:
{
  "status": "healthy",
  "os": "Windows",
  "agent_version": "2.0",
  "retention_plan": "Professional",
  "backup_source_count": 2,
  "last_snapshot_id": "73132879",
  "repository_status": "healthy"
}

Do not commit real database credentials or agent tokens to source control.
