Skip to content

brettoak/SvcWatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SvcWatch 🚀

SvcWatch is a professional, full-stack Nginx log monitoring and analytics dashboard. It "tails" Nginx access logs in real-time, parses them into structured metrics, provides an authorized REST API, and visualizes data on a modern, responsive web dashboard.

🏗️ Monorepo Structure

The project is organized as a monorepo for clean separation of concerns:

  • /backend: High-performance Go service using Gin and Redis.
  • /frontend: Modern analytics dashboard built with Vue 3, Vite, and TypeScript.
  • /.github: Multi-server parallel deployment workflows with GitHub Actions.

✨ Key Features

  • 📡 Real-time Analytics: Intelligent agent that tails logs, handles log rotation automatically, and parses entries on-the-fly using robust regex.
  • 📊 Modern Dashboard: Visualize QPS, status code distributions, and traffic spikes with interactive charts and real-time updates.
  • 🔐 Secure API: Integrated with external Auth services for per-request permission validation for all monitoring endpoints.
  • 💾 Redis Persistence: Efficient data storage for long-term metric aggregation and persistence across service restarts.
  • ⚙️ Matrix Deployment: Automatic, parallel deployment to multiple production servers via GitHub Actions Matrix strategy.
  • 🛡️ Nginx Reverse Proxy: Secure HTTPS/SSL mapping via Nginx (port 8080) with automated configuration and Certbot integration.

🚀 Getting Started

Backend (Go)

  1. Navigate to the backend/ directory.
  2. Install dependencies: go mod tidy.
  3. Configure your environment in config/config.yaml.
  4. Run natively: go run cmd/server/main.go.

Frontend (Vue)

  1. Navigate to the frontend/ directory.
  2. Install dependencies: npm install.
  3. Start the development server: npm run dev.

📦 Deployment (CI/CD)

The project includes pre-configured CI/CD pipelines for automated, targeted deployments.

  1. Backend Deployment: deploy-backend.yml triggers only on backend/** changes.
  2. Frontend Deployment: deploy-frontend.yml triggers only on frontend/** changes.

Required Setup

To use the CI/CD pipeline, configure the following in GitHub:

Repository Variables (Settings → Secrets and variables → Actions → Variables):

  • DEPLOY_TARGETS: JSON array of server metadata (IP, domain, log paths).

Repository Secrets (Settings → Secrets and variables → Actions → Secrets):

  • SERVER_SSH_KEY: Private RSA/ED25519 key for SSH access.
  • AUTH_PASSPORT_URL, AUTH_PERMISSION_URL, AUTH_SYS_CODE: Authentication service integration.
  • REDIS_ADDR, REDIS_PASSWORD: Redis connection credentials.

🛠️ Tech Stack

  • Languages: Go, TypeScript
  • Backend Framework: Gin Gonic
  • Frontend Framework: Vue 3 + Vite
  • Storage: Redis, In-Memory
  • Automation: GitHub Actions, Nginx, Certbot

About

SvcWatch is a lightweight, self-hosted server monitoring dashboard that parses access logs to visualize key performance metrics, such as request latency, error rates, and status distributions, in a modern UI.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors