DEV Community

Cover image for PassionLedger AI: I Turned My Cashbook Into a Funding Engine for Dreams
asprojects
asprojects

Posted on

PassionLedger AI: I Turned My Cashbook Into a Funding Engine for Dreams

DEV Weekend Challenge: Passion Edition Submission

This is a submission for Weekend Challenge: Passion Edition

What I Built
I built PassionLedger AI, an offline-first personal finance application that helps people turn their everyday financial data into a realistic plan for something they genuinely care about.

Most cashbook applications tell users where their money went.

PassionLedger AI tries to answer a different question:

How can the money I have today help me build the future I care about?

A user can create a passion goal such as:

Building a home recording studio
Buying a professional camera
Joining an educational course
Starting a side project
Publishing a book
Planning a family trip
Starting a small business
Supporting a community initiative

The application analyses income, expenses, savings and financial surplus, then shows:

Current goal progress
Remaining amount
Required monthly contribution
Safe monthly contribution
Funding gap
Estimated completion date
Financial feasibility
Baseline and simulated savings projections

It also includes a What-If Simulator where users can explore how reducing optional spending, increasing income or extending the goal period may affect the completion date.

Why I built it

I have maintained personal financial records for several years.

My cashbook helped me understand my income, expenses, loans, savings and financial commitments. However, it mainly explained the past.

It could tell me how much I spent and how much remained, but it could not show me how my current financial position could support a meaningful goal.

That inspired me to transform my cashbook into PassionLedger AI.

The goal was not to create another generic expense tracker or an AI chatbot. I wanted to create a privacy-conscious planning tool that connects real financial information with human ambition.

Demo

Live Application

https://cashbook-snowy.vercel.app/

For the fastest experience:

Open Passion AI from the sidebar or Dashboard.
Click Try the 60-Second Demo.
Explore the sample home recording studio goal.
Adjust the What-If Simulator.
Generate the AI-powered passion plan.
Download the plan as a PDF.

The demo loads an isolated scenario:

Goal: Build a home recording studio
Target amount: ₹60,000
Current savings: ₹8,000
Desired period: 8 months
Average monthly income: ₹45,000
Average monthly expenses: ₹40,500

The demo data does not overwrite or modify the user’s real cashbook records.

Suggested Demo Flow
Start the demo and observe the goal progress, monthly contribution requirements and projected completion date.

Then increase the optional spending reduction using the What-If Simulator. The financial metrics and runway chart update immediately without calling the AI service.

Finally, select Generate My AI Passion Plan to receive practical suggestions, milestones, first-week actions and personalised encouragement.

Code

GitHub Repository

https://github.com/afsalprmric/cashbook

The repository contains:

  • The React and TypeScript frontend
  • Dexie and IndexedDB local database
  • Deterministic finance calculation engine
  • What-If Simulator
  • Recharts savings runway chart
  • Gemini-powered planning endpoint
  • Zod request and response validation
  • Local fallback plan generator
  • PDF export service
  • Demo data and challenge documentation

How I Built It

Core Technology

The application was built using:

  • React 19
  • TypeScript
  • Vite
  • React Router
  • Dexie.js
  • IndexedDB
  • Recharts
  • Google Gen AI SDK
  • Zod
  • Vercel Serverless Functions
  • jsPDF
  • jspdf-autotable
  • date-fns
  • Custom responsive CSS

Offline-First Architecture

PassionLedger AI is built on an offline-first cashbook application.

Financial data is stored locally in the browser using Dexie.js and IndexedDB. This means users can continue using the core application even without an internet connection.

The following features work locally:

  • Goal creation
  • Financial analysis
  • Progress tracking
  • What-If Simulator
  • Savings projections
  • Local fallback plan
  • PDF export

Internet access is required only for Gemini-powered guidance and optional Google synchronisation.

Deterministic Financial Calculations

I did not use AI to perform the core financial calculations.

All important figures are calculated locally using TypeScript:

  • Average monthly income
  • Average monthly expenses
  • Monthly surplus
  • Safe monthly contribution
  • Required monthly contribution
  • Funding gap
  • Goal progress
  • Estimated completion period
  • Feasibility status

For example:

Remaining amount =
Target amount - Current savings
Required monthly contribution =
Remaining amount / Available months
Safe monthly contribution =
80% of Average monthly surplus

The locally calculated values remain the source of truth.

This separation improves reliability because Gemini is not asked to invent or calculate financial numbers.

What-If Simulator

The simulator allows users to adjust:

  • Optional spending reduction
  • Expected additional monthly income
  • Goal duration

The application instantly recalculates the completion timeline and financial feasibility.

No Gemini request is made while the sliders are being adjusted.

This makes the simulator fast, private and usable offline.

Savings Runway Chart

I used Recharts to display:

  • Current savings
  • Baseline savings projection
  • Simulated savings projection
  • Target amount
  • Expected completion timeline

This helps users understand their financial path visually instead of reading only numbers.

Google Gemini Integration

Gemini acts as the planning intelligence behind PassionLedger AI.

After the user explicitly requests an AI plan, the frontend sends a compact financial summary to a Vercel serverless endpoint.

The summary includes:

  • Goal name and reason
  • Target amount
  • Current savings
  • Desired period
  • Average monthly income
  • Average monthly expenses
  • Safe monthly contribution
  • Verified financial metrics
  • Top expense categories
  • User-selected flexible categories

Gemini then generates:

  • A concise feasibility explanation
  • Practical suggestions
  • A recommended contribution strategy
  • Funding milestones
  • First-week actions
  • Personalised encouragement

The AI response is returned as structured JSON and validated using Zod before being displayed.

Privacy-First AI Design

Personal finance information is highly sensitive, so I created a strict privacy boundary.

The application does not send the following information to Gemini:

  • Complete transaction records
  • Transaction notes
  • Attachments
  • Payee names
  • Phone numbers
  • Credit card details
  • Bank information
  • Google Drive tokens
  • Raw database backups

Only aggregated financial information is sent, and only after the user requests an AI plan.

The Gemini API key is stored server-side as a Vercel environment variable and is not included in the frontend bundle.

Local Fallback Engine

External AI services can fail because of:

  • Network problems
  • Quota limits
  • Missing configuration
  • Invalid responses
  • Temporary service unavailability

PassionLedger AI therefore includes a local deterministic fallback engine.

When Gemini is unavailable, the application still generates:

Feasibility status
Suggested contribution
Practical actions
Funding milestones
First-week checklist
Encouragement

The user is never left with a broken screen.

PDF Export

Users can download their passion plan as a PDF.

The report contains:

  • Goal information
  • Progress
  • Financial metrics
  • Feasibility
  • Suggestions
  • First-week actions
  • Milestones
  • Generation source
  • Privacy note
  • Financial guidance disclaimer

The PDF does not contain private raw transactions.

Existing Cashbook Capabilities

PassionLedger AI is built on a larger offline-first Cashbook application that already supports:

  • Income and expense tracking
  • Category management
  • Payment modes
  • Loan and repayment tracking
  • Credit cards and EMIs
  • Investments
  • Bank reconciliation
  • PDF and Excel reports
  • JSON backup and restoration
  • Google Drive and Google Sheets synchronisation

Application Architecture
React Interface

Local Finance Calculator

Dexie / IndexedDB

Privacy-Filtered Aggregate Summary

Vercel Serverless Function

Google Gemini API

Zod Response Validation

Structured Passion Plan

Challenges I Faced
Keeping AI advice reliable

A language model should not control exact financial calculations.

I solved this by performing the calculations locally and using Gemini only to explain verified results and create an actionable plan.

Protecting private financial data

A personal finance app may contain transaction notes, contacts, card details and other sensitive information.

I created an aggregation layer that removes private details before any information reaches Gemini.

Supporting AI failure

A demo or real application should not become useless when an external service fails.

The local fallback engine ensures that the core experience remains functional.

Integrating the feature into an existing app

The original cashbook already had several modules and a versioned IndexedDB database.

I added PassionLedger AI using an additive Dexie migration without deleting or resetting existing user data.

What I Learned

This project taught me that meaningful AI integration is not about sending the largest possible amount of data to a model.

It is about deciding:

  • What should be calculated locally
  • What the AI genuinely needs
  • What data must remain private
  • How the AI response should be validated
  • How the product should behave when AI is unavailable

I also learned that financial planning becomes more motivating when it is connected to a meaningful human goal rather than presented only as restrictions and numbers.

What I Am Proud Of

I am especially proud of:

  • Connecting personal finance with passion
  • Keeping financial calculations deterministic
  • Creating a privacy-first Gemini integration
  • Making the core experience work offline
  • Building a one-click demo for judges
  • Adding a practical What-If Simulator
  • Supporting both Gemini and local fallback plans
  • Generating downloadable passion-plan reports
  • Future Improvements

Future versions could include:

  • Multiple passion goals
  • Goal prioritisation
  • Family-shared goals
  • Voice-based transaction entry
  • Monthly AI progress reviews
  • Passion-goal backup to Google Sheets
  • Shareable milestone cards
  • Advanced cash-flow forecasting
  • Recurring contribution reminders
  • More language options

Prize Categories

Best Use of Google AI

I am submitting PassionLedger AI for Best Use of Google AI.

Gemini is a meaningful part of the application’s planning experience.

It receives a privacy-filtered summary of locally verified financial metrics and transforms them into:

  • Practical suggestions
  • Funding milestones
  • First-week actions
  • Feasibility explanations
  • Personalised encouragement

The application does not use Gemini as a decorative chatbot.

Local TypeScript calculations remain responsible for financial accuracy, while Gemini provides the human-readable planning and motivation layer.

This combination allows PassionLedger AI to remain reliable, useful and privacy-conscious.

Final Thought

PassionLedger AI is based on a simple belief:

Money should not only record where life has been. It should help build where life is going.

PassionLedger AI — turn everyday spending into a realistic plan for the dream you care about.

Top comments (0)