Skip to content

Sant60/ai_spend_audit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Spend Audit

This web application, developed as part of the Credex internship assignment, aims to tackle the common issue of teams overspending on AI tools. Many organizations subscribe to multiple AI services monthly without a clear understanding of whether they're on the most cost-effective plans or if their current subscriptions align with their actual needs.

The core functionality of the app allows users to input details about their AI tools, including their monthly expenses, the number of user seats, and the specific use cases. Based on this information, the application then generates a comprehensive audit report. This report not only highlights potential areas of overspending but also provides actionable recommendations for optimization and estimates the potential savings.


Live Demo

Deployed URL

https://ai-spend-audit-eight-nu.vercel.app/


Loom Walkthrough

Full Video Link

https://www.loom.com/share/c8860030acd04b99be1806e7fa9d4109


Key Features

  • The ability to catalog AI tools, their associated plans, seat counts, and monthly costs.
  • Persistent storage of user input via localStorage to prevent data loss upon page refresh.
  • A rule-based system for generating audit recommendations, ensuring predictability and ease of verification.
  • Calculations for estimated monthly and annual cost savings.
  • Integration with the Anthropic API to generate concise, personalized AI summaries.
  • The creation of shareable pages for audit results.
  • A lead capture mechanism that stores data in Supabase.

Supported Tools

  • Cursor
  • GitHub Copilot
  • Claude
  • ChatGPT
  • Anthropic API
  • OpenAI API
  • Gemini
  • Windsurf

Tech Stack

  • Next.js App Router
  • TypeScript
  • Tailwind CSS
  • Supabase for backend services
  • Anthropic API for AI capabilities
  • Vitest for testing
  • GitHub Actions for CI/CD
  • Vercel for deployment

Screenshots

Landing page

image

Audit form

image

Audit results page

image

Recommendation section

image

Lead capture process

image

Local Setup

1. Install dependencies

npm install

2. Create .env.local

NEXT_PUBLIC_SUPABASE_URL=your-supabase-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key
SUPABASE_SERVICE_ROLE_KEY=your-supabase-service-role-key
NEXT_PUBLIC_BASE_URL=http://localhost:3000

# AI summary — at least one required; tried in order: Gemini → Anthropic → OpenAI
# Gemini is free at aistudio.google.com (recommended)
GEMINI_API_KEY=your-gemini-api-key

# Anthropic (optional fallback) — console.anthropic.com
ANTHROPIC_API_KEY=your-anthropic-api-key

# OpenAI (optional fallback) — platform.openai.com
OPENAI_API_KEY=your-openai-api-key

# Email notifications (optional) — resend.com free tier
RESEND_API_KEY=your-resend-api-key

3. Start the development server

npm run dev

4. Run tests

npm run test -- --run

5. Run lint checks

npm run lint

Database Schema

audits

Stores details about each audit, such as:

  • tool name
  • current plan
  • monthly spend
  • seats
  • team size
  • use case
  • audit output payload

leads

Captures information from users interested in the service, including:

  • audit ID
  • name
  • email
  • company
  • Role

Development Decisions

  • Audit calculations were intentionally kept rule-based to ensure recommendations are consistent and easy to validate.
  • AI was specifically utilized for generating personalized summary content, rather than for core audit logic.
  • localStorage was implemented to preserve user input, enhancing the user experience by preventing data loss.
  • The focus was placed on usability and clarity, prioritizing a clean interface over excessive animations or visual effects.
  • Much of the core logic was modularized within the lib/audit/ directory to simplify debugging and maintenance.

Testing

The project includes automated tests covering:

  • Savings calculations
  • Recommendation logic
  • Overspend detection
  • Audit generation edge cases

Run tests using:

npm run test -- --run

CI/CD

GitHub Actions automatically runs:

  • Lint checks
  • Automated tests

on every push to main.


Related Documentation

Core Project Docs


Product & Planning


Development Notes


Main Folders

  • app/ — App Router pages and API routes
  • components/ — Reusable UI components
  • constants/ — Static pricing and tool data
  • lib/ — Core business logic and utilities
  • types/ — Shared TypeScript types
  • tests/ — Vitest test files
  • public/ — Static assets

Assignment Context

Built as part of the Credex Web Development Internship Assignment.

About

AI Audit helps teams understand their AI tool spending, compare plans, and find cheaper alternatives based on actual usage.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages