Git Product home page Git Product logo

personal-budget-tracker's Introduction

Overview

This repository contains code to run your own personal monthly spending tracking sheet. We will use a service called Plaid to securely connect to banks and credit card websites to download transactions.

Sub-system layout

There are 3 main sub-systems in this repo.

  1. Python Flask-based api server under the /api directoryy
  2. React JS web app under the connect-plaid-once directory
  3. streamlit web app user the /scripts directory

Instructions

You will connect your financial accounts only once. This will download all your transactions and store them in a local database. You will then use the data visualization app to view your spending.

  1. Start the backend server using this command flask run from the api directory
  2. Start the frontend web app using this command npm start from the connect-plaid-once directory

  1. Click the 'Connect with Plaid' button and follow the instructions to connect your accounts.
  2. Once you have connected your accounts, you can stop the backend server and the frontend web app. You will not need them again.

  1. Now that we have an access token, we can download all transactions from the connected accounts. Run the scripts/fetch_transactions.py --start_date=YYYY-MM-DD script to download all transactions from the given date. Check the instance folder for the database file called prod.db. This is where the transactions are stored.
  2. You can now use the data visualization app to view your spending. Start the data visualization app using this command streamlit run scripts/streamlit_app.py from the top-level directory.

Keeping the database up-to-date

To keep the transactions table up to date, run the scripts/fetch_transactions.py periodically. You can run this script from a cron job or a scheduled task. For eg. you may want to run the script every day at 2am.

python scripts/fetch_transactions.py --start_date=<yesterday>

Running the backend server in development/sandbox mode

Prerequisites

Create an .envrc file at the top-level and add these two lines

export PLAID_CLIENT_ID=[XXX]
export PLAID_SECRET=[YYY]

Replace XXX and YYY with your Plaid API credentials which you can get here

These environment variables need to be loaded into your shell before you start the server. You can do this by running source .envrc from the top-level directory. Alternately, if you use direnv, you can run direnv allow from the top-level directory, which will automatically load the environment variables into your shell when you cd into the directory.

cd api
pip install -r requirements.txt
flask --debug run

personal-budget-tracker's People

Contributors

ruravi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.