| Project Name | Spendly - Personal Finance Tracker |
|---|---|
| Project Type | Academic |
| Academic Affiliation | Dr. Vishwanath Karad MIT - World Peace University, Pune (as on April 2025) |
| Difficulty | Medium |
| Duration | January 2025 - April 2025 |
| Developers | Ishan Surdi |
| Vrushali Deshpande | |
| Himanshu Pal | |
| Soham Borate | |
| License | Apache License 2.0 |
- Spendly Project Documentation
Spendly is a comprehensive financial management platform designed to help users:
- Track their expenses and income.
- Set and monitor financial goals.
- Gain insights into their spending habits.
- Generate detailed financial reports.
- Expense and Income Tracking: Log and categorize transactions.
- Budget Management: Set budgets and monitor progress.
- AI-Powered Insights: Use AI to analyze financial goals and provide recommendations.
- Email Notifications: Send automated email alerts for important updates.
- User-Friendly Interface: Intuitive design for seamless navigation.
The project is organized as follows:
spendly/
├── composer.json # Composer dependencies
├── composer.lock # Composer lock file
├── db-and-tables-file.sql # SQL file to set up the database
├── index.html # Landing page
├── payment.html # Payment page
├── readme.md # Project documentation
├── assets/ # Static assets (images, icons, etc.)
│ ├── favicon.ico
│ ├── form-right.png
│ ├── hero-demo.png
│ ├── logo-circle-white.png
│ ├── logo-nav.png
│ ├── logo-signup.png
│ ├── logo-white.png
│ ├── spendly-plus.png
│ ├── spendly-pro.png
│ └── icons/ # Icons used in the application
│ ├── arrow-right-stretched.svg
│ ├── arrow-right.svg
│ ├── arrow-up-right.svg
│ ├── budget-icon.svg
│ ├── budget-tracking-icon.png
│ ├── chevron-left.svg
│ ├── chevron-right.svg
│ ├── circle-check.svg
│ ├── emoji-wave.png
│ ├── expense-management-icon.svg
│ ├── expense.svg
│ ├── feedback.svg
│ ├── goals.svg
│ ├── headset.svg
│ ├── help-icon.svg
│ ├── history-icon.svg
│ ├── home-icon.svg
│ ├── income.svg
│ ├── info.svg
│ ├── log-out-white.svg
│ ├── log-out.svg
│ ├── logout-icon.svg
│ ├── mail.svg
│ ├── map-pin.svg
│ ├── mastercard.png
│ ├── message.svg
│ ├── plus.svg
│ ├── question-icon.png
│ ├── report-icon.png
│ ├── report-info.svg
│ ├── reports.svg
│ ├── rocket.svg
│ ├── rupay.png
│ ├── savings-tracker-icon.png
│ ├── smart-insights-icon.svg
│ └── sparkles.svg
├── backend_process/ # Backend PHP scripts for processing data
│ ├── add_expense.php
│ ├── add_income_expense.php
│ ├── add_income.php
│ ├── email_error.log
│ ├── get_budget_data.php
│ ├── get_budget_history.php
│ ├── get_chart_data.php
│ ├── get_expense_summary.php
│ ├── get_income_summary.php
│ ├── history_db_process.php
│ ├── login_db_process.php
│ ├── logo-no-background.png
│ ├── logout_process.php
│ ├── process_payment.php
│ ├── questions_db_process.php
│ ├── save_budget.php
│ └── sign_up_db_process.php
├── db_connection/ # Database connection scripts
│ └── db_connection.php
├── email_with_python/ # Python scripts for email functionality
│ ├── credentials.json
│ ├── email_error.log
│ ├── email_sender.py
│ ├── logo-no-background.png
│ ├── requirement.txt
│ ├── send_email.py
│ └── token.json
├── gemini-ai/ # AI-based financial analysis tools
│ ├── analyze_financial_goals.py
│ ├── analyze_goals.php
│ ├── api-cred.json
│ ├── command.log
│ ├── data_for_python.json
│ ├── fetch_user_data.php
│ ├── input.json
│ └── python_output.log
├── generated_reports/ # Folder for storing generated reports
├── public_pages/ # Public-facing PHP pages
│ ├── Budget.php
│ ├── dashboard.php
│ ├── history.php
│ ├── login.php
│ ├── payment.php
│ ├── questions.php
│ ├── reports.php
│ ├── sign-up.php
│ └── Transaction.php
├── styles/ # CSS stylesheets
│ ├── Budget.css
│ ├── dashboard.css
│ ├── history.css
│ ├── index.css
│ ├── payment.css
│ ├── questions.css
│ ├── report.css
│ ├── sign-up.css
│ └── Transaction.css
├── testing/ # Testing scripts
│ └── get_income_expense_summary.php
└── vendor/ # Third-party dependencies (via Composer)
├── guzzlehttp/
├── league/
├── phpmailer/
├── psr/
├── ralouphie/
└── symfony/
add_expense.php: Handles adding expense data to the database.add_income.php: Handles adding income data to the database.get_budget_data.php: Fetches budget-related data for the user.process_payment.php: Processes payment transactions.
dashboard.php: Displays the user dashboard with financial summaries.login.php: Handles user login functionality.reports.php: Displays financial reports for the user.
index.css: Styles for the landing page.dashboard.css: Styles for the user dashboard.
You can directly execute the file: db-and-tables-file.sql to set up all the tables in the database.
| Column Name | Data Type | Constraints | Description |
|---|---|---|---|
user_name |
VARCHAR(100) | NOT NULL | User's full name |
user_email |
VARCHAR(100) | NOT NULL | User's email address |
user_id |
VARCHAR(50) | PRIMARY KEY | Unique user identifier |
userpassword |
TEXT | NOT NULL | Stores hashed passwords |
enkey |
TEXT | NOT NULL | Encryption key for secure storage |
creation_timestamp |
TIMESTAMP | DEFAULT CURRENT_TIMESTAMP | Auto-fills with current time |
creation_day |
VARCHAR(50) | NOT NULL | Stores the day name separately |
| Column Name | Data Type | Constraints | Description |
|---|---|---|---|
user_id |
VARCHAR(50) | PRIMARY KEY, FOREIGN KEY REFERENCES sign_up |
Unique user identifier |
login_count |
INT | Number of logins | |
intial_data_entry |
VARCHAR(50) | DEFAULT "No" | Indicates if initial data is entered |
last_login_details |
TIMESTAMP | DEFAULT CURRENT_TIMESTAMP | Timestamp of the last login |
last_login_day |
VARCHAR(20) | Stores the day like 'Monday', etc. |
| Column Name | Data Type | Constraints | Description |
|---|---|---|---|
transaction_id |
VARCHAR(50) | PRIMARY KEY | Unique transaction identifier |
user_id |
VARCHAR(50) | FOREIGN KEY REFERENCES sign_up ON DELETE CASCADE |
User associated with the transaction |
type |
ENUM('income', 'expense') | NOT NULL | Type of transaction |
amount |
DECIMAL(10, 2) | NOT NULL | Transaction amount |
reason |
TEXT | Reason for the transaction | |
category |
VARCHAR(100) | Category of the transaction | |
timestamp |
DATETIME | DEFAULT CURRENT_TIMESTAMP | Timestamp of the transaction |
day |
VARCHAR(20) | NOT NULL | Day of the transaction |
previous_balance |
DECIMAL(10, 2) | DEFAULT 0 | Balance before the transaction |
after_balance |
DECIMAL(10, 2) | DEFAULT 0 | Balance after the transaction |
| Column Name | Data Type | Constraints | Description |
|---|---|---|---|
user_id |
VARCHAR(50) | PRIMARY KEY | Unique user identifier |
total_income |
DECIMAL(10, 2) | DEFAULT 0 | Total income of the user |
total_expense |
DECIMAL(10, 2) | DEFAULT 0 | Total expense of the user |
| Column Name | Data Type | Constraints | Description |
|---|---|---|---|
id |
VARCHAR(50) | PRIMARY KEY | Unique profile identifier |
user_id |
VARCHAR(50) | FOREIGN KEY REFERENCES sign_up |
User associated with the profile |
weekly_goals |
DECIMAL(10, 2) | Weekly financial goals | |
monthly_goals |
DECIMAL(10, 2) | Monthly financial goals | |
yearly_goals |
DECIMAL(10, 2) | Yearly financial goals | |
short_term_goals |
TEXT | Short-term financial goals | |
long_term_goals |
TEXT | Long-term financial goals | |
investment_interest |
VARCHAR(255) | Investment interests | |
risk_tolerance |
VARCHAR(50) | Risk tolerance level | |
primary_income_source |
TEXT | Primary source of income | |
monthly_income |
TEXT | Monthly income details | |
passive_income |
DECIMAL(12, 2) | Passive income | |
expected_annual_growth |
DECIMAL(5, 2) | Expected annual growth percentage | |
tax_saving_investments |
TEXT | Tax-saving investments | |
fixed_expenses |
DECIMAL(12, 2) | Fixed expenses | |
variable_expenses |
DECIMAL(12, 2) | Variable expenses | |
loans_emi |
TEXT | Loan EMIs | |
credit_card_usage |
TEXT | Credit card usage details | |
insurance_premiums |
TEXT | Insurance premium details | |
utilities |
DECIMAL(12, 2) | Utility expenses | |
groceries |
DECIMAL(12, 2) | Grocery expenses | |
transport |
DECIMAL(12, 2) | Transport expenses | |
entertainment |
DECIMAL(12, 2) | Entertainment expenses | |
healthcare |
DECIMAL(12, 2) | Healthcare expenses | |
gold |
TEXT | Gold assets | |
fixed_deposits |
TEXT | Fixed deposits | |
mutual_funds |
TEXT | Mutual funds | |
real_estate |
TEXT | Real estate assets | |
vehicles |
TEXT | Vehicle assets | |
pan_number |
VARCHAR(20) | PAN number | |
insurance_type |
VARCHAR(50) | Type of insurance | |
annual_premium |
DECIMAL(12, 2) | Annual insurance premium | |
coverage_amount |
DECIMAL(12, 2) | Insurance coverage amount | |
tags |
TEXT | Additional tags | |
notes |
TEXT | Additional notes | |
created_at |
VARCHAR(255) | Creation timestamp | |
updated_at |
VARCHAR(255) | Last updated timestamp |
| Column Name | Data Type | Constraints | Description |
|---|---|---|---|
transaction_id |
VARCHAR(50) | PRIMARY KEY | Unique transaction identifier |
user_id |
VARCHAR(50) | FOREIGN KEY REFERENCES sign_up |
User associated with the transaction |
purchase_amount |
DECIMAL(10, 2) | Amount of the purchase | |
purchase_plan |
VARCHAR(100) | Plan associated with the purchase | |
transaction_type |
ENUM('Purchase', 'Refund', 'Subscription') | DEFAULT 'Purchase' | Type of transaction |
payment_method |
VARCHAR(50) | Payment method used | |
upi_id |
VARCHAR(100) | UPI ID used for the transaction | |
masked_card_number |
VARCHAR(20) | Masked card number | |
status |
ENUM('Success', 'Failed') | Status of the transaction | |
payment_ref_number |
VARCHAR(100) | Payment reference number | |
start_of_plan |
DATE | Start date of the plan | |
end_of_plan |
DATE | End date of the plan | |
account_status |
ENUM('Active', 'Invalid') | Account status | |
is_recurring |
BOOLEAN | DEFAULT FALSE | Indicates if the transaction is recurring |
ip_address |
VARCHAR(45) | IP address of the user | |
device_info |
TEXT | Device information | |
created_at |
DATETIME | DEFAULT CURRENT_TIMESTAMP | Creation timestamp |
updated_at |
DATETIME | DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP | Last updated timestamp |
-
Install XAMPP:
- Download XAMPP from Apache Friends.
- Follow the installation instructions for your operating system.
- During installation, select the components you need (ensure Apache and MySQL are selected).
- After installation, open the XAMPP Control Panel and start the Apache and MySQL modules.
- Access phpMyAdmin by navigating to
http://localhost/phpmyadminin your browser.
-
Install Composer:
- Download Composer from getcomposer.org.
- Run the installer and follow the instructions:
- Ensure PHP is added to your system's PATH (Composer requires PHP to run).
- During installation, the installer will detect your PHP installation.
- Verify installation by running the following command in your terminal:
composer --version
-
Install Python:
- Download Python from python.org.
- Ensure Python 3.7 or later is installed.
- During installation, check the option to add Python to your system's PATH.
- Verify installation by running:
python --version
-
Install Pip:
- Pip is included with Python installations. Verify by running:
pip --version
- Pip is included with Python installations. Verify by running:
-
Set Up MySQL:
- Open phpMyAdmin from the XAMPP Control Panel.
- Create a new database named
spendly. - Import the
db-and-tables-file.sqlfile to set up the required tables.
-
Clone the Repository:
git clone <repository-url> cd spendly
-
Install PHP Dependencies:
- Run the following command in the project root:
composer install
- Run the following command in the project root:
-
Set Up the Database:
- Import the SQL file into your MySQL database using phpMyAdmin or the MySQL CLI.
- Update the database credentials in
db_connection/db_connection.php.
-
Set Up Email Functionality:
- Navigate to the
email_with_pythondirectory:cd email_with_python - Install Python dependencies:
pip install -r requirement.txt
- Obtain Gmail API credentials and place the
credentials.jsonfile in this directory.
- Navigate to the
-
Set Up AI Functionality:
- Navigate to the
gemini-aidirectory:cd gemini-ai - Install Python dependencies:
pip install -r requirement.txt
- Obtain an API key from Google AI Studio and update
api-cred.json.
- Navigate to the
-
Run the Application:
- Place the project folder in the
htdocsdirectory of XAMPP. - Start the Apache and MySQL modules in the XAMPP control panel.
- Access the application in your browser at
http://localhost/spendly.
- Place the project folder in the
- Python Installation:
- Ensure Python 3.7 or later is installed on your system.
- Verify installation by running:
python --version
- Pip Installation:
- Ensure
pip(Python package manager) is installed. - Verify by running:
pip --version
- Ensure
- Navigate to the Directory:
cd email_with_python - Install Dependencies:
- Install the required Python libraries listed in
requirement.txt:pip install -r requirement.txt
- Install the required Python libraries listed in
- Sign Up for Gmail API:
- Go to the Google Cloud Console.
- Create a new project or select an existing one.
- Navigate to
APIs & Services>Libraryand enable the Gmail API. - Go to
Credentials>Create Credentials>OAuth 2.0 Client IDs. - Download the
credentials.jsonfile.
- Update
credentials.json:- Place the downloaded
credentials.jsonfile in theemail_with_pythondirectory.
- Place the downloaded
Disclaimer: Always refer to the official Google Cloud documentation for the latest and most accurate instructions.
- Run the Script:
python send_email.py
- Error Logs:
- Check
email_error.logfor any issues during email sending.
- Check
- Emails will be sent to the specified recipients.
- Logs will be generated in
email_error.logfor debugging.
- Python Installation:
- Ensure Python 3.7 or later is installed on your system.
- Verify installation by running:
python --version
- Pip Installation:
- Ensure
pip(Python package manager) is installed. - Verify by running:
pip --version
- Ensure
- Navigate to the Directory:
cd gemini-ai - Install Dependencies:
- Install the required Python libraries (e.g.,
pandas,numpy):pip install -r requirement.txt
- Install the required Python libraries (e.g.,
- Sign Up for Google AI Services:
- Go to the Google AI Studio.
- Create a new project or select an existing one.
- Navigate to
APIs & Services>Libraryand enable the relevant AI APIs (e.g., Natural Language API, Vision API). - Go to
Credentials>Create Credentials>API Key. - Copy the generated API key.
- Update
api-cred.json:- Replace the placeholder values in
api-cred.jsonwith your actual API key.
- Replace the placeholder values in
Disclaimer: Always refer to the official Google AI documentation for the latest and most accurate instructions.
- Prepare Input Data:
- Update
data_for_python.jsonwith the necessary input data.
- Update
- Run the Script:
python analyze_financial_goals.py
- Check Output:
- Review
python_output.logfor results.
- Review
- Financial analysis results will be logged in
python_output.log. - The analysis can be integrated with the web application using
analyze_goals.php.
add_expense.php: Handles adding expense data to the database.add_income.php: Handles adding income data to the database.get_budget_data.php: Fetches budget-related data for the user.process_payment.php: Processes payment transactions.
dashboard.php: Displays the user dashboard with financial summaries.login.php: Handles user login functionality.reports.php: Displays financial reports for the user.
index.css: Styles for the landing page.dashboard.css: Styles for the user dashboard.
-
Apache or MySQL Not Starting in XAMPP:
- Ensure no other application is using port 80 or 3306 (e.g., Skype).
- Change the default ports in the XAMPP Control Panel settings if needed.
-
Composer Not Recognized:
- Ensure PHP is added to your system's PATH.
- Restart your terminal after installation.
-
Python Script Errors:
- Verify that all dependencies are installed using
pip install -r requirement.txt. - Check the logs (
email_error.logorpython_output.log) for specific error messages.
- Verify that all dependencies are installed using
- Refer to the official documentation for XAMPP.
- Visit the Composer documentation.
- Check the Python documentation.
We would like to thank:
- The open-source community for providing tools and libraries.
- Apache Friends for XAMPP.
- Composer for dependency management.
- Google Cloud for APIs and services.
Refer to the original contribution guidelines in this document for steps to contribute to the project.
If you encounter any issues or have questions, feel free to open an issue or contact the maintainers.