Skip to content

vikasingh0897/AuditAI

Repository files navigation

Audit AI

High-Performance AI-Driven SaaS Optimization and Strategic Lead Intelligence Engine

Build Issues Contributions License

🌟 Overview

Audit AI is a sophisticated, full-stack intelligence platform designed to revolutionize how businesses perceive and manage their SaaS ecosystems. By merging the analytical power of Google's Generative AI with a robust TypeScript-driven architecture, Audit AI provides organizations with an automated, high-fidelity audit engine. It doesn't just list tools; it evaluates spend, identifies inefficiencies, and transforms raw operational data into strategic growth opportunities.


The Problem

Modern enterprises struggle with "SaaS sprawl"β€”an unmanaged proliferation of software subscriptions that leads to budget leakage, redundant functionality, and security vulnerabilities. Manually auditing these stacks is a labor-intensive process, often resulting in outdated reports and missed optimization opportunities. Furthermore, converting the interest in these audits into high-quality business leads remains a fragmented and inefficient process.


The Solution


Audit AI eliminates the manual burden of software stack evaluation through a coordinated full-stack architecture:

  • Interactive Frontend: Provides a high-performance React-based interface where users can submit their current software stack for immediate, real-time analysis.

  • Robust Backend Orchestration: Built on Node.js and Express, the server manages the entire data workflow, ensuring seamless communication between the client and the processing engine.

  • Multi-Layered Security: Implements rigorous protection including Zod-based data validation, honeypot anti-spam triggers, and rate limiters to defend against automated abuse and DOS attacks.

  • AI-Powered Intelligence: Leverages the Gemini AI engine to analyze user inputs and generate deep-context summaries that identify cost-saving opportunities and stack optimizations.

  • Actionable Visualization: Delivers a comprehensive Results Dashboard that transforms raw data into immediate business value and clear visual insights.

  • Lead Optimization: Closes the loop by capturing and nurturing high-intent leads through integrated email services and automated lead management systems.


Architecture Overview


Built on a Component-based Architecture (Frontend) and a RESTful API (Backend), ensuring modularity && scalability.

  • Frontend: A Vite-powered React application focusing on high-performance rendering and a seamless user journey.
  • Backend: A TypeScript Express server emphasizing type-safe operations, secure middleware integration, and AI service orchestration.

✨ Key Features

πŸš€ Intelligent Audit Engine

Transform complex software lists into actionable insights. The core engine analyzes SaaS spend and tool utility, providing users with a clear path toward optimization.

  • User Benefit: Stop wasting budget on redundant tools and identify gaps in your tech stack in seconds.

πŸ“Š Results Dashboard

A high-fidelity visualization interface that presents audit findings in a clear, professional format. It breaks down complex AI-generated data into digestible metrics.

  • User Benefit: Gain immediate executive-level clarity on your operational efficiency without sifting through spreadsheets.

πŸ›‘οΈ Multi-Layered Security

Audit AI is fortified with enterprise-grade security protocols, including custom rate limiting, honeypot fields to trap malicious bots, and HCaptcha integration.

  • User Benefit: Ensure your data and the platform remain secure from automated attacks and spam.

πŸ“§ Automated Lead Nurturing

Integrated lead management systems capture user information via conversion-optimized modals and deliver immediate value through automated email responses.

  • User Benefit: Seamlessly transition from a casual audit to a deep-dive business relationship with zero manual overhead.

🧠 AI-Powered Summaries

Leveraging the @google/generative-ai package, the system generates human-like summaries of audit results, providing context that standard algorithmic tools miss.

  • User Benefit: Receive personalized recommendations that understand the nuance of your specific business needs.

πŸ› οΈ Tech Stack & Architecture

Audit AI utilizes a modern, type-safe stack designed for reliability and developer productivity.

Technology Purpose Why it was Chosen
TypeScript Primary Language Provides robust type safety across the entire stack, reducing runtime errors.
React Frontend Framework Enables a reactive, component-based UI for complex state management in the dashboard.
Express Backend Framework A lightweight, flexible Node.js framework ideal for building high-performance REST APIs.
Mongoose Database ODM Simplifies data modeling and interaction with MongoDB for audit and lead persistence.
Google Generative AI AI Orchestration Harnesses Gemini for advanced natural language processing and audit summarization.
Zod Schema Validation Ensures 100% data integrity for all incoming API requests and internal configurations.
Resend Email Service Provides reliable, developer-friendly transactional email delivery for lead alerts.

πŸ“ Project Structure

vikasingh0897-AuditAI-5c502ca/
β”œβ”€β”€ πŸ“ frontend/                             # React Client Application
β”‚   β”œβ”€β”€ πŸ“ public/                           # Static assets (Logos, Icons)
β”‚   β”‚   β”œβ”€β”€ πŸ“„ AuditAI-Logo.svg              # Primary Brand Identity
β”‚   β”‚   └── πŸ“„ favIcon.svg                   # Browser favicon
β”‚   β”œβ”€β”€ πŸ“ src/                              # Frontend source code
β”‚   β”‚   β”œβ”€β”€ πŸ“ components/                   # Shared UI components
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ Footer.tsx                # Global footer navigation
β”‚   β”‚   β”‚   └── πŸ“„ Header.tsx                # Global header and brand bar
β”‚   β”‚   β”œβ”€β”€ πŸ“ pages/                        # View-level components
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ AuditForm.tsx             # SaaS data entry interface
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ AuditSummary.tsx          # AI result visualization
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ LandingPage.tsx           # Conversion-optimized entry point
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ LeadModal.tsx             # Lead capture interface
β”‚   β”‚   β”‚   └── πŸ“„ ResultsDashboard.tsx      # Data visualization hub
β”‚   β”‚   β”œβ”€β”€ πŸ“„ App.tsx                       # Main application router
β”‚   β”‚   β”œβ”€β”€ πŸ“„ main.tsx                      # Application entry point
β”‚   β”‚   └── πŸ“„ index.css                     # Global styling
β”‚   β”œβ”€β”€ πŸ“„ vite.config.ts                    # Vite build configuration
β”‚   └── πŸ“„ package.json                      # Frontend dependencies
β”‚
β”œβ”€β”€ πŸ“ backend/                              # Node.js Express Server
β”‚   β”œβ”€β”€ πŸ“ src/                              # Backend source code
β”‚   β”‚   β”œβ”€β”€ πŸ“ controllers/                  # Request handling logic
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ audit.controller.ts       # Audit processing logic
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ lead.controller.ts        # Lead management logic
β”‚   β”‚   β”‚   └── πŸ“„ pricing.controller.ts     # Pricing data logic
β”‚   β”‚   β”œβ”€β”€ πŸ“ middlewares/                  # Express request interceptors
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ honeypot.middleware.ts    # Anti-spam security
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ rateLimiter.ts            # DOS protection
β”‚   β”‚   β”‚   └── πŸ“„ validator.middleware.ts   # Zod validation logic
β”‚   β”‚   β”œβ”€β”€ πŸ“ models/                       # Database schemas
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ audit.model.ts            # Audit data structure
β”‚   β”‚   β”‚   └── πŸ“„ pricing.model.ts          # Tool pricing structure
β”‚   β”‚   β”œβ”€β”€ πŸ“ routes/                       # API endpoint definitions
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ audit.route.ts            # Audit-related endpoints
β”‚   β”‚   β”‚   └── πŸ“„ lead.route.ts             # Lead-related endpoints
β”‚   β”‚   β”œβ”€β”€ πŸ“ utils/                        # Shared utility functions
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ apiResponse.ts            # Standardized response wrapper
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ captcha.ts                # HCaptcha verification
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ emailService.ts           # Resend/SMTP integration
β”‚   β”‚   β”‚   └── πŸ“„ summaryEngine.ts          # AI-logic wrapper
β”‚   β”‚   β”œβ”€β”€ πŸ“„ db.ts                         # Database connection logic
β”‚   β”‚   β”œβ”€β”€ πŸ“„ app.ts                        # Express app configuration
β”‚   β”‚   └── πŸ“„ index.ts                      # Server entry point
β”‚   β”œβ”€β”€ πŸ“ test/                             # Backend testing suite
β”‚   β”‚   └── πŸ“„ auditEngine.test.ts           # Core engine unit tests
β”‚   β”œβ”€β”€ πŸ“„ jest.config.js                    # Test runner configuration
β”‚   └── πŸ“„ package.json                      # Backend dependencies
β”‚
β”œβ”€β”€ πŸ“„ .env.example                          # Environment template
β”œβ”€β”€ πŸ“„ PRICING_DATA.md                       # Curated SaaS pricing reference
└── πŸ“„ DEVLOG.md                             # Project evolution and updates


