You are on page 1of 51

CHAPTER 1

INTRODUCTION

The Personal Expense Tracker application is designed to track your organization's


income and expenses on a daily basis. This application splits your income based on your daily
expenses. Once the monthly cost is exceeded, the system will calculate the revenue and notify
the user by registered mail of the cost details. The daily expense tracking system produces
reports at the end of the day, month and year to show you graphs of your income and expenses.
Users can change expense details using the application's edit and delete functionality. The
expense management application analyzes total expenses, identifies cost-saving opportunities,
and controls overspending. "Personal Expense Tracker App" is an application that allows you to
enter your daily expenses and see your expenses on a chart at the end of the day. Spending
history is also provided in the application. When the limit is exceeded, the application
automatically sends a notification to the user with cost details.

Users get notification to record


expenses and incomes that are
helpful to
the tracking system of the
application
Users get notification to record
expenses and incomes that are
helpful to
1
the tracking system of the
application

1.1 PROJECT OVERVIEW


A web Application called Personal Expense Tracker is used to maintain daily, weekly,
monthly, and annual expense data. The goal of this project is to create a web application that will
be useful to users who struggle to keep track of their expenses and run out of resources due to
poor resource management. By using the personal expense tracker, users will be able to better
manage their demands and spending. It is created and designed in a way that makes it compatible
with all devices. We have also considered disinterest or the lack of time of users to maintain such
records and thus made the web application voice powered as well making sure that there is
something for each and every type of users. The application will prove to be a crucial utility
among the families removing the fear of losing the physical records, here data is stored in local
storage of the browser and thus is never lost and stay as it is even if you open the application
after a long period of time.

1.2 PURPOSE

The most reason of the proposed project work is to help users manage their expenses
and savings based on their income and also to guide and make them aware about their daily
expenses and then to provide a consolidated graph/chart about their annual expenses and
savings, based on it, rewards will be provided.

2
 To keep track of all your daily expenses.
 To keep track of money lend or borrowed.
 To suggest you with the best investment options.

CHAPTER 2

LITERATURE SURVEY

2.1 EXISTING PROBLEM


The Expense tracker existing system does not provide the user portable device

3
management level, existing system only used on desktop mobile so unable to update any
expenses and unable to update the expense details and there is no as such complete solution
to keep a track of its daily expenses easily.

 Data is not accurate.


 Reports in not up to the mark.
 A single mistake in a manual calculation and actually cost you much.
 Less Security.
 No proper coordination between different Applications and Users.
 Fewer Users – Friendly

In the existing model, a person as to keep a log in a diary or in a computer


system, also all the calculations need to be done by the user which may sometimes results in
mistakes leading to losses. The existing system is not user friendly because data is not
maintained perfectly.

2.2 REFERENCES
I) Title: Expense Tracker

Authors: Aman Garg,Mukul Goel ,Sagar Mittal, Mr. Shekhar Singh

Description: An application called Expense Tracker was created to easily and effectively
keep track of daily expenses. This makes it possible for us to do away with the duties
associated with maintaining information on paper. Any person can use this device to control
their income and expenses on a daily, weekly, monthly, or annual basis and to keep track of
their spending, including the recipient of payments and the intended use of those payments.
A pie chart will show the breakdown of spending on a weekly, monthly, and annual basis. It
helps us recall and add details about the money we get from others and the expenses or
payments we must make on a specific date or during a specific month.

4
II) Title: Novel Expense tracker

Authors: Muskaan Sharma, Ayush Banshal, Dr. Raju Rajan, Shivam Sethi

Description: A daily expense management tool called Expense Tracker was created to make it
simple and effective to keep track of the daily expenditures of both paid and unpaid employees.
It is a computerised system that does away with the need for labor-intensive paper work,
systematically maintains records, and makes it simple to access user-stored data. Users using
Windows-based computers can use this programme. We utilise MySQL Workbench 8.0 CE and
Java (Apache Netbins 11.3) as the language databases to create this system. A GUI (Graphics
User Interface) is used in this programme. You can download the application if you use
Windows.

III) Title: Intelligent Online Budget Tracker

Authors: Girish Bekaroo and Sameer Sunhaloo

Description: The Daily Expense Tracker is built on a system for recording income and
expenses. The opportunities provided by this initiative will enable users to support all financial
activities, such as automated dairy, going forward. The primary goal of the project is to establish
a quicker, simpler, and more seamless system between expenses and income. Due to its
simplicity and aesthetic appeal, the cost tracker we created for improved spending tracking is
simple to use and easy to understand. The best approach to keep track of your spending is to use
a daily cost tracker. Most people struggle to keep track of their finances. Saving money is
difficult for them.

2.3 PROBLEM STATEMENT DEFINITION


Personal finance includes all of the financial decisions and actions that a finance
software facilitates by assisting you in effectively managing your money. A personal finance

5
software will not only assist you with accounting and budgeting, but it will also provide you with
valuable advice on money management. Users of personal finance applications will be prompted
to enter their costs, after which their wallet balance would be updated and made accessible to
them. Users can also receive a graphical analysis of their expenses. They can choose to establish
a cap on how much can be utilised in a given month, and if the cap is surpassed, SendGrid's
software will send the user an email alert.

Who does the problem affect? Working individuals, students and budget
conscious consumers.

What are the boundaries of the problem? Limited features to provide for expense tracking.

When does this issue occur? When people are not able to track their expenses
properly.

Where is the issue occurring? In daily life of employees as well as students.

