Skip to content

Sta981/SmartKharch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SmartKharch — Personal Finance Tracker

A web-based personal finance management system built with Python and Flask. Users can track income and expenses by category, set monthly budgets, and receive real-time WhatsApp alerts when spending exceeds defined limits.


Features

Transactions

  • Log income and expense transactions with category, date, amount, and notes
  • Mark transactions as recurring
  • Filter transactions by date range and type
  • Export full transaction history to CSV

Budget Management

  • Set monthly spending limits per category
  • Visual budget progress bars on the dashboard
  • Automatic overspend detection on every new transaction

WhatsApp Alerts

  • Real-time WhatsApp notification via Twilio when a category budget is exceeded
  • Alert includes category name, budget limit, total spent, and overspend amount
  • Each user registers their own phone number — alerts are user-specific

Dashboard

  • Monthly summary: total income, total expenses, savings, SmartKharch score
  • Expense breakdown chart by category
  • Unread in-app alerts panel

Tech Stack

Layer Technology
Backend Python, Flask
Database Microsoft SQL Server (via pyodbc)
Notifications Twilio WhatsApp API
Frontend HTML, CSS, Jinja2
Environment python-dotenv

Project Structure

SmartKharch/
├── app.py                  # Flask routes and application logic
├── templates/
│   ├── login.html
│   ├── register.html
│   └── dashboard.html
├── static/
│   └── style.css
├── SQL For Projeck.sql     # Full database schema and stored procedures
├── requirements.txt
├── .env                    # Environment variables (not committed)
└── README.md

Setup and Installation

Requirements: Python 3.9+, Microsoft SQL Server with ODBC Driver 17

Step 1 — Clone the repository

git clone https://github.com/Sta981/SmartKharch.git
cd SmartKharch

Step 2 — Install dependencies

pip install -r requirements.txt

Step 3 — Configure the database

Run SQL For Projeck.sql in SQL Server Management Studio to create the database, tables, and stored procedures.

Step 4 — Create the .env file

TWILIO_ACCOUNT_SID=your_account_sid
TWILIO_AUTH_TOKEN=your_auth_token
TWILIO_FROM=whatsapp:+14155238886

Step 5 — Run the application

python app.py

App runs at http://localhost:5000


WhatsApp Alert Setup (Twilio Sandbox)

  1. Create a free account at twilio.com
  2. Go to Messaging > Try it Out > Send a WhatsApp Message
  3. From your phone, send the sandbox join message to +14155238886
  4. Register on SmartKharch with your WhatsApp number (format: +923001234567)
  5. Alerts fire automatically when any category budget is exceeded

How It Works

When a user adds an expense transaction, the system:

  1. Logs the transaction via a stored procedure (sp_AddTransaction)
  2. Fetches the user's phone number from the database
  3. Queries total spending for that category in the current month
  4. Compares against the set budget limit
  5. Sends a WhatsApp alert via Twilio if the limit is exceeded

Database Schema (Key Tables)

Table Purpose
Users Stores user credentials, currency, and phone number
Categories Expense and income categories
Transactions All income and expense records
Budgets Monthly category spending limits per user
Alerts In-app alert log
Monthly_Summary Aggregated monthly stats and SmartKharch score

Dependencies

Package Purpose
flask Web framework
pyodbc SQL Server database connection
twilio WhatsApp notifications
python-dotenv Environment variable management

Developed by Syed Tahir — BS Artificial Intelligence, 4th Semester, Superior University Lahore

About

Personal finance tracker with budget alerts via WhatsApp — built with Flask and SQL Server

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors