Skip to content

Latest commit

Β 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Verolla β€” Real-Time Infrastructure Monitoring & Predictive Alert Engine

Verolla Logo

Build Status Tests Node.js Express SQLite License

A software-engineering-driven telemetry and predictive infrastructure health monitoring system, developed end-to-end using a formal SDLC process β€” from requirements and architectural modeling through implementation and structured testing.

Engineering Process β€’ Features β€’ Architecture β€’ Quick Start β€’ Testing β€’ API Docs


πŸ“Œ Overview

Verolla is a full-lifecycle software engineering project: a telemetry and health monitoring platform built to give DevOps teams and system administrators real-time visibility into server metrics, proactive incident prevention via predictive forecasting, and automated multi-channel alerting.

The project was developed by a team of 3 following a structured Software Development Life Cycle (SDLC) β€” requirements elicitation, architectural design, UML/DFD modeling, implementation, and a formal, multi-tier testing strategy β€” rather than an ad-hoc build. Every major design decision is traceable back to a documented requirement or architectural diagram in docs/, UML/, and DFD/.

Functionally, Verolla incorporates an Exponentially-Weighted Moving Average (EWMA) linear regression engine that projects resource exhaustion 45s–5m before a breach occurs, enabling preemptive mitigation rather than reactive alerting.


🧭 Engineering Process

Verolla was built as a software engineering case study, not just a coded application. The development process followed these phases:

1. Requirements Engineering

  • Elicited and documented functional and non-functional requirements in a complete Software Requirements Specification (SRS) (docs/SRS.md).
  • Modeled system actors and interactions through Use Case Diagrams (UML/UsecaseDiagrams), covering roles like user and admin.

2. System & Architectural Design

  • Defined a hybrid modular-monolith and event-driven architecture to balance deployment simplicity with responsive, event-driven telemetry and alert propagation.
  • Formalized the architectural style in docs/SoftwareArchitecture/SoftwareArchitectureStyle.md.
  • Produced Level 0 and Level 1 Data Flow Diagrams (DFD) (DFD/) to trace how telemetry, predictions, and alerts move between system components.
  • Modeled system structure with a complete UML Class Diagram (UML/UMLClassDiagram.png) and Component Diagrams (UML/ComponentDiagrams).

3. Implementation

  • Translated design artifacts into a working Node.js/Express backend and SQLite persistence layer, keeping module boundaries (server.js, dal.js, predictor.js, etc.) aligned with the component diagrams above.

4. Verification & Validation

  • Validated the system against its own requirements using a 61-test automated suite spanning white-box, black-box, and feature/ML-logic testing.
  • Documented test strategy, coverage, and results in a formal Testing Report (docs/TestingReport.md).

This documentation-first, traceable approach is intended to mirror how monitoring/observability systems are actually specified and built in industry, rather than treating design docs as an afterthought to the code.


πŸš€ Core Features

1. Real-Time Hardware Telemetry

  • CPU Sampling: Calculates non-blocking differential core tick idle deltas across all physical and logical CPU cores.
  • Memory & Swap: Real-time RAM utilization tracking against system physical memory buffers.
  • Disk & Network I/O: Tracks disk partition capacity and real-time network throughput (inbound/outbound KB/s) using systeminformation.
  • Availability Probing: Performs active HTTP/HTTPS health checks on external endpoints with round-trip latency measurements.

2. Predictive Anomaly Forecasting (v2 Engine)

  • Trend Forecasting: Exponentially-weighted regression ($R^2 \ge 0.65$, slope $\ge 0.08%/\text{s}$) calculates estimated time of breach (ETA in seconds) and confidence scores.
  • Temporal Pattern Memory: Analyzes 14-day historical breach distributions to detect recurring diurnal spikes (hour-of-day / day-of-week).
  • Anti-Flapping Cooldown: Automatic prediction resolution when metrics fall safely below threshold for consecutive cycles.

3. Resilient Alerting & Multi-Channel Notifications

  • Sustained Breach Verification: Enforces a 60-second continuous threshold breach gate to eliminate false positives from transient micro-spikes.
  • Multi-Channel Dispatch: Dispatches incident alerts via SMTP email (Nodemailer), SMS webhooks, and real-time in-app dashboard badges.
  • Lifecycle Management: Acknowledge, resolve, or audit incidents directly from the web console.

4. Security & Administration

  • Authentication & RBAC: Salted Bcrypt password hashing (bcryptjs), sliding-window IP rate limiting (5 attempts / 15m), and Role-Based Access Control (user vs admin).
  • Immutable Audit Logging: Tracks administrative actions (user provisioning, password resets, retention purges).
  • Database Performance: High-concurrency SQLite database with Write-Ahead Logging (WAL mode).

5. Integrated Load Testing Suite

  • Built-in multi-threaded CPU burn tools (simulate_cpu.js) and heap allocation simulators (simulate_memory.js) for end-to-end incident verification against the documented requirements.

πŸ—οΈ System Architecture

flowchart TD
    subgraph Client ["Client Interface (SPA / Glassmorphism)"]
        UI_Dash["Dashboard (dashboard.html)"]
        UI_Metrics["Metrics (metrics.html)"]
        UI_Alerts["Alerts (alerts.html)"]
        UI_AI["AI Predictions (predictions.html)"]
        UI_Admin["Admin Console (admin.html)"]
    end

    subgraph Backend ["Node.js / Express Server (server.js)"]
        Router["Express REST API & Static Middleware"]
        Auth["Auth & Rate Limiter (Bcrypt / In-Memory Map)"]
        Collector["Telemetry Collector (OS & systeminformation)"]
        Predictor["Predictive Engine (EWMA Linear Regression)"]
        AlertEngine["Sustained-Breach Alert Evaluator (60s Gate)"]
        AvailChecker["Availability Ping Prober (HTTP/HTTPS)"]
    end

    subgraph Storage ["Persistence Layer (SQLite / WAL Mode)"]
        DB[(verolla.db)]
        DAL["Data Access Layer (dal.js)"]
    end

    subgraph Dispatch ["Notification Channels"]
        Email["SMTP Email (Nodemailer)"]
        SMS["SMS Webhooks"]
    end

    Client <-->|"REST / JSON (Polling & Fetch)"| Router
    Router --> Auth
    Router --> DAL
    Collector --> Predictor
    Collector --> AlertEngine
    AvailChecker --> AlertEngine
    AlertEngine --> Dispatch
    Predictor --> DAL
    AlertEngine --> DAL
    DAL <--> DB
Loading

This diagram reflects the component boundaries defined during architectural design β€” see UML/ComponentDiagrams for the source design artifacts this implementation is traced from.


🌐 GitHub Pages & Live Demo

GitHub Pages is designed for static hosting (HTML/CSS/JS). Verolla includes a Standalone Interactive Demo Mode built directly into the repository root:

  1. GitHub Pages Deployment:

    • Go to your repository settings on GitHub: Settings > Pages.
    • Under Source, select Deploy from a branch.
    • Choose main (or current branch) and / (root) folder, then click Save.
    • Your live interactive dashboard will be instantly published!
  2. Full-Stack Cloud Hosting (Backend + Database):

    • For running the live Node.js background telemetry collector on the cloud, deploy with 1-click on Render, Railway, or Fly.io using npm start.

πŸ“¦ Project Structure

Verolla/
β”œβ”€β”€ .gitignore                      # Git ignore rules for node_modules, WAL, logs
β”œβ”€β”€ index.html                      # Interactive landing page & GitHub Pages entry
β”œβ”€β”€ package.json                    # Root package scripts and configuration
β”œβ”€β”€ README.md                       # Comprehensive project documentation
β”œβ”€β”€ DFD/                            # Data Flow Diagrams (design artifacts)
β”‚   β”œβ”€β”€ DFDComponents.md            # DFD specifications
β”‚   β”œβ”€β”€ L0-DFD.png                  # Level-0 Context Diagram
β”‚   └── L1-DFD.png                  # Level-1 Detailed Data Flow
β”œβ”€β”€ docs/                           # Software Engineering & Requirements Docs
β”‚   β”œβ”€β”€ SRS.md                      # Software Requirements Specification
β”‚   β”œβ”€β”€ TestingReport.md            # Comprehensive QA & Test Plan
β”‚   β”œβ”€β”€ ClassDiagram/               # Class Identification specifications
β”‚   β”œβ”€β”€ SoftwareArchitecture/       # Architectural style documentation
β”‚   β”œβ”€β”€ UI/                         # Interaction & UI design specs
β”‚   └── UseCaseDiagram/             # Use case documentation & actor mappings
β”œβ”€β”€ UML/                            # UML Diagrams & Schemas (design artifacts)
β”‚   β”œβ”€β”€ UMLClassDiagram.png         # Complete UML Class Diagram
β”‚   β”œβ”€β”€ ComponentDiagrams/          # Component interaction flowcharts
β”‚   └── UsecaseDiagrams/            # Actor & system use case diagrams
└── Modules/                        # Application Source Code (implementation)
    β”œβ”€β”€ server.js                   # Main Express application & telemetry daemon
    β”œβ”€β”€ dal.js                      # Data Access Layer for SQLite
    β”œβ”€β”€ database.js                 # SQLite schema initialization & WAL config
    β”œβ”€β”€ predictor.js                # EWMA linear regression & predictive engine
    β”œβ”€β”€ package.json                # Dependencies & Jest configuration
    β”œβ”€β”€ simulate_cpu.js             # Multi-core CPU stress load generator
    β”œβ”€β”€ simulate_memory.js          # Memory pressure generator
    β”œβ”€β”€ tests/                      # Automated Jest Test Suite (61 tests)
    β”‚   β”œβ”€β”€ whitebox.test.js        # Unit tests for validators & DAL
    β”‚   β”œβ”€β”€ blackbox.test.js        # End-to-end REST API integration tests
    β”‚   └── features.test.js        # Bug fixes, rate limiting, and predictor tests
    └── *.html                      # Responsive UI pages (Dashboard, Admin, etc.)

Note how the repository structure mirrors the SDLC phases: DFD/ and UML/ hold the design artifacts, docs/ holds requirements and verification documentation, and Modules/ holds the implementation that was built from them.


⚑ Quick Start

Prerequisites

  • Node.js (v18.0.0 or higher recommended)
  • npm (v9.0.0 or higher)

1. Clone & Install

# Clone the repository
git clone https://github.com/07Lasya/Verolla.git
cd Verolla

# Install dependencies
npm install

2. Start the Server

# Start in production mode
npm start

# Or start directly from Modules/
cd Modules
npm start

The server will start at http://localhost:3000.

3. Access the Web Application

  • Landing Page: http://localhost:3000/index.html
  • Dashboard: http://localhost:3000/dashboard.html
  • Login / Signup: http://localhost:3000/login.html
  • AI Predictions: http://localhost:3000/predictions.html
  • Alerts Management: http://localhost:3000/alerts.html
  • Admin Console: http://localhost:3000/admin.html

Note: The first user registered in the system is automatically granted admin privileges.


πŸ§ͺ Automated Testing

Verification is treated as a first-class part of the SDLC. Verolla includes a comprehensive test suite with 61 passing test cases, organized to mirror standard software testing methodology β€” unit (white-box), integration (black-box), and feature/regression testing.

# Run the complete test suite
npm test

Test Breakdown

Test Suite File Tests Focus Area
White-Box tests/whitebox.test.js 17 Input validation regexes, DOB boundary arithmetic, DAL CRUD isolation
Black-Box tests/blackbox.test.js 24 REST endpoints (/api/signup, /api/login, /api/metrics, /api/alerts)
Features & Predictor tests/features.test.js 20 Linear regression fit, anomaly forecasting, cooldown logic, rate-limiter
# Run specific suites
npm run test:wb    # Run White-Box tests
npm run test:bb    # Run Black-Box tests

Full test strategy, coverage rationale, and results are documented in docs/TestingReport.md.


πŸ”₯ Stress Testing & Demonstration

To demonstrate real-time alerts and predictive trend forecasting under real hardware load:

# Spin up CPU load across all CPU cores for 90 seconds
npm run stress:cpu

# Or specify a custom duration in seconds
node Modules/simulate_cpu.js 60

# Simulate RAM consumption in 50MB increments
npm run stress:mem

πŸ“‘ API Reference

Authentication

  • POST /api/signup β€” Register a new account.
  • POST /api/login β€” Authenticate and receive user session payload.
  • POST /api/forgot-password β€” Request password reset.
  • POST /api/update-profile β€” Update user details.

Telemetry & Monitoring

  • GET /api/metrics β€” Current telemetry snapshot (CPU, Memory, Disk, Net I/O, hour-over-hour trends).
  • GET /api/health β€” System uptime and database health probe.

Alerts & Notifications

  • GET /api/alerts β€” List active and resolved alerts.
  • POST /api/alerts β€” Create a custom threshold alert rule.
  • POST /api/alerts/:id/resolve β€” Mark an active incident as resolved.
  • DELETE /api/alerts/:id β€” Remove an alert rule.
  • GET /api/notifications β€” Fetch user notification stream.
  • GET /api/notifications/read β€” Clear unread notification badge count.

Predictive Engine

  • GET /api/predictions β€” Active and historical trend/pattern predictions.

Admin Console (Requires x-admin-user header)

  • GET /api/admin/stats β€” High-level fleet statistics.
  • GET /api/admin/users β€” List all registered user records.
  • PATCH /api/admin/users/:id/role β€” Promote/demote user roles.
  • PATCH /api/admin/users/:id/status β€” Toggle user active state.
  • GET /api/admin/audit β€” View immutable administrative audit trail.
  • POST /api/admin/maintenance/purge-metrics β€” Retention cleanup for old telemetry.

πŸ“„ Documentation

Comprehensive software engineering documentation is available in the docs/ directory β€” this is the authoritative source for the project's requirements, architecture, and verification process:


πŸ“„ License

This project is licensed under the MIT License.

About

A software engineering project implementing continuous system monitoring, predictive anomaly detection, automated alerting, modular architecture, and comprehensive testing.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages