Skip to content

SnapTrack is a backup monitoring and management system built with Go (Golang) and Nuxt.js / Vue 3.

Notifications You must be signed in to change notification settings

stackroost/snaptrack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SnapTrack

Enterprise Backup Monitoring & Management System

Go Version Nuxt.js Vue.js License Build Status


Table of Contents

Overview

SnapTrack is a comprehensive backup monitoring and management system designed for enterprise environments. Built with modern technologies including Go (Golang) for the backend and Nuxt.js/Vue 3 for the frontend, it provides real-time monitoring, automated backup management, and detailed analytics for your backup infrastructure.

Key Benefits

  • Real-time Monitoring: Live dashboard with system metrics and backup status
  • Multi-Server Support: Monitor local and remote servers from a single interface
  • Automated Workflows: Schedule and manage backup operations automatically
  • Detailed Analytics: Comprehensive logging and reporting capabilities
  • Enterprise Ready: Production-grade security and scalability features

Features

Monitoring & Analytics

  • Real-time Dashboard - Live system metrics and backup status
  • Process Monitoring - Track backup processes and system resources
  • Historical Data - Detailed backup logs with metadata and trends
  • Alert System - Notifications for failed backups and system issues

Server Management

  • Multi-Server Support - Manage local and remote backup servers
  • SSH Integration - Secure remote server monitoring and management
  • Server Health Checks - Automated monitoring of server status and resources

Backup Operations

  • Automated Backups - Schedule and manage backup operations
  • Manual Triggers - On-demand backup execution
  • Progress Tracking - Real-time backup progress monitoring
  • Backup Verification - Integrity checks and validation

Security & Authentication

  • JWT Authentication - Secure user authentication and session management
  • PAM Integration - System-level authentication support
  • Role-based Access - Granular permission management
  • Secure Communications - Encrypted data transmission

Architecture

┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│   Frontend      │    │    Backend      │    │   Database      │
│   (Nuxt.js)     │◄──►│   (Go/Fiber)    │◄──►│  (PostgreSQL)   │
│                 │    │                 │    │                 │
│ • Vue 3         │    │ • REST API      │    │ • GORM ORM      │
│ • TailwindCSS   │    │ • WebSockets    │    │ • Migrations    │
│ • PrimeVue      │    │ • JWT Auth      │    │ • Backup Logs   │
│ • Chart.js      │    │ • SSH Client    │    │ • Server Config │
└─────────────────┘    └─────────────────┘    └─────────────────┘

Screenshots

Click to view screenshots

Dashboard Overview

Dashboard Real-time system metrics and backup status overview

Backup Monitoring

Monitor Live backup process monitoring with progress tracking

Process Management

Processes System process monitoring and resource usage

Server Management

Servers Multi-server configuration and health monitoring

Backup History

Backups Detailed backup logs and historical data

Prerequisites

System Requirements

  • Operating System: Linux (Ubuntu 20.04+ recommended)
  • Memory: 2GB RAM minimum, 4GB recommended
  • Storage: 10GB free space minimum
  • Network: Internet connection for remote monitoring

Software Dependencies

  • Go: 1.25.1 or higher
  • Node.js: 18.x or higher
  • npm: 9.x or higher
  • PostgreSQL: 12.x or higher
  • Git: Latest version

Optional Dependencies

  • Docker: For containerized deployment
  • Nginx: For reverse proxy setup
  • SSL Certificate: For HTTPS in production

Installation

Quick Start (Recommended)

  1. Clone the Repository

    git clone https://github.com/stackroost/snaptrack.git
    cd snaptrack
  2. Run Production Installation

    sudo ./install_snaptrack.sh
  3. Configure Database

    # Create PostgreSQL database
    sudo -u postgres createdb snaptrack
    sudo -u postgres createuser snaptrack_user
  4. Update Configuration

    sudo nano /etc/snaptrack/config.yaml
    # Update database credentials and JWT secret
  5. Start Services

    sudo systemctl start snaptrack
    sudo systemctl status snaptrack

Manual Installation

Click to expand manual installation steps

Backend Setup

  1. Navigate to Server Directory

    cd server
  2. Install Dependencies

    go mod download
    go mod tidy
  3. Build Application

    go build -o ../bin/server/snaptrack main.go
  4. Run Backend

    ./bin/server/snaptrack --config config.yaml

Frontend Setup

  1. Navigate to Web Directory

    cd web
  2. Install Dependencies

    npm install
  3. Development Mode

    npm run dev
  4. Production Build

    npm run build
    npm run generate

Configuration

Configuration File Location

  • Production: /etc/snaptrack/config.yaml
  • Development: ./config.yaml

Sample Configuration

# Environment configuration
env: production

# Server settings
server:
  host: "0.0.0.0"
  port: "8080"
  frontend_path: "/opt/snaptrack/frontend/dist"
  backend_base_url: "http://localhost:8080/api"

# CORS settings
cors:
  origins: "*"  # Configure specific origins in production

# Security settings
security:
  jwt_secret: "your-super-secure-jwt-secret-here"
  session_timeout: "24h"
  max_login_attempts: 5

# Database configuration
database:
  host: "localhost"
  port: 5432
  user: "snaptrack_user"
  password: "your-secure-database-password"
  dbname: "snaptrack"
  ssl_mode: "require"  # Use in production
  max_connections: 25
  max_idle_connections: 5

# Logging configuration
logging:
  level: "info"  # debug, info, warn, error
  file: "/var/log/snaptrack/app.log"
  max_size: 100  # MB
  max_backups: 5
  max_age: 30    # days

# Backup settings
backup:
  default_retention: "30d"
  max_concurrent_jobs: 5
  temp_directory: "/tmp/snaptrack"
  
# Monitoring settings
monitoring:
  metrics_interval: "30s"
  health_check_interval: "60s"
  alert_threshold: 90  # percentage

Environment Variables

# Optional environment variable overrides
export SNAPTRACK_CONFIG_PATH="/etc/snaptrack/config.yaml"
export SNAPTRACK_LOG_LEVEL="info"
export SNAPTRACK_DB_HOST="localhost"
export SNAPTRACK_DB_PORT="5432"

Usage

Web Interface

  1. Access Dashboard

    http://localhost:8080
    
  2. Login

    • Use system credentials (PAM authentication)
    • Or configured user accounts
  3. Navigation

    • Dashboard: System overview and metrics
    • Monitors: Real-time backup monitoring
    • Servers: Server management and configuration
    • Backups: Backup history and management
    • Processes: System process monitoring

Command Line Interface

# Start service
sudo systemctl start snaptrack

# Stop service
sudo systemctl stop snaptrack

# Check status
sudo systemctl status snaptrack

# View logs
sudo journalctl -u snaptrack -f

# Configuration test
/opt/snaptrack/snaptrack --config /etc/snaptrack/config.yaml --test-config

API Documentation

Authentication

# Login
curl -X POST http://localhost:8080/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username": "admin", "password": "password"}'

Backup Operations

# Get backup status
curl -H "Authorization: Bearer <token>" \
  http://localhost:8080/api/backups

# Start backup
curl -X POST -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  http://localhost:8080/api/backups/start \
  -d '{"server_id": 1, "backup_type": "full"}'

Server Management

# List servers
curl -H "Authorization: Bearer <token>" \
  http://localhost:8080/api/servers

# Add server
curl -X POST -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  http://localhost:8080/api/servers \
  -d '{"name": "Server1", "host": "192.168.1.100", "type": "remote"}'

Development

Development Environment Setup

  1. Prerequisites

    # Install Go
    wget https://go.dev/dl/go1.25.1.linux-amd64.tar.gz
    sudo tar -C /usr/local -xzf go1.25.1.linux-amd64.tar.gz
    
    # Install Node.js
    curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
    sudo apt-get install -y nodejs
  2. Clone and Setup

    git clone https://github.com/stackroost/snaptrack.git
    cd snaptrack
    
    # Backend
    cd server && go mod download
    
    # Frontend
    cd ../web && npm install
  3. Development Servers

    # Terminal 1 - Backend
    cd server && go run main.go
    
    # Terminal 2 - Frontend
    cd web && npm run dev

Project Structure

snaptrack/
├── server/                 # Go backend
│   ├── main.go            # Application entry point
│   ├── api/               # API routes and handlers
│   ├── auth/              # Authentication logic
│   ├── config/            # Configuration management
│   ├── db/                # Database models and operations
│   └── services/          # Business logic services
├── web/                   # Nuxt.js frontend
│   ├── components/        # Vue components
│   ├── pages/             # Application pages
│   ├── layouts/           # Page layouts
│   ├── middleware/        # Route middleware
│   └── assets/            # Static assets
├── bin/                   # Compiled binaries
├── screenshots/           # Application screenshots
└── install_snaptrack.sh   # Production installer

Code Style Guidelines

  • Go: Follow standard Go formatting (gofmt)
  • Vue/JavaScript: Use ESLint with Vue 3 configuration
  • CSS: Use TailwindCSS utility classes
  • Commits: Follow conventional commit format

Deployment

Production Deployment

  1. Build Application

    # Backend
    cd server && go build -o ../bin/server/snaptrack main.go
    
    # Frontend
    cd web && npm run build && npm run generate
  2. Deploy with Installer

    sudo ./install_snaptrack.sh
  3. Configure Reverse Proxy (Nginx)

    server {
        listen 80;
        server_name your-domain.com;
        
        location / {
            proxy_pass http://localhost:8080;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
        }
    }

Monitoring

Performance Metrics

  • Response time monitoring
  • Database connection pooling
  • Memory usage tracking
  • Backup operation metrics

Troubleshooting

Common Issues

Database Connection Issues

Problem: Cannot connect to PostgreSQL database

Solutions:

  1. Check PostgreSQL service status

    sudo systemctl status postgresql
  2. Verify database credentials in config

  3. Check firewall settings

  4. Ensure database exists and user has permissions

Frontend Not Loading

Problem: Frontend shows 404 or blank page

Solutions:

  1. Check frontend path in configuration
  2. Verify frontend files are built and copied
  3. Check file permissions
  4. Review server logs for errors
Authentication Issues

Problem: Cannot login or JWT errors

Solutions:

  1. Verify JWT secret is configured
  2. Check PAM configuration
  3. Review user permissions
  4. Check system time synchronization

Log Analysis

# Application logs
sudo journalctl -u snaptrack -f

# Error logs
sudo tail -f /var/log/snaptrack/error.log

# Access logs
sudo tail -f /var/log/snaptrack/access.log

Contributing

We welcome contributions!

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Support

Getting Help


Made with ❤️ by the mahesh bhatiya

⭐ Star us on GitHub🐛 Report Bug💡 Request Feature

About

SnapTrack is a backup monitoring and management system built with Go (Golang) and Nuxt.js / Vue 3.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published