# Inspiration

BudgetBuddy was inspired by a simple idea:  
people don’t struggle with budgeting because they lack knowledge  
they struggle because **emotions drive spending decisions**.

Stress, excitement, anxiety, pressure these emotional states impact how people spend far more than spreadsheets ever reveal.  
But no existing finance app understands or tracks emotional context.

BudgetBuddy aims to change that by combining **emotion tracking + financial tracking + AI insights** into one intelligent system.


# What It Does

BudgetBuddy is an **emotion-aware personal finance app** powered by AI.  
It helps users understand *why* they spend, not just *how much* they spend.

### Core Features
- **Mood Tracking**  
  Users log their emotional state; GPT-4o-mini classifies it with emotional depth.

- **Transaction Logging**  
  Each expense is recorded alongside emotional context.

- **Impulse Spending Detection**  
  AI identifies when spending is driven by emotional volatility.

- **AI Insights**  
  Correlates moods with spending patterns to highlight trends.

- **Conversational AI Coach**  
  Provides personalized financial guidance based on emotional states.

- **Adaptive Budgeting**  
  Budget suggestions adjust dynamically using emotional metrics.

- **AI Agent Hooks System** (In Progress)  
  Automated events triggered on:
  - `onMoodLogged`
  - `onTransactionAdded`
  - `weeklySummary` (planned)

Example of emotional volatility calculation:

```math
\text{volatility} = \sqrt{\frac{1}{n}\sum_{i=1}^{n}(m_i - \bar{m})^2}

Impulse risk estimation:

\text{impulse\_risk} = \frac{\text{volatility}}{\text{daily\_budget}} \times 100

How We Built It

Tech Stack

  • Frontend: Next.js 15, React 18, TypeScript, Tailwind CSS
  • Backend: Next.js API Routes, Supabase PostgreSQL with RLS
  • AI: OpenAI GPT-4o-mini for mood classification
  • Testing: Vitest, React Testing Library, fast-check

Kiro Features Used

  • Steering Rules Auto-guidance from:

    • tech.md
    • structure.md
    • product.md
  • Specs System AI Agent System defined with:

    • Requirements
    • Design
    • Tasks Using structured #[[file:...]] referencing.
  • Property-Based Testing fast-check used to test:

    • consistency of agent hooks
    • data persistence
    • random mood/transaction inputs
  • Organized Workspace Clear .kiro/ structure for modular development.

Challenges We Ran Into

1. Property-Based Testing Complexity

Writing generators for random financial + emotional data was challenging. Many tests (e.g., tasks 3.1, 3.4, 4.1–4.4) remain partially implemented.

2. Asynchronous AI Agent Hooks

Hooks like onMoodLogged required deterministic, stable behavior despite AI variability.

3. MCP Server Not Yet Started

Tasks 8–14 remain pending, blocking:

  • live agent execution
  • automated insights
  • real-time pipelines

4. Supabase RLS Policies

Ensuring secured data access while keeping automated tests functional required careful design.

5. Unpredictable AI Outputs

GPT-4o-mini occasionally introduced variance in classification requiring normalization logic.

6. Webhooks & Edge Functions (Not Implemented Yet)

The pipeline:

Database Trigger → Edge Function → MCP Agent → AI Insight

is planned but not completed.

Accomplishments We're Proud Of

  • ✔ Fully working mood tracking system
  • ✔ Transaction logging with emotional metadata
  • ✔ AI classification integrated and stable
  • ✔ Agent hooks implemented (with partial tests):

    • onMoodLogged
    • onTransactionAdded
  • ✔ Strong architectural base using Kiro steering rules

  • ✔ Well-structured spec system for the AI Agent

  • ✔ Database migrations completed for agent infrastructure

  • ✔ Clean, modern Next.js + Supabase application

What We Learned

Technical Learnings

  • Building secure full-stack apps with Supabase + Next.js
  • Using property-based testing for complex systems
  • Designing AI hook-based architecture
  • Managing RLS constraints
  • Handling and normalizing AI output variance

Product Learnings

  • Emotions influence spending patterns more than expected
  • Personalized budgeting requires emotional intelligence
  • Automation (via hooks/agents) creates more meaningful insights

Workflow Learnings

  • Kiro Specs allow complex features to be built incrementally
  • Steering rules maintain consistency across the entire project
  • Structured tasks avoid architectural drift

What’s Next for BudgetBuddy

1. Complete the AI Agent System

  • Finish all property tests
  • Implement the weeklySummary hook
  • Add error recovery + resilience systems

2. Build the MCP Server

  • Implement tasks 8–14
  • Enable real-time automated insights

3. Webhooks & Edge Functions

  • Trigger hooks on mood logs + transactions
  • Create real-time analysis pipeline

4. Insights Dashboard

  • Mood–spending correlation graphs
  • Emotional heatmaps
  • Savings recommendations driven by:
\text{savings\_opportunity} = \max(0, \text{budget} - \text{actual\_spend})

5. Conversational AI Advisor (Full Version)

  • Chat-like financial coach
  • Emotional accountability assistant

6. Mobile App Version

  • React Native + Expo
  • Mood journaling + spending insights on the go

7. Launch Preparation

  • Onboarding flow
  • Production Supabase setup
  • End-to-end testing
  • Marketing site

Built With

Share this project:

Updates