πŸ” Environment Variables

The application requires several environment variables to function correctly. These should be defined in a .env file in the respective directories or at the root level as per your deployment strategy.

Variable Description Required
VITE_API_URL Base URL for the backend API (Frontend) Yes
VITE_HCAPTCHA_SITE_KEY Site key for HCaptcha integration Yes
MONGO_URI Connection string for MongoDB Yes
PORT The port the backend server listens on Yes
BREVO_API_KEY API Key for email service delivery Yes
EMAIL_FROM The sender email address for notifications Yes
SMTP_HOST Host for SMTP fallback services Yes
CLIENT_URL The URL of the frontend application (for CORS) Yes
APP_URI The primary application URI Yes
NODE_ENV Environment state (development/production) Yes

πŸ”‘ API Keys Setup

1. Database Setup (MongoDB)

Audit AI uses Mongoose to interact with MongoDB.

  • Action: Create a cluster on MongoDB Atlas.
  • Configuration: Obtain your connection string. Ensure the network access whitelist includes your deployment IP.
  • Environment: Assign this to MONGO_URI.

2. Email Service (Resend/Brevo)

Automated lead notifications and audit summaries are delivered via transactional email.

  • Action: Sign up at Brevo or Resend.
  • Configuration: Create an API Key and verify your sending domain.
  • Environment: Assign the key to BREVO_API_KEY and set EMAIL_FROM.

3. AI Engine (Google Gemini)

The @google/generative-ai package requires a valid Google AI SDK key.

  • Action: Visit the Google AI Studio.
  • Configuration: Generate an API Key for Gemini Pro.
  • Environment: Ensure the backend has access to this key (standardized as a service key in summaryEngine.ts).

πŸš€ Getting Started

Prerequisites

  • Node.js: v18.0.0 or higher
  • TypeScript: v6.0.3+ (installed via devDependencies)
  • MongoDB: A running instance or Atlas URI

Installation

  1. Clone the Repository

    git clone https://github.com/vikasingh0897/AuditAI.git
    cd AuditAI
  2. Backend Setup

    cd backend
    npm install
    cp .env.example .env # Update with your verified API keys
    npm run build
  3. Frontend Setup

    cd ../frontend
    npm install
    # Ensure VITE_API_URL in .env points to your local backend
  4. Running the Development Environment

    • Start Backend:
      cd backend
      npm run dev
    • Start Frontend:
      cd frontend
      npm run dev

πŸ”§ Usage

Running the Audit

  1. Navigate to the LandingPage.
  2. Interact with the AuditForm to input your current SaaS tools and estimated monthly spend.
  3. Complete the HCaptcha challenge (verified by captcha.ts).
  4. The summaryEngine.ts will process the input using Google Generative AI.

Viewing Results

  • Upon completion, you will be redirected to the ResultsDashboard.
  • The dashboard displays a high-level AuditSummary, highlighting potential savings and tool redundancies.
  • If the system detects high-value optimization opportunities, the LeadModal will appear to capture contact details for a professional consultation.

API Interaction

The backend exposes a health-check and primary orchestration endpoint:

  • GET /: Returns the current status of the Express API and ensures connectivity with the underlying Node.js runtime.

🀝 Contributing

We welcome contributions to improve Audit AI! Your input helps make this project better for everyone.

How to Contribute

  1. Fork the repository - Click the 'Fork' button at the top right of this page

  2. Create a feature branch

    git checkout -b feature/amazing-feature
  3. Make your changes - Improve code, documentation, or features

  4. Test thoroughly - Ensure all functionality works as expected

    npm test
  5. Commit your changes - Write clear, descriptive commit messages

    git commit -m 'Add: Amazing new feature that improves AI summary accuracy'
  6. Push to your branch

    git push origin feature/amazing-feature
  7. Open a Pull Request - Submit your changes for review


⭐ If this repository helps you, please give it a star! ⭐

Happy Coding! πŸš€


Created with ❀️ by Vikas Singh

About

πŸš€ AI-driven SaaS Audit Engine featuring a robust relational schema for multi-tool cost optimization. πŸ› οΈ This repo implements UUID-based public sharing, lead-gen data modeling, and automated financial analysis logic. πŸ“Š Designed for scalable spend management, it transforms user seat counts and tool inputs into high-value savings insights.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors