Skip to content

NKS01X/Vortex

Repository files navigation

Vortex Logo

Vortex

A highly dynamic, auto-scaling reverse proxy and cluster manager built for resilience and speed.

Go Gin Docker License: MIT


🌌 Overview

Vortex is a robust, dynamic reverse proxy, rate limiter, and cluster manager built entirely in Go. Engineered to handle fluctuating traffic seamlessly, Vortex dynamically spawns or terminates backend nodes based on real-time traffic thresholds. By leveraging the Gin framework and yaml.v3 for declarative configuration, Vortex provides an enterprise-grade load balancing solution that is highly configurable, inherently resilient, and fully observable out of the box.


✨ Key Features

  • ⚡ Auto-Scaling: Intelligently spawns or kills backend nodes dynamically governed by live traffic thresholds.
  • ⚖️ Load Balancing: Distributes incoming traffic efficiently using a robust Round-Robin algorithm.
  • 🛡️ Rate Limiting: Protects your services from abuse and traffic spikes with built-in, configurable limits.
  • ❤️ Health Checks: Ensures high availability by continuously monitoring backend node health via a background daemon.
  • ⚙️ Declarative Config: Easy and version-controllable configuration using a single vortex.yaml file.
  • 📊 Observability: Fully integrated with Prometheus and Grafana for deep insights and analytics.

🏗️ Architecture

The Vortex architecture routes incoming requests through a robust chain of limiters and balancers, while a background daemon continuously monitors health and scales the cluster up or down based on load.

📂 Project Structure

vortex/
├── daemon/                  # Background auto-scaling and health checker logic
├── docker-compose.yml       # Production stack orchestration
├── grafana/                 # Grafana dashboards and provisioning configs
├── loadbalancer/            # Round-Robin routing and engine core
├── main.go                  # Application entry point
├── ratelimiter/             # Traffic parsing and rate limit enforcement
└── vortex.yaml              # Declarative cluster configuration

🚀 Getting Started

You can run Vortex either via a quick local installation or deployed as a fully dockerized production stack.

💻 Local Installation

Ensure you have Go 1.20+ installed, then simply clone and run:

# Clone the repository
git clone https://github.com/yourusername/vortex.git
cd vortex

# Run the proxy locally
go run main.go

🐳 Docker & Observability Stack

Vortex comes with a fully containerized observability stack using Prometheus and Grafana, and supports hot-reloading using Air.

# Standard Start (Production build)
make up

# Development Start (Hot-reloading with Air)
make dev

# Rebuild and Start (Clean standard build)
make rebuild

Expected Ports:

  • Load Balancer: 8000
  • Grafana: 3000 (Default login: admin/admin)
  • Prometheus: 9090

🛠️ Configuration

Configure the proxy using the declarative vortex.yaml file. Set up cluster size boundaries, scaling triggers, and routing paths effortlessly.

# vortex.yaml
cluster:
  max_nodes: 10
  min_nodes: 2
  strategy: round_robin

scaling_triggers:
  cpu_threshold_percent: 80
  request_rate_per_sec: 1000
  scale_up_step: 2
  scale_down_step: 1

rate_limit:
  enabled: true
  requests_per_ip: 100
  window_seconds: 60

🧪 Testing & Monitoring

Once your stack is running, you can test the load balancing by hitting the proxy:

# Send a test request to the load balancer
curl -i http://localhost:8080/

Observability: Open your browser to http://localhost:3000 to access the Grafana Dashboard. The built-in dashboard will visualize live analytics from Prometheus, showing the active cluster size, request throughput, and auto-scaling events as they happen.


🤝 Contribution

Contributions make the open-source community an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Built by Nikhil

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors