Skip to content

Kpreya/vigilAI

Repository files navigation

VigilAI

VigilAI Logo

AI-Powered Error Monitoring & Automated Code Fixes

License: MIT TypeScript Python Next.js

Features β€’ Quick Start β€’ Documentation β€’ Architecture β€’ Contributing


🎯 Overview

VigilAI is an intelligent error monitoring and automated code fixing platform that combines real-time application monitoring with AI-powered diagnostics and automatic pull request generation. When your application encounters an error, VigilAI not only detects it but also analyzes the root cause and generates code fixes automatically.

Key Capabilities

  • πŸ” Real-time Monitoring: Capture errors, performance metrics, and system health
  • πŸ€– AI-Powered Diagnosis: AWS Bedrock analyzes errors and suggests fixes
  • πŸ”§ Automated Fixes: Generate code fixes and create GitHub pull requests automatically
  • πŸ“Š Beautiful Dashboard: Brutalist-designed UI with dark/light mode
  • πŸ”’ Privacy-First: Built-in PII redaction and data retention policies
  • ⚑ Non-Blocking: Minimal performance impact on your application

✨ Features

Monitoring & Detection

  • Automatic error capture with full stack traces
  • HTTP request/response monitoring
  • System metrics (CPU, memory, response times)
  • Anomaly detection using statistical analysis
  • Custom metric tracking

AI-Powered Analysis

  • Root cause analysis using AWS Bedrock (Claude)
  • Context-aware error diagnosis
  • Confidence scoring for suggested fixes
  • Historical pattern recognition

Automated Remediation

  • Automatic code fix generation
  • GitHub pull request creation
  • File path resolution from stack traces
  • Multi-framework support (Express, Next.js, Django, FastAPI)

Developer Experience

  • Beautiful brutalist UI with dark/light mode
  • Real-time incident dashboard
  • Pull request tracking
  • Application management
  • API key management
  • Comprehensive SDK documentation

πŸš€ Quick Start

Prerequisites

  • Node.js 16+ (for platform and TypeScript SDK)
  • Python 3.8+ (for Python SDK)
  • PostgreSQL database
  • AWS account (for Bedrock AI)
  • GitHub account (for PR creation)

Installation

1. Clone the Repository

git clone https://github.com/Kpreya/vigilAI.git
cd vigilai

2. Install Dependencies

# Platform (Next.js backend)
cd platform
npm install

# Frontend (HTML/CSS/JS)
cd ../frontend
npm install

# TypeScript SDK
cd ../typescript
npm install

# Python SDK
cd ../python
pip install -e .

3. Configure Environment

Create platform/.env:

# Database
DATABASE_URL="postgresql://user:password@localhost:5432/vigilai"

# Authentication
NEXTAUTH_SECRET="your-secret-key"
JWT_SECRET="your-jwt-secret"
NEXTAUTH_URL="http://localhost:3000"

# Frontend URL
FRONTEND_URL="http://localhost:5500"

# GitHub Integration
GITHUB_TOKEN="your-github-token"

# AWS Bedrock
AWS_ACCESS_KEY_ID="your-aws-key"
AWS_SECRET_ACCESS_KEY="your-aws-secret"
AWS_REGION="us-east-1"

4. Setup Database

cd platform
npx prisma migrate dev
npx prisma generate

5. Start the Platform

# Start Next.js backend
cd platform
npm run dev

# In another terminal, serve the frontend
cd frontend
npx live-server --port=5500

Visit:


πŸ“š Documentation

For Users

For Developers


πŸ—οΈ Architecture

VigilAI consists of four main components:

1. Platform (Next.js Backend)

  • REST API for incident management
  • Authentication & authorization
  • Database management (Prisma + PostgreSQL)
  • AI integration (AWS Bedrock)
  • GitHub integration (Octokit)

2. Frontend (HTML/CSS/JS)

  • Brutalist-designed dashboard
  • Real-time incident monitoring
  • Pull request tracking
  • Application & API key management
  • Dark/light mode support

3. SDKs

  • TypeScript/JavaScript: Express, Next.js support
  • Python: Django, FastAPI support
  • Automatic error capture
  • Custom metric tracking
  • Non-blocking operation