Why is it important that we fix the problem? By solving this issue those people getting regular
wages can track their expenses and avoid
unwanted expenses.
Table 2.1: Problem Statement Definition

CHAPTER 3

IDEATION & PROPOSED SOLUTION

3.1 EMPATHY MAP CANVAS

6
An empathy map is a simple, easy-to-digest visual that captures knowledge about a
user’s behaviors and attitudes. It is useful to solve the user problems in the application. Creating
an effective solution requires understanding the true problem and the person who is experiencing
it. The exercise of creating the map helps participants consider things from the user’s perspective
along with his or her goals and challenges. Effective expense tracking and reporting to avoid
conflict. As a project manager or business owner, you can set clear policies for the expense types
and reimbursement limits to avoid misunderstandings are about costs. Tracking the project
expenses by asking team members to provide receipts is helpful to avoid conflict and maintain
compliance also. An excellent reporting mechanism is extremely helpful to support the amount
to be reimbursed to your team and also invoicing to your customer

Fig 3.1: Empathy map

3.2 IDEATION & BRAINSTORMING

Brainstorm & Idea Prioritization:

7
Brainstorming provides a free and open environment that encourages everyone within a
team to participate in the creative thinking process that leads to problem solving. Prioritizing
volume over value, out-of-the-box ideas are welcome and built upon, and all participants are
encouraged to collaborate, helping each other develop a rich number of creative solutions.

Step-1: Team Gathering, Collaboration and Select the Problem Statement

Fig 3.2: Team Gathering, Collaboration and Select the problem Statement

8
Step-2: Brainstorm, Idea Listing and Grouping

Fig 3.3: Brainstorm, Idea Listing and Grouping

Step-3: Idea Prioritization

9
Fig 3.4: Idea Prioritization

3.3 PROPOSED SOLUTION


We provide an application to lessen laborious calculations. Users of this application can keep an
automated digital diary. Each user will need to sign up for an account on the system, at which point they
will receive an ID that will be used to keep track of each individual user. An application called Expense
Tracker will keep track of a user's daily income and expenses. Utilizing software or managing expense
tracking will assist in reducing wasteful spending. Your spending will be split up into various categories
that the user will find useful. Additionally, a cost history will be included in the application. Our objective
is to develop a "Personal Expense Tracker Application" that will allow users to monitor all financial
transactions and access historical income and expense reports.
 Add Expense and Income.
 User can update or delete records.
 User can set their own limits based on their monthly income and budget.
 User can easily review the reports daily, weekly, monthly and yearly.
 User can get notification if monthly limit exceeds.

 User information’s are stored in the cloud database IBM db2.

S.NO. Parameter Description

1. Problem Statement To manage the expenses of an individual in an efficient


and manageable manner, as compared to the traditional
way of expense tracking.

2. Scalability of the This application can handle large number of users and
Solution data with high performance and security. This
application can adapt for both large-scale and small-
scale purposes. Easily available in all kinds of devices.

10
3. Idea / Solution Daily expense management system which is specially
description designed for non-salaried and salaried personnel for
keeping track of their daily expenditure with easy and
effective way through computerized system which tends
to eliminate manual paper works. Personal finance
applications will ask users to add their expenses and
based on their expenses wallet balance will be updated
which will be visible to the user. They have an option to
set a limit for the amount to be used for that particular
month if the limit is exceeded the user will be notified
with an email alert.
4. Novelty / The user gets notified when their expense exceeds the
Uniqueness limit and also it reminds the user when they forgot to
make entry. Tracking expenses through SMS. Data
analytics on expenses. Future expense prediction.

5. Social Impact / The application should be able to generate reports of


Customer their spending and notify users if they have exceeded
Satisfaction their budget. It is designed to be dynamic to produce the
prediction. It also provides users’ personal information,
their income as well as their expenses. This application
can create awareness among common people about
finance and stuffs. This application also helps user to be
financially responsible. It Reduces time rather than
entering details manually.

6. Business Model This Application is provided for free of cost. But It will
(Revenue Model) have some advertisement. In premium version there is no
advertisement and contains some additional features.

Table 3.1: Proposed Solution

11
3.4 PROBLEM SOLUTION FIT

To monitor daily spending more effectively and conveniently, "Personal Expense


Tracker Application" was created. User issues are resolved based on daily, monthly, and yearly
expenses, and if a limit is exceeded, an email will be issued to the user. Based on the daily,
monthly, and yearly expenses, describe the problem and the appropriate remedy.

Fig 3.5: Problem solution Fit

12
CHAPTER 4

REQUIREMENT ANALYSIS

4.1 FUNCTIONAL REQUIREMENTS

These are the requirements that the end user specifically demands as basic facilities
that the system should offer. All these functionalities need to be necessarily incorporated into the
system as a part of the contract. These are represented or stated in the form of input to be given
to the system, the operation performed and the output expected. They are basically the
requirements stated by the user which one can see directly in the final product, unlike the non-
functional requirements. Following are the functional requirements of the proposed solution.

FR No. Functional Requirement Sub Requirement (Story / Sub-Task)


(Epic)
FR-1 User Registration Registration through Gmail
Registration through Email Account

FR-2 Category This application shall allow users to add categories of


their expenses.

FR-3 Calendar Personal expense tracker application must allow user


to add the data to their expenses.

FR-4 Graphical Representation This application should graphically represent the


expense in the form of report.

FR-5 Report Generation Graphical representation of report should be


generated.

FR-6 Expense Limit Users can always set their monthly limit based on the
salary they earn.

FR-7 Alert Email If limit exceed then application will send alert email
to the user with expense

Table 4.1: Functional Requirements

13
4.2 NON-FUNCTIONAL REQUIREMENTS
These are basically the quality constraints that the system must satisfy according to
the project contract. The priority or extent to which these factors are implemented varies from
one project to other. They are also called non-behavioral requirements.

Following are the non-functional requirements of the proposed solution.

FR Non-Functional Description
No. Requirement
NFR-1 Usability Helps to keep an accurate record and track of
their income and expenses easily.

NFR-2 Security We save the password in the encrypted form


so it will add more secure to the application
user.
NFR-3 Reliability Each data record is stored on a well-built
efficient database schema. There is no risk of
data loss.
NFR-4 Performance Expense kinds include categories and an
option. The system's throughput is boosted
because to the lightweight database support.
NFR-5 Availability User can able to access the application with
the help of the internet throw the web browser.

NFR-6 Scalability The ability to appropriately handle increasing


demands.

Table 4.2: Non-Functional Requirements

14
CHAPTER 5

PROJECT DESIGN

5.1 DATA FLOW DIAGRAM

A Data Flow Diagram (DFD) is a traditional visual representation of the information


flows within a system. A neat and clear DFD can depict the right amount of the system
requirement graphically. It shows how data enters and leaves the system, what changes the
information, and where data is stored.

User information’s are considered as a data, it will be stored in IBM db2 cloud database
and flask framework is used to communicate with the cloud database to fetch the information for
the user.

Fig 5.1: Data Flow Diagram

15
5.2 SOLUTION & TECHNICAL ARCHITECTURE

Solution architecture is a complex process – with many sub-processes – that bridges


the gap between business problems and technology solutions. Its goals are to:

 Find the best tech solution to solve existing business problems.


 Describe the structure, characteristics, behavior, and other aspects of the
software to project stakeholders.
 Define features, development phases, and solution requirements.
 Provide specifications according to which the solution is defined, managed,
and delivered.

Fig 5.2: Solution Architecture

16
Technologies Used:

 IBM Cloud,
 HTML
 CSS
 JavaScript
 IBM Cloud Object Storage
 Python-Flask
 Kubernetes
 Docker
 IBM DB2
 IBM Container Registry
 SendGrid

Fig 5.3: Technical Architecture

17
5.3 USER STORIES

Use the below template to list all the user stories for the product. In software development and product
management, a user story is an informal, natural language description of features of a software system.
User Type Functional User User Story / Acceptanc Priority Release
Requirement Story Task e criteria
(Epic) Number
Customer Registration USN-1 As a user, I can I can access High Sprint-1
(Mobile register for the my account/
user) application dashboard
by
entering my
email,
password,
and confirming
my password.
Login USN-2 As a user, I can I can access High Sprint-1
register for the my
application account/dashb
through Gmail. oard.

Dashboard USN-3 As a user, I can I get all the Low Sprint-2


log into the info needed in
application by my dashboard.
entering email
& password.
Order creation USN-4 As a customer, I I can ask my Medium Sprint-2
can place my query
order with the
detailed
description of my
query.
Forgot password USN-5 As a customer, I I get access to High Sprint-3
can reset my my account
password by again
this option in
case I forgot my
old password.
Order details USN-6 As a Customer, I get better Medium Sprint-4
I can see the understanding
current stats of
order.

18
Agent Login USN-1 As an agent I can I can access Medium Sprint-3
(Web login to the my
user) application by account/dashb
entering correct oard
email and
password.

Table 5.1: User Stories

CHAPTER 6
19
PROJECT PLANNING & SCHEDULING
6.1 SPRINT PLANNING & ESTIMATION

Sprint planning is an event in scrum that kicks off the sprint. The purpose of sprint planning
is to define what can be delivered in the sprint and how that work will be achieved. Sprint planning
is done in collaboration with the whole scrum team.

Sprint Functional User User Story / Task Priority Team Members


Requireme Story
nt Numbe
(Epic r
)
Sprint-1 Homepage USN-1 As a user I can view
the index page to see Harshil
High
the about of the
Expense Tracker
Sprint-1 Registration USN-2 As a User, I need to
register user id and Gokulakrishnan
High
passcode for every
workers over there
in municipality
Sprint-1 Login USN-3 As a user, I need to
login with user id and High Aswin Raj
password to get in to
the website

Sprint-2 Dashboard USN-4 As a User, I will


follow Co-Admin’s Low Arun
instruction to reach Harshil
the filling bin in
short roots and save
time
Sprint-3 Add Expenses USN-5 As a User I will Medium
add my expense Aswin Raj
throughout the
month I spend on

Sprint-3 Total USN-6 As a User I can view


Expense my expense in a graph Medium Gokulakrishnan
Graph of overview of the Aswin Raj
expense I spend.

20
Sprint-4 Deployment USN-7 As a User I can
in cloud access the cloud to High Harshil
store my data of Gokulakrishnan
expense Aswin Raj
Arun

Table 6.1: Sprint Planning & Estimation

6.2 SPRINT DELIVERY SCHEDULE

Sprint Total Duratio Sprint Sprint Story Sprint


Story n Start Date End Date Points Release Date
Points (Planned) Complete (Actual)
d (as on
Planned
End Date)
Sprint-1 20 6 Days 23 Oct 2022 28 Oct 2022 20 29 Oct 2022
Sprint-2 20 6 Days 30 Oct 2022 04 Nov 2022 20 05 Nov 2022
Sprint-3 20 6 Days 06 Nov 2022 11 Nov 2022 20 12 Nov 2022
Sprint-4 20 6 Days 13 Nov 2022 18 Nov 2022 20 19 Nov 2022
Table 6.2: Sprint Delivery Schedule

6.3 REPORTS FROM JIRA

This graph denotes the whole spring planning and project development phase
completion report in the detailed manner by mentioning the date and levels in every phase of
development.

21
Fig 6.1

CHAPTER 7
22
CODING & SOLUTIONING

7.1 FEATURE 1
7.1.1 ADD EXPENSE
In the "Personal Expenses Tracker Application," we may enter daily, monthly, and

annual expenses to keep track of our spending and create a report that will help us avoid

overspending on things we don't need while also increasing our savings for the future.

The user will enter their expense information, including the date, name, category,

amount, and pay method, in this code. These specifics are kept in the IBM db2 cloud database as

information, and with the aid of the cloud database, we are able to keep a lot of user data.

DESIGN SCREENSHOT FOR ADD EXPENSE PAGE:

Fig 7.1: Add Expense

23
7.1.2 EXPENSE OVERALL REPORT
With the aid of user-entered expense data, the overall report will be generated in this
application. The application will use the user's input to calculate the daily, monthly, and yearly
expenses and display them in a graph format.

DESIGN SCREENSHOT FOR EXPENSE OVERALL REPORT PAGE:

Fig 7.2: Expense Overall Report

In “personal expenses tracker application” they will calculate the expenses and show it in
a graph manner structured view to the user. Every category of amount is calculated one by one in
the flask and it will fetch data from the cloud database to generate the overall report for the user.

7.2 FEATURE 2

24
7.2.1 SETTING LIMIT BASED ON MONTHLY BUDGET

Users can create their own limits in the "Personal Expenses Tracker Program" based on
their monthly budgets and receive alert emails from the application if the limits they have
entered are surpassed.

In this code, the limit.html page will be rendered first, after which the user can input their
monthly limit based on the monthly budget. To retain the information in the cloud database, the
entered amount is kept in the limit table. To retrieve the most recent amount put on the limit
page, it will select all the rows in the limits..

DESIGN SCREENSHOT FOR SETTING LIMIT BASED MONTHLY BUDGET PAGE:

Fig 7.3: Setting Limit Based on Monthly Budget

If the user entered limit is calculated by entering the add expense details. If it exceeds,
then email will send to the user with the expense’s notification message. The entered limit
amount will be shown in the limit.html page for the user.

25
7.2.2 SENDING ALERT EMAIL TO THE USER
Python, being a powerful language don’t need any external library to import and
offers a native library to send emails- “SMTP lib”. “Smtp lib” creates a Simple Mail Transfer
Protocol client session object which is used to send emails to any valid email id on the internet.
Flask-Mail is configured through the standard Flask config API. 
In “Personal Expenses Tracker Application”, if entered limit is exceed then SendGrid will
send the alert email to the user with expenses detail message and it automatically response to the
user by the help of SendGrid software.

7.3 DATABASE SCHEMA


7.3.1 SCREENSHOT OF REGISTER TABLE DATABASE SCHEMA

Fig 7.5: Regiter Table Database Schema

7.3.2 SCREENSHOT OF EXPENSE TABLE DATABASE SCHEMA

26
Fig 7.6: Expense Table Database Schema
7.3.3 SCREENSHOT OF LIMITS TABLE DATABASE SCHEMA

Fig 7.7: Limits Table Database Schema

27
CHAPTER 8
TESTING
8.1 TEST CASES
Software Testing Type is a classification of different testing activities into categories,
each having, a defined test objective, test strategy, and test deliverables. The goal of having a
testing type is to validate the Application under Test for the defined Test Objective.
For instance, the goal of Accessibility testing is to validate the AUT to be accessible
by disabled people. So, if your Software solution must be disabled friendly, you check it against
Accessibility Test Cases.
A test case is a set of actions performed on a system to determine if it satisfies software
requirements and functions correctly. The purpose of a test case is to determine if different
features within a system are performing as expected and to confirm that the system satisfies all
related standards, guidelines and customer requirements. The process of writing a test case can
also help reveal errors or defects within the system.

8.2 USER ACCEPTANCE TESTING


 User Acceptance Testing is a level of the software testing where a system is tested
for acceptability. The purpose of this test is to evaluate the system’s compliance
with the business requirements and assess whether it is acceptable for delivery.
 Formal testing with respect to user needs, requirements, and business processes
conducted to determine whether or not a system satisfies the acceptance criteria
and to enable the user, customers or other authorized entity to determine whether
or not to accept the system.
 User Acceptance Testing is a type of testing performed by the end user or the
client to verify/accept the software system before moving the software application
to the production environment. UAT is done in the final phase of testing after
functional, integration and system testing is done.
 It is probably the most important test phase of all as it is where we confirm that
the system is fit for purpose to the business stakeholders.
 In this Web application, the customer’s acceptance is been monitored and it is
been put into usage.

28
CHAPTER 9
RESULTS

