Skip to content

SentinelEngine/frontend

Repository files navigation

⚡ CloudGauge — Code. Cost. Control.

ESLint for Cloud Costs — Real-time cloud cost intelligence inside your editor + interactive dashboard.


📌 Overview

Modern cloud applications suffer from a fundamental problem:

Developers write code today, but understand its cost weeks later.

This delay leads to:

  • Unexpected cloud bills
  • Poor cost optimization
  • Lack of accountability

CloudGauge solves this by bringing cost awareness directly into the development phase.


🎯 Core Idea

“Shift cloud cost awareness from billing time → coding time.”

CloudGauge provides:

  • Real-time cost estimation in VS Code
  • Optimization suggestions
  • PR-level cost impact tracking
  • Interactive dashboard for insights
  • Tamper-proof cost logs using Web3

❗ Problem

  • No visibility of cost while coding
  • Feedback loop delayed (billing cycle)
  • Expensive APIs used unknowingly
  • No cost accountability in PRs
  • Reports can be manipulated

💡 Solution

“ESLint for Cloud Costs”

CloudGauge:

  • Analyzes your code as you write
  • Estimates cloud cost instantly
  • Suggests optimizations
  • Tracks cost changes across PRs
  • Ensures trust with blockchain-backed verification

✨ Features

🔹 Real-Time Cost Estimation (VS Code Extension)

  • Detects API & cloud usage
  • Shows instant monthly cost projection
  • Works inside developer workflow

🔹 Optimization Suggestions

  • Suggests cost-saving strategies:
    • Model switching (GPT-4 → GPT-3.5)
    • Caching
    • Request batching

🔹 PR Cost Diff

  • Compares:
    • Base branch vs new branch
  • Shows cost impact of every change
  • Prevents expensive merges

🔹 Interactive Dashboard (Frontend)

The dashboard provides:

  • Cost breakdown visualization
  • Service-wise cost insights
  • Historical analysis
  • Report summaries

👉 Helps teams understand and track cost trends over time


🔹 Tamper-Proof Cost Logs (Web3)

  • Generates SHA-256 hash of cost reports
  • Stores hash on Sepolia blockchain
  • Ensures reports cannot be modified

👉 Adds trust + auditability


🏗️ Architecture

VS Code Extension
        ↓
Backend (TypeScript)
        ↓
AST Analysis Engine
        ↓
Cost Estimation Engine
        ↓
Database (Prisma)
        ↓
Frontend Dashboard (Vercel)
        ↓
Hash Generation (SHA-256)
        ↓
Blockchain (Sepolia)

⚙️ Tech Stack

🔹 Frontend

  • React (Vercel Deployment)
  • Dashboard UI for cost visualization

🔹 Backend

  • TypeScript
  • Node.js
  • AST Parsing (Babel / TS Compiler API)

🔹 Database

  • Prisma ORM
  • PostgreSQL

🔹 Web3 Layer

  • Solidity (Smart Contract)
  • Ethers.js
  • Sepolia Testnet

🔍 How It Works

1. Code Analysis

  • Parses source code using AST
  • Detects API/cloud usage patterns

2. Cost Estimation

  • Maps detected services → pricing models
  • Estimates monthly cost based on usage assumptions

3. Optimization Engine

  • Identifies expensive patterns
  • Suggests alternatives with cost impact

4. PR Cost Diff

  • Computes:
    • Before cost
    • After cost
  • Outputs difference

5. Dashboard Visualization

  • Displays:
    • Cost trends
    • Service-level breakdown
    • Report summaries

6. Web3 Verification

Cost Report → SHA-256 Hash → Stored On-Chain
  • Only hash stored on blockchain
  • Full data stored in DB

🧪 Demo Flow

  1. Open code in VS Code
  2. Detect API usage
  3. Show cost estimate
  4. Apply optimization → cost drops
  5. Show PR cost diff
  6. View report in dashboard
  7. Verify report integrity via blockchain

📊 Example

// Before
use GPT-4  $1000/month

// After optimization
use GPT-3.5  $200/month

// Add caching
 $50/month

🔐 Web3 Justification

We use Web3 only for verification, not computation.

Why?

  • Prevent report tampering
  • Provide audit trail
  • Enable trust in cost data

🧠 Key Insight

“We don’t just show developers that their code is expensive —
we show them how to make it cheaper instantly.”


🚀 Future Scope

  • CI/CD integration (PR gating)
  • Multi-cloud support (AWS, GCP, Azure)
  • AI-driven optimization engine
  • Cost heatmaps inside editor
  • Enterprise cost governance tools

🤝 Contribution

Contributions are welcome!

  • Fork the repository
  • Create a feature branch
  • Submit a pull request

📜 License

MIT License

Releases

No releases published

Packages

 
 
 

Contributors

Languages