Skip to content

Harris-A-Khan/MyDollarBot-BOTGo

 
 

Repository files navigation

💰 TrackMyDollar V3.0 - Budget On The Go(BOTGo) 💰


Expense tracking made easy!


MIT license Platform GitHub GitHub contributors DOI Build Status codecov GitHub issues GitHub closed issues

Fork


About TrackMyDollar

TrackMyDollar is an easy-to-use Telegram Bot that assists you in recording your daily expenses on a local system without any hassle With simple commands, this bot allows you to:

  • Add/Record a new spending

  • Show the sum of your expenditure for the current day/month

  • Display your spending history

  • Clear/Erase all your records

  • Edit/Change any spending details if you wish to

What's new?

  • New Web Client: Added an intutive web client for the telegram bot which contains functionality to view the budget, update the budget, delete the budget, add a spending record, add a recurring spending record and manage categories

  • Reformat the run.sh script into an install script and run script

  • Fixed failing Pytests and fixed importing bug

  • Created a GUI page that shows all the budget information at once

  • Created API endpoints for all functions

  • Create a telegram functionality that opens the GUI webpage

  • Created react front end app that calls the flask app serving the api endpoint

  • Includes a web page or function for:

    budget view with per category view
    budget update (with per category update
    budget delete with per category delete
    add a new spending record
    add a recurring spending record
    edit spending
    add new category
    delete new category
    show all custom categories

What more can be done?

Please refer to the issue list available here to see what more can be done to make MyDollarBot better. Please refer to the MyDollarBot project present here to have a look at the tasks to be done, tasks currently in progress and tasks already done.

Additionally, there is still some functionality needed to be added in the web client including display the sum of the monthly expenditure, estimate the expenditure for the next month, delete/erase all records. Deployment so the Web Client doesn't only run locally is also a future task (potentially deploy the app to Google Cloud Platform and having a continious integration solution).

Demo

Project.2.mp4

About MyDollarBot's web client

Web-based GUI: This feature represents an interface upgrade from a Telegram bot, which previously have handled user inputs for budget management through text commands, to a more intuitive web-based platform. The web GUI allows for easier navigation, more complex interactions, and a better visual representation of the user's budget data.

Prerequistis:

  • Telegram Bot: The Telegram bot must be operational before users can access the web GUI. This bot is the primary tool for notifications and quick commands or queries about the budget status.

  • Installation & Setup: Users need to follow specific installation instructions to get the bot running. This process involves setting up a Telegram bot account, configuring it to work with the user's budget program, and ensuring it's live and capable of receiving commands. Additionally the user has to run the backend Flask API file and the frontend React. Details for this is listed below.

Location of Code for this Feature

The location of the frontend components is in the frontend folder in the project

The location of the backend pages is in the backend folder in the project

Run Instructions

How to run the Web Client BackEnd

  1. Access Project Directory:

    • Open your command line and navigate to your project's home directory using cd /path/to/your/MyDollarBot-BOTGo.
  2. Verify Python Installation:

    • Ensure Python is installed by running python --version or python3 --version. If not, install it from the official site.
  3. Install Dependencies:

    • In the project directory, run pip install -r requirements.txt to install any necessary Python dependencies.
  4. Run the Application:

    • Start your application with python ./backend/src/api.py, replacing python with python3 or python<version> if needed.

    • Ensure the telegram bot is also running, README.md contains this information

How to run the Web Client FrontEnd

  1. Node.js Installation:

    • Begin by installing Node.js, a prerequisite for managing the application's dependencies. Access the official download page, choose the suitable version for your system, and follow the installation guide.
  2. Backend and Telegram Bot Setup:

    • Ensure your backend server is active and the Telegram bot is functional, as these components are crucial for the system's full capabilities. The README.md file in your project's main directory contains specific instructions for this setup.
  3. Navigating to the Frontend Directory:

    • Ensure you are in the home directory of the project /path/to/your/MyDollarBot-BOTGo

    • Using the command line, change your current directory by running cd frontend/mydollarbot-frontend, positioning you in the frontend folder of your project for the subsequent steps.

  4. Yarn Installation and Setup:

    • With Node.js installed, execute npm install yarn in the 'mydollarbot-frontend' directory to install Yarn, an efficient package manager.
  5. Dependency Installation:

    • Run the command yarn install within the directory. This command scrutinizes the package.json file and installs the required dependencies for the frontend application.
  6. Launching the Development Server:

    • Initiate the local development server by executing yarn dev. This command allows for local testing and development of the application.
  7. Accessing the Web Interface via Telegram:

    • Finally, interact with your Telegram bot and use the '/web' command. This action should provide a URL to your locally hosted application, typically accessible at http:https://localhost:5173, allowing you to engage with the web-based interface directly.

Telegram Bot Installation guide

The below instructions can be followed in order to set-up this bot at your end in a span of few minutes! Let's get started:

  1. Clone this repository to your local system.

  2. Start a terminal session in the directory where the project has been cloned. Run the following command to install the required dependencies:

  pip install -r requirements.txt
  1. In Telegram, search for "BotFather". Click on "Start", and enter the following command:
  /newbot

Follow the instructions on screen and choose a name for your bot. After this, select a username for your bot that ends with "bot".

  1. BotFather will now confirm the creation of your bot and provide a TOKEN to access the HTTP API - copy and save this token for future use.

  2. In the directory where this repo has been cloned, please run the below command to execute a bash script to run the Telegram Bot:

   ./run.sh

(OR)

   bash run.sh

Please note that it will ask you to paste the API token you received from Telegram in step 4. A successful run will generate a message on your terminal that says "TeleBot: Started polling."

  1. In the Telegram app, search for your newly created bot by entering the username and open the same. Now, on Telegram, enter the "/start" or "/menu" command, and you are all set to track your expenses!

Testing

We use pytest to perform testing on all unit tests together. The command needs to be run from the home directory of the project. The command is:

python run -m pytest test/

Code Coverage

Code coverage is part of the build. Every time new code is pushed to the repository, the build is run, and along with it, code coverage is computed. This can be viewed by selecting the build, and then choosing the codecov pop-up on hover.

Locally, we use the coverage package in python for code coverage. The commands to check code coverage in python are as follows:

coverage run -m pytest test/
coverage report

Notes:

You can download and install the Telegram desktop application for your system from the following site: https://desktop.telegram.org/


Title:'Track My Dollar'

Version: '3.1'

Description: 'An easy to use Telegram Bot to track everyday expenses'

Authors(Iteration 4):'Sanjit, Arul, Harris, Sarvesh'

Authors(Iteration 3):'Vraj, Alex, Leo, Prithvish, Seeya'

Authors(Iteration 2):'Athithya, Subramanian, Ashok, Zunaid, Rithik'

Authors(Iteration 1):'Dev, Prakruthi, Radhika, Rohan, Sunidhi'

About

CSC 510 Project Repository for Group 8

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 80.5%
  • JavaScript 9.3%
  • TypeScript 7.1%
  • CSS 1.2%
  • HTML 1.1%
  • Shell 0.8%