Skip to content

Darshan3690/DevOps_Copilot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 InfraWatch AI – Multi-LLM DevOps Copilot

InfraWatch AI Banner

AI-Powered Infrastructure Monitoring, Incident Analysis & Multi-LLM Platform

Monitor infrastructure, analyze logs with Gemini AI, and compare responses across multiple LLMs from a single platform.

Built with Next.js, Clerk, Supabase (PostgreSQL), Docker, Redis, Nginx, Python, Gemini API, and GitHub Actions.


📌 Overview

InfraWatch AI started as a Multi-LLM Chat System and evolved into a complete DevOps + AIOps platform.

The system enables users to:

  • Compare responses from multiple LLMs simultaneously
  • Persist chat history securely
  • Monitor infrastructure health in real time
  • Analyze server logs autonomously using AI
  • Detect incidents automatically and log them
  • Track API usage and token metrics
  • Manage deployments using DevOps best practices

🏗 Architecture

User
 │
 ▼
Clerk Authentication
 │
 ▼
Nginx Reverse Proxy
 │
 ▼
Next.js Application
 │
 ├────────► Gemini API (Native)
 │
 ├────────► OpenRouter API (GPT-4o, Claude 3.5, Mistral, etc.)
 │
 ├────────► Supabase PostgreSQL (via Prisma ORM)
 │
 └────────► Redis Cache
                 │
                 ▼
          Python Monitoring Service
                 │
                 ▼
         AI Log Analyzer (Gemini)
                 │
                 ▼
        InfraWatch Dashboard

✨ Core Features

🤖 Multi-LLM Chat System

  • GPT-4o Support
  • Gemini 1.5 Flash Support
  • Claude 3.5 Sonnet Support
  • Mistral, Perplexity, & Cohere Support
  • Side-by-side response comparison
  • Auto-resizing input & full Markdown rendering
  • Customizable temperature settings

🔐 Authentication

Powered by Clerk.

Features:

  • Secure Session Management
  • Row Level Security (RLS) in Database
  • Protected Dashboard Routes

💬 Persistent Chat History

Stored in Supabase PostgreSQL via Prisma ORM.

Features:

  • Secure conversation storage (RLS enforced)
  • Cost calculation per message
  • Side-navigation to revisit past chats

📊 API Usage Analytics

Track:

  • Total LLM Requests
  • Token Consumption per model
  • Estimated API Cost (USD)
  • Model Usage comparisons

⚡ Redis Caching

Features:

  • Prompt caching to reduce identical API calls
  • Faster repeated queries
  • Reduced API costs
  • Local Docker deployment

🐳 Dockerized Infrastructure

Application runs in isolated containers (managed by docker-compose.yml).

Services:

  • Next.js App
  • Redis Cache
  • Nginx Reverse Proxy

🔄 CI/CD Pipeline

GitHub Actions automatically:

  • Install dependencies
  • Run ESLint checks
  • Run TypeScript type checking
  • Build Next.js application
  • Build Docker image (infrawatch-ai)

📈 Infrastructure Monitoring

Python background workers track:

  • CPU Usage
  • RAM (Memory) Usage
  • Disk Usage
  • Container Health (App & Redis)

Metrics are pushed to Supabase every 30 seconds and displayed in real time on the frontend.


🧠 AI Log Analysis

Powered by Google Gemini API.

The autonomous Python worker (log_analyzer.py) automatically analyzes:

  • System Errors and Application Logs

Generates:

  • Root Cause Analysis
  • Severity Classification
  • Suggested Fixes
  • Confidence Score

Example Output:

{
  "root_cause": "Redis Container Unavailable",
  "severity": "High",
  "suggested_fix": "Restart Redis Container",
  "confidence": 91
}

📊 DevOps Dashboard

Route:

/monitoring

Features:

  • Live CPU/RAM/Disk Gauges
  • Container Uptime Status
  • AI Incident Reports
  • 30-Day API Token/Cost Metrics

🛠 Tech Stack

Frontend & Backend

  • Next.js 16 (App Router)
  • React 19
  • TypeScript
  • Tailwind CSS v4
  • Framer Motion & GSAP

Authentication

  • Clerk

Database & ORM

  • Supabase PostgreSQL
  • Prisma ORM

DevOps

  • Docker & Docker Compose
  • Nginx
  • GitHub Actions
  • WSL Ubuntu

Background Services

  • Python (psutil)

AI APIs

  • Gemini API (Google)
  • OpenRouter API (OpenAI, Anthropic, Mistral)

📂 Project Structure

infra-watch-ai/
├── app/
│   ├── api/          # Next.js API Routes (Chat, Health, Monitoring)
│   ├── monitoring/   # InfraWatch Dashboard UI
│   └── page.tsx      # Main Multi-LLM Chat UI
│
├── components/       # React Components (Modals, Chat Inputs)
├── lib/              # Prisma Client & Redis Configuration
│
├── services/
│   └── monitoring/
│       ├── monitor.py           # Infrastructure metric collector
│       ├── log_analyzer.py      # Gemini-powered incident analyzer
│       ├── cpu.py, ram.py, disk.py, docker_status.py
│       └── requirements.txt
│
├── nginx/
│   └── infrawatch.conf          # Nginx Reverse Proxy Configuration
│
├── .github/
│   └── workflows/
│       └── ci.yml               # GitHub Actions CI/CD
│
├── supabase/
│   └── schema.sql               # PostgreSQL Schema & RLS Policies
│
├── prisma/
│   └── schema.prisma            # Prisma Models
│
├── docker-compose.yml           # App & Redis Containers
├── Dockerfile                   # Next.js Production Build
└── README.md

⚙️ Installation

Prerequisites

  • Node.js 20+
  • Docker Desktop
  • Python 3.10+
  • Supabase Project
  • Clerk Account
  • Gemini API Key

Clone Repository

git clone https://github.com/Darshan3690/DevOps_Copilot.git
cd DevOps_Copilot

Environment Variables

Create .env.local

# Clerk Auth
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=
CLERK_SECRET_KEY=

# Prisma / Supabase
DATABASE_URL=
DIRECT_DATABASE_URL=

# AI APIs
GEMINI_API_KEY=
# Add your OpenRouter/OpenAI/Claude keys for the multi-llm chat

# Redis
REDIS_URL=redis://localhost:6379

Local Development (Frontend)

npm install
npx prisma generate
npm run dev

Open http://localhost:3000


Run Python Monitoring Services

cd services/monitoring
pip install -r requirements.txt
python monitor.py

🐳 Run With Docker

Build & Start the containers:

docker compose up --build -d

The app will be available at http://localhost:3000 via Nginx/Docker.


🔄 CI/CD Workflow

Push Code
     │
     ▼
GitHub Actions
     │
     ▼
Lint (ESLint)
     │
     ▼
Type Check (tsc)
     │
     ▼
Build (Next.js)
     │
     ▼
Docker Build
     │
     ▼
Pipeline Complete ✅

🚀 Future Enhancements

  • Smart Email/Slack Alerts: Real-time notifications for critical system failures.
  • Kubernetes Deployment Manifests
  • Grafana Dashboard Integration
  • AWS Terraform Deployment Scripts
  • AI Auto-Remediation

🤝 Contributing

Contributions are welcome.

  1. Fork Repository
  2. Create Feature Branch (git checkout -b feature/amazing-feature)
  3. Commit Changes (git commit -m "Add amazing feature")
  4. Push (git push origin feature/amazing-feature)
  5. Create Pull Request

📄 License

Distributed under the MIT License.


Made with ❤️ by Darshan Rajput

Building the future of AI-powered DevOps 🚀

About

Empowering conversations with limitless AI intelligence — a PWA app to compare responses, manage history & settings when talking to multiple AI models.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors