Skip to content

arjungop/ai-powered-finance-manager

Repository files navigation

AI-Powered Personal Finance Manager

A smart financial assistant web app that helps users analyze, manage, and optimize their spending habits using AI.

🚀 Features

  • 📤 File Upload: Upload bank statements in CSV or Excel format
  • 🤖 AI Categorization: Automatic transaction categorization using GPT or rule-based system
  • 📊 Interactive Dashboard: Beautiful charts showing spending patterns and trends
  • 💡 Smart Insights: AI-generated financial insights and recommendations
  • 🔮 Budget Forecasting: Predict future expenses based on historical data
  • 📱 Responsive Design: Works on desktop and mobile devices

🛠️ Tech Stack

  • Frontend: Streamlit with Plotly for visualizations
  • Backend: FastAPI for REST API
  • Database: SQLite (easily upgradeable to PostgreSQL)
  • AI: OpenAI GPT for insights and categorization
  • Data Processing: Pandas and NumPy
  • Deployment: Can be deployed on Render, Streamlit Cloud, or AWS

📦 Installation

  1. Clone the repository
git clone <your-repo-url>
cd Finance_Manager
  1. Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies
pip install -r requirements.txt
  1. Set up environment variables
cp .env.example .env
# Edit .env file with your OpenAI API key

🏃‍♂️ Quick Start

Method 1: Frontend Only (Streamlit)

# Run the Streamlit app directly (includes demo mode)
streamlit run frontend/app.py

Method 2: Full Stack (Backend + Frontend)

# Terminal 1: Start the backend API
cd backend
python main.py

# Terminal 2: Start the frontend
streamlit run frontend/app.py

The app will be available at:

📊 Usage

  1. Upload Your Bank Statement

    • Go to "Upload Transactions" page
    • Upload a CSV or Excel file with your bank transactions
    • The app will automatically categorize transactions
  2. View Your Dashboard

    • Interactive charts showing spending by category
    • Spending trends over time
    • Key financial metrics
  3. Get AI Insights

    • Personalized recommendations for saving money
    • Financial health score
    • Spending pattern analysis
  4. Budget Forecasting

    • Predict future expenses
    • Get budget recommendations
    • Track savings potential

📁 File Format

Your bank statement should have these columns (in any order):

  • Date: Transaction date
  • Description: Transaction description
  • Amount: Transaction amount (negative for expenses, positive for income)
  • Category: (Optional) Existing category

Example CSV format:

Date,Description,Amount,Category
2024-01-15,Starbucks Coffee,-5.50,Food & Dining
2024-01-14,Salary Deposit,3500.00,Income
2024-01-13,Amazon Purchase,-89.99,Shopping

🔧 Configuration

OpenAI API Key

To enable AI-powered insights and categorization:

  1. Get an API key from OpenAI
  2. Add it to your .env file:
OPENAI_API_KEY=your_api_key_here

Supported Categories

  • Food & Dining
  • Transportation
  • Shopping
  • Entertainment
  • Bills & Utilities
  • Healthcare
  • Travel
  • Education
  • Income
  • Transfer
  • Investment
  • Other

🚀 Deployment

Streamlit Cloud

  1. Push code to GitHub
  2. Connect to Streamlit Cloud
  3. Deploy the frontend/app.py file

Render (Full Stack)

  1. Create two services on Render:
    • Web Service for FastAPI backend
    • Web Service for Streamlit frontend
  2. Set environment variables
  3. Deploy

Local Docker (Coming Soon)

docker-compose up

🧪 Development

Project Structure

Finance_Manager/
├── backend/
│   ├── api/           # FastAPI routes
│   ├── models/        # Data models
│   ├── services/      # Business logic
│   ├── utils/         # Helper functions
│   ├── config.py      # Configuration
│   └── main.py        # FastAPI app
├── frontend/
│   └── app.py         # Streamlit app
├── data/
│   └── sample/        # Sample data files
├── tests/             # Unit tests
├── requirements.txt   # Dependencies
└── README.md

Running Tests

pytest tests/

Code Formatting

black backend/ frontend/
flake8 backend/ frontend/

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🔒 Privacy & Security

  • All data processing happens locally or on your chosen cloud provider
  • No transaction data is stored permanently without your consent
  • OpenAI API calls only include transaction descriptions for categorization
  • Use environment variables for sensitive configuration

🆘 Support

If you encounter any issues:

  1. Check the Issues page
  2. Create a new issue with detailed information
  3. Contact support via email

🎯 Roadmap

  • Bank API integration (Plaid, Yodlee)
  • Mobile app (React Native)
  • Advanced ML models for better predictions
  • Multi-user support with authentication
  • Goal tracking and alerts
  • Investment portfolio analysis
  • Export to popular accounting software

Made with ❤️ for better financial health

About

Smart financial assistant for managing personal finances with AI-powered insights and budget forecasting

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published