Skip to main content
Q1/Q2 Capacity: Now accepting select web engineering & AI code rescue projects.
JoinAffix - Web Engineering
AI Code RescueIndustry: Financial Technology

Rescuing an AI-Generated Financial Modeling Application

Client: FinVector Analytics (Seed-Stage Fintech Startup)

Auditing, refactoring, securing, and deploying an MVP built using Cursor and Bolt that was plagued with client-side secret leaks, infinite API loops, and broken auth.

Rescuing an AI-Generated Financial Modeling Application
100%
Elimination of Client Security Leaks
9 days
Total Rescue Turnaround Time
$1.4M
Seed Capital Raised Post-Demo
The Challenge & Context

The Problem

The founders used AI coding assistants to assemble a financial modeling prototype. While the visual charts looked impressive, the code had fatal flaws: Stripe secret keys were exposed in client bundles, database permissions allowed any user to read other tenants' financial files, and build scripts failed consistently on Vercel.

Project Constraints

Key Constraints

  • Two weeks remaining before critical investor demo days
  • Zero tolerance for financial calculation inaccuracies or security leaks
  • Must preserve existing chart interaction UX that founders had carefully prototyped
Solution Architecture

Technical Approach & Execution

Conducted a forensic codebase audit, moved all sensitive operations to secure Next.js Server Actions, configured strict PostgreSQL Row-Level Security (RLS), and normalized the messy 60-file component tree.

Phase 01

Security & Secret Key Sanitization

Extracted all API keys and external queries from client React components into secure server-side routes with input validation via Zod.

Phase 02

Database Isolation with Row-Level Security

Re-engineered the Supabase PostgreSQL database schemas with strict RLS policies tied to validated JWT authentication claims.

Phase 03

Component Consolidation & Type Safety

Eliminated 35 duplicated component variations, resolved circular state updates, and achieved 100% strict TypeScript build passes.

Infrastructure Topology

Cloud & Deployment

  • Next.js App Router on Vercel
  • Supabase PostgreSQL with RLS
  • Stripe Billing Integration
  • GitHub Actions Automated CI Workflow
Technology Stack

Tools & Languages

Next.jsTypeScriptSupabasePostgreSQLTailwind CSSZodVercel

Key Engineering Lessons Learned:

  • AI code is great for generating UI ideas, but senior engineers are indispensable for auth, state, and security
  • Fixing the underlying architecture enabled the founder to continue using Cursor safely for small features

Facing a similar engineering challenge?

Let's review your architecture, code repositories, or deployment roadblocks.