Back to Projects

The "Smart" Mini-Ledger
(Full Stack & AI Co-Pilot)

A full-stack personal finance ledger integrating Gemini NLP for conversational queries, built to demonstrate effective human-AI collaboration in engineering.

The Challenge

While AI coding tools are incredible for boilerplate, they frequently hallucinate destructive architecture patterns in production apps. The challenge was to leverage AI (Gemini) as a co-pilot for rapid scaffolding while using engineering judgment to enforce robust, scalable patterns.

I utilized AI to scaffold the Next.js and FastAPI environments in minutes. However, when the AI attempted to use destructive React state hacks (aggressive unmounting) and hardcoded mock data, I stepped in. I re-architected the frontend to use SWR (Stale-While-Revalidate) for buttery-smooth caching, and engineered a real-time O(N) frontend analytics engine using React `useMemo`.

System Architecture

graph LR
    User[User] -->|Ask NLP Question| Next[Next.js 14 Frontend]
    Next -->|useSWR Cache| Next
    Next -->|REST API| FastAPI[FastAPI Backend]
    FastAPI <-->|SQLModel| Postgres[(PostgreSQL)]
    FastAPI <-->|AI Prompts| Gemini[Gemini 2.5 Flash Engine]
          

Key Features

NLP 'Ask Your Ledger'

Integrated Gemini 2.5 AI directly into the frontend. Users can ask natural language questions (e.g., 'What was my biggest expense?') evaluated against live DB context.

Real-time Frontend Analytics

Built an O(N) aggregation engine using React useMemo that computes Cash Flow and Top Categories instantly with zero latency.

SWR Caching Layer

Architected a global frontend cache using SWR for instant page transitions and optimistic background mutations.

Human-AI Collaboration

Successfully navigated AI hallucinations, fixing destructive React lifecycle hacks and replacing static mock data with genuine Postgres relationships.

Technology Stack

Next.js 14 React SWR Python FastAPI PostgreSQL Gemini AI