Building a personal expenditure tracker to keep users' spending on a budget and track
their expenses. To ensure that money is spent properly on the items that are purchased, the user's
monthly expenses are tracked. Daily, monthly, and annual analyses are produced as pie charts.
The personal cost tracker includes every purchase that is made. A notification will be sent to the
user's Mail if the limit is exceeded. In the "Personal Expenses Tracker Application," if the
entered limit is exceeded, SendGrid will send the user an alert email with an explanation of the
expenses, and it will respond to the user automatically with the aid of SendGrid software.

PERFORMANCE METRICS

 The "Personal Expense Tracker Application" will enable organizations to evaluate their
own competitiveness using employee performance metrics. Instead of focusing on
specific workers, these metrics are typically used to evaluate the effectiveness of a
workforce as a whole.
 This feature figures out the revenue per FTE (full-time equivalent). This measure
provides a rough idea of how much money each employee makes. The rating is lower
when there are many employees and low revenue than when there are fewer employees
and high revenue. Additionally, this metric can be used to benchmark businesses.
 In the personal cost tracker, every purchase is recorded. A notification containing the
daily revenue and expense information that aids the application's tracking system will be
sent to the user's mailbox if the limit is surpassed. Managing the costs of our daily lives
and business operations depends heavily on expense tracking.
 An organization will benefit from expense tracking in several ways. that the stakeholders
in the expense processes can use. Any firm will be able to manage all of their spending
more effectively with the use of the expense tracker.

29
OUTPUT:

30
CHAPTER 10

ADVANTAGES & DISAVANTAGES

ADVANTAGES

 It is a User friendly application.


 Keeps track of daily expenses.
 Saving money for necessary expenses which will help to plan
future investment.
 Users can access their financial data from anywhere at any time via the Internet.
 It supports concurrent users at the same time.
 No Need to install any application.
 Remotely Accessible.
 It provides a user interface where the user could store and observe their past
expenses.
 Expenditure are accurately calculated.
DISADVANTAGES

 Works with internet only.


 It supports only manual entry, does not feature automatic
 expense tracking.

 Integration with third party applications are no supported

31
CHAPTER 11

CONCLUSION

The majority of the shortcomings of the old system have been mostly resolved by the
new one, which operates in accordance with the provided design specification. We have
designed a project that is more effective than existing income and expense trackers. The manual
calculation for determining the income and expense every month is successfully avoided by the
project. The modules are created in a way that is both effective and appealing. The created
systems eliminate the issue and satisfy the needs by giving accurate and thorough information.
The system has complied with every criterion that the user envisaged. The newly created system
uses less processing time and updates Any user may become accustomed to using the screen
because it is very user-friendly and offers online help messages. Modules are made to be very
adaptable, allowing for the simple addition of any failure requirements without encountering
many difficulties. The greatest businesses have a system for managing and tracking these
reimbursements. This best practice ensures that the expenses are recorded accurately and
promptly. When these expenses are paid on time and are properly tracked from a business
standpoint, your employees' morale will undoubtedly increase, and processes all the data
instantly.

32
CHAPTER 12

FUTURE SCOPE

 Automatically it will keep on sending notifications for our daily expenditure.

 In today’s busy and expensive life, we are in a great rush to make money, but at
the end of the month we broke off. As we are unknowingly spending money on
title and unwanted things. So, we have come over with the plan to follow our
profit.
 Provision to add different currencies will be added so that this application is not
just limited to INR but also can be used worldwide and the currency converters
will be designed and added in order to convert the different currency rates.
 When the user tries to add the same category or vendor to an expense/income
record, a duplicate alert will be presented showing the same category/vendor which
the user entered previously for some expense/income and then he can tap on it and
the entries will be automatically filled for the current record.
 A new tab named “Search” will be implemented so that if the user searches for any
vendor, category or subcategory by name, he can see the expenses made on that
particular search in a table view list with the total number of transactions made and
the total expense amount for that search.
 A comparison between the income made and expense will be shown graphically
providing the user more options to see what they are making and what they are
spending accordingly.
 A PDF feature would be implemented so that the user can see the total
expenses/incomes in a much simpler PDF format in one file.
 Based on expenses and savings made by the user rewards will be awarded.

33
CHAPTER 13

APPENDIX

13.1 SOURCE CODE

app.py

from flask import Flask, render_template, request,


redirect, session
import re
from flask_db2 import DB2
import ibm_db
import ibm_db_dbi
from sendemail import sendgridmail,sendmail

import os

app = Flask(__name__)

app.secret_key = 'a'

# app.config['DB2_DRIVER'] = '{IBM DB2 ODBC DRIVER}'


app.config['database'] = 'Bludb'
app.config['hostname'] = 'b0aebb68-94fa-46ec-a1fc-
1c999edb6187.c3n41cmd0nqnrk39u98g.databases.appdomain.cloud'
app.config['port'] = '31249'
app.config['protocol'] = 'TCPIP'
app.config['uid'] = 'wzj62416'
app.config['pwd'] = 'bBA6Inkb4mHbf6e0'
app.config['security'] = 'SSL'
try:
mysql = DB2(app)

conn_str='database=bludb;hostname=b0aebb68-94fa-46ec-
a1fc-
1c999edb6187.c3n41cmd0nqnrk39u98g.databases.appdomain.cloud;
port=31249;protocol=tcpip;\

uid=wzj62416;pwd=bBA6Inkb4mHbf6e0;security=SSL'

34
ibm_db_conn = ibm_db.connect(conn_str,'','')

print("Database connected without any error !!")


except:
print("IBM DB Connection error : " +
DB2.conn_errormsg())

#HOME--PAGE
@app.route("/home")
def home():
return render_template("homepage.html")

@app.route("/")
def add():
return render_template("home.html")

#SIGN--UP--OR--REGISTER

@app.route("/signup")
def signup():
return render_template("signup.html")

@app.route('/register', methods =['GET', 'POST'])


def register():
msg = ''
print("Break point1")
if request.method == 'POST' :
username = request.form['username']
email = request.form['email']
password = request.form['password']

print("Break point2" + "name: " + username +


"------" + email + "------" + password)

try:
print("Break point3")
connectionID = ibm_db_dbi.connect(conn_str,
'', '')

35
msg = 'You have successfully registered !'
return redirect("/login")
return render_template('signup.html', msg = msg)

#LOGIN--PAGE

@app.route("/signin")
def signin():
return render_template("login.html")

@app.route('/login',methods =['GET', 'POST'])


def login():
global userid
msg = ''
session['loggedin'] = True
session['id'] = dictionary["ID"]
userid = dictionary["ID"]
session['username'] = dictionary["USERNAME"]
session['email'] = dictionary["EMAIL"]

return redirect('/home')
else:
msg = 'Incorrect username / password !'

return render_template('login.html', msg = msg)

#ADDING----DATA

@app.route("/add")
def adding():
return render_template('add.html')

@app.route('/addexpense',methods=['GET', 'POST'])
def addexpense():

date = request.form['date']
expensename = request.form['expensename']
amount = request.form['amount']
paymode = request.form['paymode']
category = request.form['category']

36
print(date)
p1 = date[0:10]
p2 = date[11:13]
p3 = date[14:]
p4 = p1 + "-" + p2 + "." + p3 + ".00"
print(p4)

sql = "INSERT INTO expenses (userid, date,


expensename, amount, paymode, category) VALUES
(?, ?, ?, ?, ?, ?)"
stmt = ibm_db.prepare(ibm_db_conn, sql)
ibm_db.bind_param(stmt, 1, session['id'])
ibm_db.bind_param(stmt, 2, p4)
ibm_db.bind_param(stmt, 3, expensename)
ibm_db.bind_param(stmt, 4, amount)
ibm_db.bind_param(stmt, 5, paymode)
ibm_db.bind_param(stmt, 6, category)
ibm_db.execute(stmt)

print("Expenses added")
total=0

for x in expense:
total += x[4]

param = "SELECT id, limitss FROM limits WHERE userid


= " + str(session['id']) + " ORDER BY id DESC LIMIT 1"
res = ibm_db.exec_immediate(ibm_db_conn, param)
dictionary = ibm_db.fetch_assoc(res)
row = []
s = 0
while dictionary != False:
temp = []
temp.append(dictionary["LIMITSS"])
row.append(temp)
dictionary = ibm_db.fetch_assoc(res)
s = temp[0]

if int(total) > int(s):

37
msg = "Hello " + session['username'] + " , " +
"you have crossed the monthly limit of Rs. " + s + "/- !!!"
+ "\n" + "Thank you, " + "\n" + "Team Personal Expense
Tracker."
sendmail(msg,session['email'])

return redirect("/display")

#UPDATE---DATA

@app.route('/edit/<id>', methods = ['POST', 'GET' ])


def edit(id):

param = "SELECT * FROM expenses WHERE id = " + id


res = ibm_db.exec_immediate(ibm_db_conn, param)
dictionary = ibm_db.fetch_assoc(res)
row = []
while dictionary != False:
temp = []
temp.append(dictionary["ID"])
temp.append(dictionary["USERID"])
temp.append(dictionary["DATE"])
temp.append(dictionary["EXPENSENAME"])
temp.append(dictionary["AMOUNT"])
temp.append(dictionary["PAYMODE"])
temp.append(dictionary["CATEGORY"])
row.append(temp)
print(temp)
dictionary = ibm_db.fetch_assoc(res)

print(row[0])
return render_template('edit.html', expenses =
row[0])

@app.route('/update/<id>', methods = ['POST'])


def update(id):
if request.method == 'POST' :

date = request.form['date']

38
expensename = request.form['expensename']
amount = request.form['amount']
paymode = request.form['paymode']
category = request.form['category']

p1 = date[0:10]
p2 = date[11:13]
p3 = date[14:]
p4 = p1 + "-" + p2 + "." + p3 + ".00"

sql = "UPDATE expenses SET date = ? , expensename =


? , amount = ?, paymode = ?, category = ? WHERE id = ?"
stmt = ibm_db.prepare(ibm_db_conn, sql)
ibm_db.bind_param(stmt, 1, p4)
ibm_db.bind_param(stmt, 2, expensename)
ibm_db.bind_param(stmt, 3, amount)
ibm_db.bind_param(stmt, 4, paymode)
ibm_db.bind_param(stmt, 5, category)
ibm_db.bind_param(stmt, 6, id)
ibm_db.execute(stmt)

print('successfully updated')
return redirect("/display")

#limit
@app.route("/limit" )
def limit():
return redirect('/limitn')

@app.route("/limitnum" , methods = ['POST' ])


def limitnum():
if request.method == "POST":
number= request.form['number']

sql = "INSERT INTO limits (userid, limitss)


VALUES (?, ?)"
stmt = ibm_db.prepare(ibm_db_conn, sql)
ibm_db.bind_param(stmt, 1, session['id'])
ibm_db.bind_param(stmt, 2, number)
ibm_db.execute(stmt)

39
return redirect('/limitn')

@app.route("/limitn")
def limitn():

param = "SELECT id, limitss FROM limits WHERE userid


= " + str(session['id']) + " ORDER BY id DESC LIMIT 1"
res = ibm_db.exec_immediate(ibm_db_conn, param)

#REPORT

@app.route("/month")
def month():

while dictionary1 != False:


temp = []
temp.append(dictionary1["DT"])
temp.append(dictionary1["TOT"])
texpense.append(temp)
print(temp)
dictionary1 = ibm_db.fetch_assoc(res1)

param = "SELECT * FROM expenses WHERE userid = " +


str(session['id']) + " AND MONTH(date) = MONTH(current
timestamp) AND YEAR(date) = YEAR(current timestamp) ORDER BY
date DESC"
res = ibm_db.exec_immediate(ibm_db_conn, param)
dictionary = ibm_db.fetch_assoc(res)
expense = []
while dictionary != False:
temp = []
temp.append(dictionary["ID"])
temp.append(dictionary["USERID"])
temp.append(dictionary["DATE"])
temp.append(dictionary["EXPENSENAME"])
temp.append(dictionary["AMOUNT"])
temp.append(dictionary["PAYMODE"])
temp.append(dictionary["CATEGORY"])

40
expense.append(temp)
print(temp)
dictionary = ibm_db.fetch_assoc(res)

total=0
t_food=0
t_entertainment=0
t_business=0
t_rent=0
t_EMI=0
t_other=0
print(total)

print(t_food)
print(t_entertainment)
print(t_business)
print(t_rent)
print(t_EMI)
print(t_other)

return render_template("today.html", texpense =


texpense, expense = expense, total = total ,
t_food = t_food,t_entertainment = t_entertainment,
t_business = t_business, t_rent = t_rent,
t_EMI = t_EMI, t_other = t_other )

t_food = t_food,t_entertainment = t_entertainment,

t_business = t_business, t_rent = t_rent,


t_EMI = t_EMI, t_other = t_other )

#log-out

@app.route('/logout')

def logout():
session.pop('loggedin', None)
session.pop('id', None)
session.pop('username', None)

41
session.pop('email', None)
return render_template('home.html')

port = os.getenv('VCAP_APP_PORT', '8080')


if __name__ == "__main__":
app.secret_key = os.urandom(12)
app.run(debug=True, host='0.0.0.0', port=port)

Homepage.html

<style>

