Free AI spend audit for startups. Enter your tools, get an instant breakdown of overspend, and see exactly what to cut or switch — with numbers a finance person will agree with.
Built by Credex — the AI infrastructure credits marketplace.
See deployed URL for a live demo.
- Node.js 20+
- Supabase project (free tier works)
- Resend account (free tier)
- Anthropic API key (free trial available)
git clone https://github.com/yourusername/ai-spend-audit
cd ai-spend-audit
npm install
cp .env.example .env.local
# Fill in your keys in .env.local
npm run dev
# Open http://localhost:3000npm test# Push to GitHub → connects to Vercel
# Set all env vars in Vercel dashboard (from .env.example)
vercel deploy --prodRun this SQL in your Supabase SQL editor:
create table audits (
id text primary key,
created_at timestamptz not null default now(),
form_data jsonb not null,
recommendations jsonb not null,
total_monthly_savings numeric not null,
total_annual_savings numeric not null,
savings_tier text not null,
ai_summary text
);
create table leads (
id uuid primary key default gen_random_uuid(),
audit_id text references audits(id),
email text not null,
company_name text,
role text,
team_size int,
created_at timestamptz not null default now()
);
-- Public read on audits (for share page), leads never public
alter table audits enable row level security;
create policy "Public read" on audits for select using (true);
alter table leads enable row level security;
-- leads only accessible via service role key (server-side)-
Next.js App Router over Pages Router — Server components let us fetch audit data server-side for OG metadata on share pages, which is critical for the viral loop. Switching mid-project would have been costly.
-
Rule-based audit engine, not AI — The assignment explicitly noted "knowing when not to use AI is part of the test." Hardcoded rules are deterministic, auditable, and fast. A finance person can read the logic and agree or disagree line by line. AI for the summary only.
-
Supabase over a custom Postgres — Free tier, generous limits, built-in row-level security, and the JS client is ergonomic. Trade-off: vendor lock-in and cold-start latency on the edge. Acceptable for an MVP.
-
In-memory rate limiting over Redis/Upstash — Redis adds cost and setup complexity. In-memory works fine for single-instance deployments (Vercel serverless functions reset per cold start, which is actually a natural rate-limit window). Documented limitation: doesn't work across instances at scale.
-
Email captured after value shown, never before — Lead gates before results kill conversion. Showing the savings number first and offering email for "get this by email" is the right UX pattern for this product. Tested this assumption against user interview feedback.