💰 Finance Assistant Bot

Comprehensive financial chatbot with advanced banking capabilities. Features account management, transaction history, bill payments, budget tracking, spending analysis, savings goals, investment tracking, financial reports, loan calculators, currency conversion, and secure authentication.
Try Interactive Demo

📖 Project Overview

Finance Assistant Bot is a comprehensive financial chatbot that integrates Flask with SQLite to create an intelligent banking assistant system. This project offers account management with multiple accounts support, transaction history with filtering and search, bill payments with recurring payment support, budget tracking by category with spending analysis, savings goals with progress tracking, investment portfolio tracking, financial reports and net worth calculations, loan calculators and interest calculations, currency conversion with real-time rates, and secure authentication. Perfect for banks, financial institutions, and individuals looking to enhance their financial management with AI-powered banking assistance and advanced financial tools.

⚡ Quick Facts

🎯 Type: Financial Platform with Banking Capabilities
💰 Finance Features: Account Management, Transactions, Bills, Budgets, Savings Goals, Investments
⚡ Setup Time: ~5 minutes
📦 Backend: Python with Flask
🎨 Frontend: HTML5, CSS3, JavaScript
💾 Database: SQLite
📱 Platform: Web Browser
🔧 Technologies: Python, Flask, SQLite, Banking APIs
25+
Files
5000+
Lines of Code
20+
Advanced Features
200K
Context Tokens
Developer: Molla Samser | Website: rskworld.in | Email: help@rskworld.in
Difficulty Level: Advanced - Perfect for developers learning Python, Flask, SQLite database, banking API integration, financial platform development, and secure authentication systems.

✨ Features

Core Features

💰 Account Management

Check account balances, view transaction history, and manage multiple savings, checking, and investment accounts with account transfers.

📊 Transaction History

View complete transaction history with filtering by category, date range, and account. Search transactions and export as CSV.

💳 Bill Payments

Manage and pay bills seamlessly with recurring payment support, payment reminders, and bill tracking.

📈 Budget Tracking

Set budgets by category and track spending against them in real-time with spending alerts and budget analysis.

Advanced Features

📊 Spending Analysis

Analyze spending patterns by category with visual reports, trend analysis, and detailed financial insights.

🎯 Savings Goals

Set financial goals and track progress toward achieving them with automated savings tracking and goal recommendations.

📈 Investment Tracking

Monitor investment portfolio performance, track valuations, and analyze investment returns with detailed reports.

📄 Financial Reports

Generate comprehensive financial summaries, net worth reports, and detailed financial statements.

🧮 Loan Calculator

Calculate monthly loan payments, total interest, and payment schedules with detailed amortization tables.

💹 Interest Calculator

Calculate compound interest with monthly contributions and see future value projections.

💱 Currency Converter

Convert between 8 major currencies with real-time exchange rates and currency history tracking.

📅 Financial Calendar

View all financial events, bills, goals, and recurring transactions in one organized calendar view.

🔔 Alert System

Financial alerts and notifications with read/unread tracking for bills, budgets, and account updates.

💾 Export Data

Export transaction history, budgets, and reports as CSV files for record-keeping and external analysis.

🔒 Secure Authentication

Bank-level security with password hashing, secure session management, and encrypted data storage.

⚡ Real-time Updates

Fast financial updates with real-time balance tracking, transaction processing, and budget calculations.

🛠️ Technologies

Python

Core programming language for financial platform

Language

Flask

Python web framework for backend API

Framework

SQLite

Lightweight database for storing financial data, transactions, budgets, and user accounts

Database

Flask-Session

Session management for secure authentication and user sessions

Session

Werkzeug

Password hashing and security utilities for bank-level authentication

Security

Banking APIs

Integration with banking APIs for account management and transaction processing

API

RESTful API

Complete REST API with 25+ endpoints for all financial features

Architecture

📦 Installation Guide - Step by Step

⏱️ Installation Time: ~5 minutes

Follow these simple steps to set up the Finance Assistant Bot on your system.

📋 Prerequisites

🐍 Python 3.8+

Python 3.8 or higher required for the financial platform

Download: Python

🌐 Web Browser

Modern web browser (Chrome, Firefox, Safari, Edge) for accessing the financial platform

Recommended: Latest version of Chrome or Firefox

💾 SQLite

SQLite is included with Python (no separate installation needed)

Database: Created automatically on first run

🌐 Internet Connection

Required for Flask server and banking API integration (optional)

🚀 Step-by-Step Installation

📌 Step 1: Download or Clone the Project

Option A: Download ZIP

  1. Download the project ZIP file from the repository
  2. Extract it to your desired location (e.g., C:\Projects\finance-assistant-bot or ~/Projects/finance-assistant-bot)
  3. Navigate to the extracted folder

Option B: Clone with Git

git clone https://github.com/rskworld/finance-assistant-bot.git
cd finance-assistant-bot
✅ Step 2: Install Python Dependencies

Install required Python packages using pip.

# Install dependencies
pip install -r requirements.txt
✅ Step 3: Database Initialization

The SQLite database will be created automatically on first run.

  1. The database file finance_bot.db will be created automatically when you run the application
  2. All required tables (users, accounts, transactions, bills, budgets, savings_goals, investments, etc.) will be created automatically
  3. No manual database setup is required
  4. Demo credentials: Username: demo, Password: demo123
🚀 Step 4: Start the Flask Server

Start the Flask backend server by running app.py.

# Start Flask server
python app.py

# The server will start on http://localhost:5000
# Database will be initialized automatically on first run
🌐 Step 5: Open Frontend

Open the HTML file in your browser or use a local web server.

Method 1: Direct File Opening

  1. Open index.html in your browser

Method 2: Using Local Web Server (Recommended)

# In a new terminal, start HTTP server
python -m http.server 8000

# Then open: http://localhost:8000

✅ Installation Complete!

Congratulations! You've successfully set up the Finance Assistant Bot. The platform is ready to use with all features including:

  • Account management with multiple accounts support
  • Transaction history with filtering and search
  • Bill payments with recurring payment support
  • Budget tracking by category with spending analysis
  • Savings goals and investment portfolio tracking
  • Financial reports and net worth calculations
  • Loan calculators and interest calculations
  • Currency conversion with real-time rates
  • Secure authentication with password hashing

Next Steps:

  1. Ensure the Flask server is running (Step 4)
  2. Open the frontend in your browser (Step 5)
  3. Login with demo credentials (demo/demo123) or create a new account
  4. Explore all the financial features, account management, and banking tools!

🔧 Troubleshooting Installation

❌ Database Issues

Solution: Ensure SQLite is installed (included with Python), check file permissions for database creation, verify database file path is correct.

❌ Flask Server Not Starting

Solution: Check Python version (3.8+), verify dependencies installed with pip install -r requirements.txt, ensure port 5000 is available.

❌ Connection Errors

Solution: Verify Flask server is running on port 5000, check app.js has correct API_BASE_URL, ensure CORS is enabled in Flask.

❌ Import Errors

Solution: Reinstall dependencies, check virtual environment is activated, verify all packages in requirements.txt are installed (flask, flask-session, werkzeug).

📚 Usage Guide - Step by Step

🎯 Getting Started with Finance Assistant Bot

Step-by-Step Usage Instructions

📝 Step 1: Start Backend Server

  1. Ensure Flask server is running: python app.py
  2. Check server status at http://localhost:5000
  3. Database will be initialized automatically on first run
  4. You should see the Finance Assistant Bot interface

🌐 Step 2: Login or Register

  1. Open http://localhost:5000 in your web browser
  2. Login with demo credentials: Username: demo, Password: demo123
  3. Or create a new account by registering
  4. You should see the Finance Assistant Bot interface with:
    • Chat interface for financial assistance
    • Account balance and transaction display
    • Quick action buttons for common financial tasks
    • Financial features panel
    • Budget and spending statistics

💬 Step 3: Start Using Financial Features

  1. Check Balance: Type "Check my account balance" or use quick actions
  2. View Transactions: Type "Show my recent transactions"
  3. Budget Tracking: Type "What is my budget status?"
  4. Try These:
    • "Check my account balance"
    • "Show my spending analysis for this month"
    • "Calculate monthly loan payment for $50,000 at 5% over 5 years"
    • "Convert $100 USD to EUR"
    • "What is my budget status?"
  5. View Responses: The finance assistant will respond with account information, transactions, and financial insights

⚙️ Step 4: Explore Financial Features

Try out the platform features:

  • Account Management: Check balances, view accounts, transfer funds
  • Transaction History: View transactions, filter by category, export as CSV
  • Bill Payments: Manage bills, set recurring payments, track due dates
  • Budget Tracking: Set budgets, track spending, get alerts
  • Financial Calculators: Loan calculator, interest calculator, currency converter
  • Reports: Generate financial reports and net worth calculations

💻 Using the Financial Platform

You can interact with the Finance Assistant Bot through the web interface:

# Example Interactions User: "Check my account balance" Bot: [Account balances for all accounts] User: "Show my recent transactions" Bot: [Transaction history with details] User: "What is my spending analysis for this month?" Bot: [Spending breakdown by category] User: "Calculate monthly loan payment for $50,000 at 5% over 5 years" Bot: [Loan payment calculation with schedule]
# Quick Action Buttons - Check Balance: View account balances - Transactions: View transaction history - Loan Calculator: Calculate loan payments - Spending Analysis: Analyze spending by category - Budget Status: Check budget usage and remaining - Currency Convert: Convert between currencies

📊 Features Usage

💰 Account Management

Check account balances, view multiple accounts, transfer funds between your accounts

📊 Transaction Processing

View transaction history, filter by category and date, search transactions, export as CSV

💳 Bill Payments

Manage bills, set up recurring payments, track due dates, get payment reminders

📈 Budget Tracking

Set budgets by category, track spending in real-time, get budget alerts

🧮 Financial Calculators

Loan calculator, interest calculator, debt payoff strategies, currency converter

📄 Financial Reports

Generate comprehensive financial reports, net worth calculations, spending trends

🎯 Savings Goals

Set financial goals, track progress, get goal recommendations

🔒 Secure Authentication

Bank-level security with password hashing and secure session management

🚀 Advanced Features & Capabilities

The Finance Assistant Bot includes advanced banking capabilities, financial tools, and comprehensive features. Here's what you can do:

💰 Multiple Account Management

Manage multiple savings, checking, and investment accounts in one place. Transfer funds between accounts, view all balances, and track account activity across different accounts.

📊 Advanced Transaction Analysis

Analyze transactions by category, date range, account, and amount. Get detailed spending insights, trend analysis, and financial patterns. Export transaction data as CSV for external analysis.

💳 Comprehensive Bill Management

Manage all your bills in one place with recurring payment support, payment reminders, due date tracking, and payment history. Set up automatic recurring payments for regular bills.

📈 Financial Planning Tools

Set budgets by category, track spending in real-time, set savings goals, monitor investments, and generate comprehensive financial reports. Get personalized financial advice and recommendations.

💻 Code Examples

Basic Flask API Integration

# Python Flask backend - app.py from flask import Flask, request, jsonify, session from flask_session import Session import sqlite3 app = Flask(__name__) app.config['SECRET_KEY'] = 'your-secret-key' app.config['SESSION_TYPE'] = 'filesystem' Session(app) @app.route('/api/account', methods=['GET']) def get_account(): user_id = session.get('user_id') conn = sqlite3.connect('finance_bot.db') c = conn.cursor() c.execute('SELECT * FROM accounts WHERE user_id = ?', (user_id,)) accounts = c.fetchall() conn.close() return jsonify({'accounts': accounts}) @app.route('/api/transactions', methods=['GET']) def get_transactions(): user_id = session.get('user_id') days = request.args.get('days', 30) # Fetch transactions logic return jsonify({'transactions': []}) if __name__ == '__main__': app.run(debug=True, port=5000)

JavaScript Frontend Integration

// Frontend JavaScript - app.js async function checkBalance() { const response = await fetch('http://localhost:5000/api/account', { method: 'GET', headers: {'Content-Type': 'application/json'} }); const data = await response.json(); return data.accounts; } async function getTransactions(days = 30) { const response = await fetch(`http://localhost:5000/api/transactions?days=${days}`, { method: 'GET', headers: {'Content-Type': 'application/json'} }); const data = await response.json(); return data.transactions; } // Usage checkBalance().then(accounts => { console.log('Accounts:', accounts); });

Complete Finance Assistant Bot Example

// Finance Assistant Bot Class class FinanceAssistantBot { constructor(apiUrl) { this.apiUrl = apiUrl || 'http://localhost:5000'; } async checkBalance() { const response = await fetch(`${this.apiUrl}/api/account`, { method: 'GET', headers: {'Content-Type': 'application/json'} }); const data = await response.json(); return data.accounts; } async getTransactions(days = 30) { const response = await fetch(`${this.apiUrl}/api/transactions?days=${days}`, { method: 'GET', headers: {'Content-Type': 'application/json'} }); const data = await response.json(); return data.transactions; } async calculateLoan(principal, rate, term) { const response = await fetch(`${this.apiUrl}/api/loan-calculator`, { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ principal: principal, rate: rate, term: term }) }); const data = await response.json(); return data; } async getSpendingAnalysis(days = 30) { const response = await fetch(`${this.apiUrl}/api/spending-analysis?days=${days}`, { method: 'GET', headers: {'Content-Type': 'application/json'} }); const data = await response.json(); return data; } } // Usage const financeBot = new FinanceAssistantBot(); financeBot.checkBalance().then(accounts => { console.log('Accounts:', accounts); });

Configuration Example

// Frontend config - app.js const FinanceBotConfig = { api: { baseUrl: 'http://localhost:5000', endpoints: { account: '/api/account', accounts: '/api/accounts', transactions: '/api/transactions', budgets: '/api/budgets', spendingAnalysis: '/api/spending-analysis', loanCalculator: '/api/loan-calculator', currencyConvert: '/api/currency-convert' } }, ui: { animationDuration: 300, messageDelay: 500, defaultCurrency: 'USD' }, features: { enableBudgetTracking: true, enableInvestmentTracking: true, enableAlerts: true } }; // Access configuration console.log(FinanceBotConfig.api.baseUrl);
# Backend config - app.py import os import sqlite3 class Config: SECRET_KEY = os.getenv('SECRET_KEY', 'your-secret-key-here') DATABASE = 'finance_bot.db' SESSION_TYPE = 'filesystem' SESSION_PERMANENT = False # Database initialization @staticmethod def init_db(): conn = sqlite3.connect(Config.DATABASE) # Create tables # ... table creation code conn.close()

🔗 Banking API Integration

Banking API Integration

The application integrates with banking APIs for advanced financial capabilities. The backend uses Python Flask to handle API calls and SQLite database for data storage, while the frontend uses JavaScript for user interactions and financial data visualization.

Available APIs & Technologies

API/Technology Type Description
Flask REST API Backend Python Flask server with 25+ API endpoints
SQLite Database Database Lightweight database with 11 tables for financial data
Banking APIs External API Integration with banking APIs for account management
LocalStorage Browser API Store settings and user preferences

Backend API Endpoints

# Flask Backend - app.py @app.route('/api/account', methods=['GET']) def get_account(): user_id = session.get('user_id') # Get account information return jsonify({'accounts': accounts}) @app.route('/api/transactions', methods=['GET']) def get_transactions(): user_id = session.get('user_id') days = request.args.get('days', 30) category = request.args.get('category') # Get transactions with filtering return jsonify({'transactions': transactions}) @app.route('/api/budgets', methods=['GET']) def get_budgets(): user_id = session.get('user_id') # Get budget information return jsonify({'budgets': budgets}) @app.route('/api/spending-analysis', methods=['GET']) def spending_analysis(): user_id = session.get('user_id') days = request.args.get('days', 30) # Get spending analysis by category return jsonify({'analysis': analysis}) @app.route('/api/loan-calculator', methods=['POST']) def loan_calculator(): data = request.json principal = data.get('principal') rate = data.get('rate') term = data.get('term') # Calculate loan payment return jsonify({'monthly_payment': monthly_payment, 'total_interest': total_interest})
// Frontend JavaScript - API Integration async function checkBalance() { try { const response = await fetch('http://localhost:5000/api/account', { method: 'GET', headers: {'Content-Type': 'application/json'} }); if (!response.ok) { throw new Error('API request failed'); } const data = await response.json(); return data.accounts; } catch (error) { console.error('Error:', error); return 'Error: ' + error.message; } } async function getTransactions(days = 30) { const response = await fetch(`http://localhost:5000/api/transactions?days=${days}`, { method: 'GET', headers: {'Content-Type': 'application/json'} }); const data = await response.json(); return data.transactions; }

Browser Compatibility

// Check Flask Server Connection async function checkHealth() { try { const response = await fetch('http://localhost:5000/api/account'); if (response.ok) { console.log('Server Status: Online'); console.log('Database: Connected'); return true; } return false; } catch (error) { console.error('Health check failed:', error); return false; } } // Recommended setup: // - Backend: Python 3.8+ with Flask and SQLite // - Frontend: Modern browsers (Chrome, Edge, Safari, Firefox) // - Database: SQLite (included with Python) // - Security: Flask-Session and Werkzeug for authentication

⚙️ Configuration

Configuration in this application is handled through environment variables and settings files:

Environment Variables (Optional)

Create a .env file in the project root for custom configuration:

# .env file (optional) SECRET_KEY=your-secret-key-here FLASK_ENV=development PORT=5000 DATABASE=finance_bot.db

Note: The database will be created automatically on first run. Never commit your .env file to version control if it contains sensitive data.

Python Configuration (app.py)

The app.py file contains configuration settings:

# app.py import os import sqlite3 from flask import Flask, session from flask_session import Session app = Flask(__name__) app.config['SECRET_KEY'] = os.getenv('SECRET_KEY', 'your-secret-key') app.config['SESSION_TYPE'] = 'filesystem' app.config['SESSION_PERMANENT'] = False app.config['DATABASE'] = 'finance_bot.db' Session(app) # Database initialization def init_db(): conn = sqlite3.connect(app.config['DATABASE']) # Create tables # ... table creation code conn.close()

Frontend Configuration

Edit app.js to configure API endpoint:

// app.js const API_BASE_URL = 'http://localhost:5000'; const DEFAULT_CURRENCY = 'USD'; const DEFAULT_TRANSACTION_DAYS = 30;

Browser LocalStorage Settings

User settings are automatically saved to browser's local storage:

// Settings are saved automatically localStorage.setItem('financeBotSettings', JSON.stringify({ defaultCurrency: 'USD', defaultTransactionDays: 30, enableBudgetAlerts: true, enableInvestmentTracking: true, theme: 'light' })); // Load settings const settings = JSON.parse(localStorage.getItem('financeBotSettings'));

Runtime Configuration

Configure settings through the web interface:

  • Currency: Select default currency (USD, EUR, GBP, INR, etc.)
  • Transaction Period: Choose default transaction period (7, 30, 90 days)
  • Budget Alerts: Enable/disable budget alerts and notifications
  • Investment Tracking: Enable/disable investment portfolio tracking
  • Theme: Select theme (light/dark mode)

All settings are saved automatically and persist across browser sessions.

📁 Project Structure

The Finance Assistant Bot follows a clean, organized structure for easy navigation and maintenance.

finance-assistant-bot/
├── finance-assistant-bot/
│   ├── templates/
│   │   └── index.html      # Main HTML interface
│   ├── static/
│   │   ├── css/
│   │   │   └── style.css   # Modern styling
│   │   └── js/
│   │       └── app.js      # Frontend logic
│   ├── app.py              # Flask backend server (1600+ lines)
│   ├── requirements.txt    # Python dependencies
│   ├── finance_bot.db      # SQLite database (created on first run)
│   ├── README.md           # Project documentation
│   ├── ADVANCED_FEATURES.md # Advanced features guide
│   ├── NEW_FEATURES.md     # New features documentation
│   └── RELEASE_NOTES.md    # Release notes
├── demo/
│   ├── index.html          # Documentation page
│   ├── demo.html           # Interactive demo
│   ├── style.css           # Demo styling
│   └── script.js           # Demo scripts
└── README.md               # Project documentation

📄 Frontend Files

Location: finance-assistant-bot/templates/ and finance-assistant-bot/static/

  • templates/index.html - Main UI interface with chat
  • static/css/style.css - Modern financial styling
  • static/js/app.js - JavaScript functionality

🐍 Backend Files

Location: finance-assistant-bot/

  • app.py - Flask server & API endpoints (1600+ lines)
  • requirements.txt - Python dependencies (flask, flask-session, werkzeug)
  • finance_bot.db - SQLite database (auto-created)
  • README.md - Project documentation

⚙️ Configuration

Setup: Configure these files for your environment

  • .env - Environment variables (optional)
  • requirements.txt - Python dependencies
  • app.py - Application configuration
  • finance_bot.db - Database (auto-created on first run)

🔧 Troubleshooting

Database Issues

  • Ensure SQLite is installed (included with Python 3.8+)
  • Check file permissions for database creation in the project directory
  • Verify database file path is correct in app.py
  • If database is corrupted, delete finance_bot.db and restart the application
  • Check database schema initialization is running correctly on first start

Flask Server Issues

  • Server not starting: Check Python version (3.8+), verify dependencies installed with pip install -r requirements.txt
  • Port 5000 in use: Change port in app.py or stop other applications using port 5000
  • Import errors: Ensure virtual environment is activated, reinstall dependencies (flask, flask-session, werkzeug)
  • CORS errors: Verify Flask-CORS is installed and enabled in app.py (if using external frontend)
  • Connection refused: Check firewall settings, ensure server is running on correct port

Authentication Issues

  • Login not working: Check database initialization, verify user table exists, use demo credentials (demo/demo123)
  • Session errors: Ensure Flask-Session is installed, check session configuration in app.py
  • Password hashing: Verify Werkzeug is installed for password hashing
  • Session expires: Check session timeout settings and refresh token logic

Common Issues

  • Database not found: Database is created automatically on first run, check file permissions
  • Module not found: Install dependencies with pip install -r requirements.txt (flask, flask-session, werkzeug)
  • Transaction errors: Check database connection, verify table structure, check SQLite version
  • Account balance incorrect: Verify transaction calculations, check database integrity
  • Budget tracking not working: Check budget table exists, verify category matching logic

📋 Requirements

Backend Requirements: - Python 3.8 or higher - Flask web framework - Flask-Session for session management - Werkzeug for password hashing and security - SQLite (included with Python) Frontend Requirements: - Modern Web Browser (Chrome, Edge, Safari, Firefox) - JavaScript ES6+ support - LocalStorage API Database Requirements: - SQLite 3+ (included with Python) - Database created automatically on first run Python Dependencies (see requirements.txt): - flask - flask-session - werkzeug Optional Requirements: - Banking API integration (for real banking features) - Internet connection for currency conversion (if using external API) No External API Keys Required: - No OpenAI API key needed - No external API keys required for basic functionality - Works completely offline for local database operations

Browser Compatibility: Chrome, Edge, Safari, or Firefox (all modern browsers supported).

Python Version: Python 3.8 or higher required for backend server.

Database: SQLite database is created automatically on first run, no manual setup required.

🎯 Use Cases

💰 Personal Finance Management

Manage personal finances, track expenses, and monitor account balances

🏦 Banking Services

Provide banking services, account management, and transaction processing

📊 Budget Planning

Create budgets, track spending, and get budget alerts and recommendations

📈 Financial Analysis

Analyze spending patterns, generate financial reports, and track net worth

🎯 Savings Goals

Set financial goals, track progress, and get goal recommendations

💳 Bill Management

Manage bills, set up recurring payments, and track due dates

🧮 Financial Calculators

Calculate loan payments, interest, debt payoff strategies, and currency conversion

🌐 Web Integration

Integrate financial features into web applications and banking systems

💬 Support

For support, questions, or more projects:

📄 License

This project is provided as-is for financial and development purposes.

MIT License - See LICENSE file for details.