Inspiration

We watched a team burn four months of cloud credits in one week - no visibility, no alerts, no attribution. By the time they knew, the damage was done. Existing billing dashboards show aggregate spend. They don't tell you which tenant, which feature, which model caused it. We built the layer that was missing.

What it does

SpendSense is a real-time FinOps dashboard for SaaS operators. It tracks every AI and cloud cost event, attributes it to a tenant → feature → model chain, and surfaces it live. Per-tenant budget caps, hourly spend tracking, anomaly detection when a provider spikes 2× baseline, and rule-based cost optimisation - all in one dashboard.

How we built it

Next.js 16 App Router + TypeScript frontend, Recharts for visualisation, SWR for live polling (1.5s–10s intervals). Backend is Next.js API routes connected to Amazon Aurora DSQL. Every cost event is atomically written to an append-only ledger plus three pre-aggregated summary tables inside an OCC-retried transaction.

Challenges we ran into

Aurora DSQL's lock-free OCC model was the steepest curve conflicts surface at COMMIT, not at the row lock, so every write needs a full retry harness. DSQL also has no foreign keys, so referential integrity is enforced in application code. Getting the Vercel OIDC -> AWS IAM -> DSQL token chain right without any stored secrets took real trial and error.

Accomplishments that we're proud of

Even under hundred's of simultaneous concurrent writes hitting the same resource, every single transaction resolved correctly - no data loss, no double-counting, no inaccuracy. Aurora DSQL's OCC model handled every conflict and retried automatically, giving us financial-grade correctness at high concurrency without a single lock. We're also proud of what SpendSense represents beyond the code: a real tool that any fast-moving team or SaaS operator can drop in and immediately know where their money is going. That kind of spend visibility has historically required expensive enterprise FinOps platforms. We built it lean, open, and real-time.

What we learned

Aurora DSQL internals changed how we think about concurrency. We went deep on connection pooling how pg-pool manages connection lifecycle, how IAM auth tokens are minted lazily per connection rather than upfront, and why that matters for serverless environments where cold starts are real. Real-time use cases that would traditionally require complex polling infrastructure were replaced entirely with SWR's lightweight interval fetching against Aurora DSQL simpler, more accurate, and surprisingly powerful. Vercel's deployment model is genuinely remarkable. From local development to a globally deployed, production-ready application with OIDC federation, environment management, and edge routing in a single push. It compressed what would normally be days of DevOps into minutes and let us stay focused on the product the entire time. v0 as a development agent changed the pace of building. Having an AI agent that understands the full codebase schema, API contracts, component patterns and can implement across multiple files coherently made the difference between a half-finished demo and a complete, polished product. It's not just autocomplete; it's a collaborator that holds the whole system in context.

What's next for SpendSense

Tenant-facing logins so each client can see exactly where their budget is going. Real budget alerts delivered via Slack and email. LLM-generated recommendations powered by the Claude API. A drop-in SDK so any app can instrument in one line.

Built With

  • amazon-aurora-dsql
  • aws-iam/oidc
  • next.js-16-(app-router)
  • react-19
  • recharts
  • swr
  • tailwind-css
  • typescript
  • vercel
  • zod
Share this project:

Updates