H1 {

position: relative;

right: -790PX;

top: -400PX;

color: RED;

p{

position: relative;

right: -800px;

top: -350px;

font-family:monospace;

span{

position: relative;

right: -800px;

top: -360px;

} .ccc {

42
position: relative;

top:80px;

left:-100px;

</style>

<div id=aa class="container">

<div class="ccc">

<img src="../static/images/images (13).jpeg">

<h1>LET START JOURNEY</h1>

<P>MyBudget web application helps<br> you to maintain


budget<br>

and analyse the expense</P>

<img height="13%" width="13%" style="position:


relative; top: -690PX; left: -60PX;"
src="../static/images/istockphoto-943300706-612x612.jpg">

</div>

<span class="btn btn-outline-dark">Let's Begin</span>

</div>

Signup.html

<html>

<head>

<meta charset="utf-8">

<title>Sign-up</title>

<link href="..\static\css\signup.css" rel="stylesheet">

43
<script
src="https://kit.fontawesome.com/a81368914c.js"></script>

<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstr
ap.min.css" integrity="sha384-
n5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm"
crossorigin="anonymous">

<p class="conditions" style="color:black"><br><input


class="check" type="checkbox" required>I read and agree to <a
href="#">Terms &amp; Conditions</a></p

<!--text-container-->

<div class="text-container">

<h1 style="color: #2d2c2c;font-family:cursive;">Glad to see


you</h1>

<div class="diag"><img class="fig1" width="80%" height="100%"


right=50% left="55%" style="position: relative;" src="static\
images\img9.jpg"></div>

<div class="para"> <b>Welcome</b>,Please Fill in the blanks


for sign up</div>

</div>

</div>

</body>

</html>

Login.html

<!DOCTYPE html>

<html>

<head>

    <title>Animated Login Form</title>

    <link rel="stylesheet" type="text/css" href="..\static\


css\login.css">

44
    <link href="https://fonts.googleapis.com/css?

                        <input type="email" name="email"


Placeholder="Email" class="input" required>                     

                        <input type="password" name="password"


placeholder="Password" class="input" required>

    <script type="text/javascript" src="login.js"></script>

</body>

</html>

Home.html

<!DOCTYPE html>

<html lang="en">

<head>

  <meta charset="UTF-8">

  <meta name="viewport" content="width=device-width, initial-


scale=1.0"> 

  <link rel="stylesheet" href="..\static\css\home.css">

  <title>My Budget</title>

</head>

<body>

            <h1><span>F</span>in <span>B</span>udget</h1>

          </a>

        </div>

            <li><a href="#hero"
data-after="Home">Home</a></li>

    </div>

  <section id="about">

45
</body>

</html>

Add.html

<style>

    body{

        overflow: hidden;

    }

</style>

<div class="container">

    <div class="row">

            <form action="/addexpense" method="POST">

                <div class="form-group">

                    <select class="form-control"
name="category" id="category"            </form>           

            <div  style="position: relative; left: 590px; top:


-460px;" class="imagge">

                <img width="120%" height="100%"


src="../static/images/expense.png" class="rounded

</div> 

Display.html

<div class="container ">

    <h3 class="mt-3">EXPENSES</h3>

{% if expense is defined %}

    {% for row in expense  %}

46
   <div style="text-align: center ; font-family: monospace;
color:red ; "><h5><a  href="/add"> ADD-DATA </a> to
Display</h3></div>

    <img  width=60% src="../static/images/no data found.png">

             </div>

        <div class="card shadow mb-2 bg-white rounded">

            <div class="card-body">

Edit.html:

<input type="hidden" class="form-control"   name="" value =


"{{expenses[6]}}" id="">               

                <div class="form-group">

             <script type="text/javascript">

                    var d = new
Date(value="{{expenses[1]}}" );

                    var elem =
document.getElementById("date");

                    elem.value = d.toISOString().slice(0,16);

                  </script>

             <div class="form-group">

                 </select>

</div>   

Base.html

<!DOCTYPE html>

<html lang="en">

<head>

    <link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/boots
trap.min.css"

47
integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0j
lfIDPvg6uqKI2xXr2" crossorigin="anonymous">

    <script
src="https://cdn.jsdelivr.net/npm/chart.js@3.2.1/dist/chart.min.j
s"></script>

    <title>Fin Budget</title>

</head>

<body>

  <nav class="navbar sticky-top  navbar-expand-lg navbar-


light" style="background-color: #000000;">

    <a style="color: #FFA62B; font-size: 25px;" class="navbar-


brand" href="#">Fin Budget</a>

      <span class="navbar-toggler-icon"></span>

    </button> 

  </a>

  </nav>

</body>

</html>

Month.html

<div class="container ">                                      

<div class="row">

                <div class="col-md-6">  AMOUNT   </div>

                 <div id="trent" class="col-md-6"> {{


t_rent }}  </div>

              </div>

         <div class="card shadow mb-2 bg

48
         display: true,

Sendemail.py

import os

from sendgrid import SendGridAPIClient

from sendgrid.helpers.mail import Mail

message = Mail(

from_email=os.environ.get('SENDER_EMAIL'),

to_emails='gokulakrishnana88@gmail.com,

subject='Sending with Twilio SendGrid is Fun',

html_content='<strong>and easy to do anywhere, even with


Python</strong>')try:

sg =
SendGridAPIClient(os.environ.get('SENDGRID_API_KEY'))

response = sg.send(message)

print(response.status_code)

print(response.body)

print(response.headers)

except Exception as e:

print(e)

Dockerfile.py

FROM python:3.10.4

WORKDIR /pet

COPY . /pet

RUN pip install -r requirements.txt

EXPOSE 5000 CMD

["python", "app.py"]

49
13.2 GITHUB & PROJECT DEMO LINK

GitHub - https://github.com/IBM-EPBL/IBM-Project-46783-1660759238

Project Demo link - https://shorturl.at/vxAW4

50
CHAPTER 14

REFERENCES
[1] Aman Garg,Mukul Goel ,Sagar Mittal, Mr. Shekhar Singh,”Expense tracker” ISSN: 2321-
9653; IC Value: 45.98; SJ Impact Factor: 7.429 Volume 9.
[2] Muskaan Sharma, Ayush Bansal, Dr. RajuRanjan, Shivam Sethi School of ComputerScience
and Engineering, Galgotias University “ANovel Expense Tracker using Statistical
Analysis” June 2021| IJIRT | Volume 8 Issue 1 | ISSN:2349-6002 IJIRT 151474
INTERNATIONALJOURNAL OF INNOVATIVE RESEARCH INTECHNOLOGY 154.
[3] “Expense Tracker” ATIYA KAZI1 , PRAPHULLA S. KHERADE2 , RAJ S. VILANKAR3
,PARAG M. SAWANT4 1 Professor, Department of Information Technology.
[4] “ExpenseTracker”Hrithik Gupta school of computer science and engineering(Galgotias
University)greaternoida ,uttar pradesh,India hrithik_gupta1.scsebtech@galgotiasuni
versity.edu.in Anant Prakash Singh school of computer science and engineering(Galgotias
University).
[5] “Intelligent Online Budget Tracker” Girish Bekaroo and Sameer Sunhaloo School of
Business Informatics and Software Engineering, University of Technology, Mauritius.
[6] “EXPENDITURE MANAGEMENT SYSTEM” Dr. V. Geetha, G. Nikhitha, H. Sri Lasya
Dr.C.K.Gomathy Assistant Professor, Dept. of CSE, SCSVMV
Kancheepuram ,TamilNadu, India.
[7] “Daily Expense Tracker” Shivam Mehra, Prabhat Parashar UG Student, Department of
Computer Science and Engineering HMR Institute of Technology and Management, Delhi,
India ISSN : 2320-9364
[8] “Expense Tracker Application” Velmurugan.R , Mrs.P.Usha PG Student, Department of
Computer Science, Dr.N.G.P Arts And Science College, IJIRT | Volume 7 Issue 10 | ISSN:
2349-6002.
[9] “Expense Manager Application” Velmurugan A, Albert Mayan J, Niranjana P and Richard
Francis ,Associate Professor, School of Computing, Sathyabama Institute of Science
and Technology.
[10] “Expense Tracker Prof” Miriam Thomas , Lekshmi P , and Dr. Mahalekshmi T, Sree
Narayana Institute of Technology , Kollam, Kerala ISSN 2581-9429.

51

You might also like