4. AI Engine

  • AWS Bedrock (Claude) for analysis
  • Root cause diagnosis
  • Code fix generation
  • Confidence scoring

See ARCHITECTURE.md for detailed architecture documentation.


πŸ”§ SDK Integration

TypeScript/JavaScript

Express.js

import express from 'express';
import { VigilAI } from '@vigilai/sdk';

const app = express();

const vigilai = new VigilAI({
  apiKey: process.env.VIGILAI_API_KEY,
});

await vigilai.initialize();
app.use(vigilai.expressMiddleware());

app.listen(3000);

Next.js

// middleware.ts
import { VigilAI } from '@vigilai/sdk';

const vigilai = new VigilAI({
  apiKey: process.env.VIGILAI_API_KEY,
});

export async function middleware(request: NextRequest) {
  return vigilai.nextMiddleware(request, async (req) => {
    return NextResponse.next();
  });
}

Python

Django

# settings.py
from vigilai import VigilAI, VigilAIConfig

vigilai = VigilAI(VigilAIConfig(
    api_key=os.environ.get('VIGILAI_API_KEY'),
))

MIDDLEWARE = [
    # ... other middleware
    vigilai.django_middleware(),
]

FastAPI

from fastapi import FastAPI
from vigilai import VigilAI, VigilAIConfig

vigilai = VigilAI(VigilAIConfig(
    api_key=os.environ.get('VIGILAI_API_KEY'),
))

app = FastAPI()
app.middleware("http")(vigilai.fastapi_middleware())

@app.on_event("startup")
async def startup():
    await vigilai.initialize()

🎨 Features Showcase

Dashboard

  • Real-time incident monitoring
  • System health metrics
  • Application overview
  • Quick actions

Incident Management

  • Detailed error information
  • Stack trace analysis
  • AI-powered diagnosis
  • Status tracking

Pull Request Automation

  • Automatic PR creation
  • Code fix suggestions
  • GitHub integration
  • Review workflow

Dark Mode

  • Professional dark theme
  • Smooth transitions
  • Consistent across all pages
  • Theme persistence

πŸ› οΈ Development

Project Structure

vigilai/
β”œβ”€β”€ platform/          # Next.js backend
β”‚   β”œβ”€β”€ app/          # Next.js app router
β”‚   β”œβ”€β”€ prisma/       # Database schema
β”‚   └── lib/          # Utilities
β”œβ”€β”€ frontend/         # HTML/CSS/JS dashboard
β”‚   β”œβ”€β”€ js/           # JavaScript modules
β”‚   β”œβ”€β”€ css/          # Stylesheets
β”‚   └── assets/       # Images and assets
β”œβ”€β”€ typescript/       # TypeScript SDK
β”‚   β”œβ”€β”€ src/          # Source code
β”‚   β”œβ”€β”€ examples/     # Integration examples
β”‚   └── dist/         # Compiled output
β”œβ”€β”€ python/           # Python SDK
β”‚   β”œβ”€β”€ src/vigilai/  # Source code
β”‚   β”œβ”€β”€ examples/     # Integration examples
β”‚   └── tests/        # Test suite
└── docs/             # Documentation site

Running Tests

# TypeScript SDK
cd typescript
npm test

# Python SDK
cd python
pytest

# Platform (if tests exist)
cd platform
npm test

Building

# TypeScript SDK
cd typescript
npm run build

# Python SDK
cd python
python setup.py sdist bdist_wheel

# Platform
cd platform
npm run build

🀝 Contributing

We welcome contributions! Please see our contributing guidelines:

  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

Development Guidelines

  • Follow existing code style
  • Write tests for new features
  • Update documentation
  • Ensure all tests pass
  • Keep commits atomic and well-described

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments

  • AWS Bedrock for AI-powered analysis
  • Octokit for GitHub integration
  • Prisma for database management
  • Next.js for the backend platform
  • Tailwind CSS for styling

πŸ“§ Support


πŸ—ΊοΈ Roadmap

  • Slack/Discord notifications
  • Multi-language support
  • Custom AI models
  • Advanced analytics
  • Team collaboration features
  • Self-hosted option
  • Kubernetes integration
  • More framework support

Built with ❀️ by the VigilAI Team

Website β€’ Documentation β€’ GitHub

About

www.vigilai.space

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors