Skip to content

StevePhuc/fin-flow

Repository files navigation

FinFlow - Smart Savings Assistant

A hackathon demo app that helps users save money by analyzing bank transactions with AI and a Tinder-like swipe interface.

Features

  • 📤 Upload bank statement JSON files
  • 🎯 Set multiple savings goals
  • 🤖 AI-powered transaction analysis
  • 👆 Swipe interface (left to save, right to keep)
  • 🧠 Learning system that adapts to your preferences
  • 💰 Real-time savings tracking toward goals

Getting Started

Prerequisites

  • Node.js 18+ or Bun
  • OpenAI API key

Setup

  1. Install dependencies:
npm install
# or
bun install
  1. Create a .env.local file in the root directory:
OPENAI_API_KEY=your_openai_api_key_here
  1. Run the development server:
npm run dev
# or
bun dev
  1. Open http://localhost:3000 in your browser

  2. Navigate to /upload to upload your bank statement and set goals

Demo Data

A sample bank statement JSON is available at public/demo-statement.json. You can use this for testing.

JSON Format

Your bank statement JSON should follow this format:

{
  "transactions": [
    {
      "date": "2024-11-01",
      "merchant": "Netflix",
      "amount": 15.99,
      "category": "Entertainment",
      "description": "Monthly subscription"
    }
  ]
}

Or simply an array of transactions:

[
  {
    "date": "2024-11-01",
    "merchant": "Netflix",
    "amount": 15.99,
    "category": "Entertainment",
    "description": "Monthly subscription"
  }
]

How It Works

  1. Upload: Upload your bank statement JSON file
  2. Goals: Set your savings goals (e.g., "Trip to Spain - $500")
  3. Analysis: AI analyzes your transactions and identifies savings opportunities
  4. Swipe: Swipe left (No) to cut expenses and save money, swipe right (Yes) to keep spending
  5. Learn: The system learns from your choices and prioritizes similar transactions
  6. Track: Watch your savings grow toward your goals in real-time

Tech Stack

  • Next.js 16 - React framework
  • TypeScript - Type safety
  • Tailwind CSS - Styling
  • Vercel AI SDK - AI integration with OpenAI
  • React Hooks - State management

Project Structure

fin-flow/
├── app/
│   ├── api/analyze/     # AI analysis API route
│   ├── upload/          # Upload page
│   └── page.tsx         # Main swipe interface
├── components/
│   ├── SwipeCard.tsx    # Transaction card component
│   └── GoalTracker.tsx  # Savings progress tracker
├── lib/
│   ├── ai-processor.ts      # AI prompt building
│   ├── learning-engine.ts   # Preference tracking
│   └── transaction-utils.ts # Transaction parsing
└── types/
    └── index.ts         # TypeScript types

Deploy on Vercel

The easiest way to deploy is using Vercel:

  1. Push your code to GitHub
  2. Import your repository on Vercel
  3. Add your OPENAI_API_KEY as an environment variable
  4. Deploy!

License

MIT

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors