Giter Site home page Giter Site logo

masudur-rahman / expense-tracker-bot Goto Github PK

View Code? Open in Web Editor NEW
9.0 2.0 0.0 41.32 MB

Telegram Bot for Tracking daily transactions

License: Apache License 2.0

Go 84.58% Makefile 10.83% Shell 2.19% Dockerfile 0.39% HTML 2.02%
back4app go telegram-bot golang telegram-bots telegrambot telegrambots telegram

expense-tracker-bot's Introduction

Expense Tracker

A Telegram Bot to track your expenses.
Expense Tracker Bot is a Telegram Bot to track your daily transactions.

Features

  • Expense Tracking: Keep track of your daily expenses, income, and balance transfers between accounts.
  • Flexible Input: Add transactions interactively by selecting options or simply send a text describing your transaction.
  • Lending and Borrowing: Track lendings and borrowings with other individuals.
  • Transaction Summary: Retrieve transaction summaries based on type, category, or subcategory for your preferred duration.
  • Transaction Reports: Generate transaction reports in PDF format for your chosen duration.

Usage

The Expense Tracker Bot is now available for public use.
To use this bot, go to Telegram and search for @XpenseTrackerBot

Once you are inside the bot inbox, press Start button to start using the Tracker Bot.

Before you start tracking your expenses

  • Add accounts like cash, brac, ebl etc
    • Command /new => Account => Type (Cash or Bank)
    • Reply with account details (cash "Cash in Hand", ebl EBL etc)
  • Add some debtors/creditors with whom you are financially involved
    • Command /new => DebtorsCreditors
    • Reply with the person details (john "John Doe" [email protected])

Track your Transactions

Interactively

To track your transactions interactively, send /newtxn command and follow the on-display suggestions.

Regular Text Message

You also can add new transaction by sending a regular text message.
You just need to mention

  • what you did
  • how much did it cost
  • when you did it
  • affected accounts
  • affected persons in case of loan/borrow
  • remarks

and the bot will take care of the rest

Obviously you need to follow some rules while adding transactions via text messages.

Message needs to be in key/value pairs, like:

  • {action} {amount}
  • for {txn subcategory} // the subcategory must match the allowed subcategory
  • {from/to} {account} // default cash
  • {from/to} {debtor/creditor} // in case of lending/borrowing
  • on {date} // "DD-MM-YYY", "YYYY-MM-DD", "MMM DD, YYYY", today, tomorrow, yesterday [default today]
  • at {time} // midnight, morning, noon, afternoon, evening, night and also different time formats [default now]
  • note {remarks}

These key/value pairs can appear in any order

Some example text for adding a new transaction:

- transferred 2000 from brac to dbbl on 2020-01-01 note "Bill payment"
- spent 1000 for food-rest on "Jan 13, 2013" from dbbl note "Lunch"
- earn 5000 to brac on 20-01-2023 note "Salary"
- borrow 1000 from user to brac on 2020-01-01
- return 1000 to user from brac on 2020-01-01
- lend 1000 to user from brac on 2020-01-01
- recover 1000 from user to brac on 2020-01-01
Expand to see the Allowed Transaction Subcategory list
Food (food):
- Restaurants (food-rest)
- Groceries (food-groc)
- Takeout (food-take)
- Snacks (food-snack)
- Fruits (food-fruit)
- Beverages (food-bev)

Housing (house):
- Rent (house-rent)
- Utilities (house-util)
- Furniture (house-furn)
- Electronics (house-elec)
- Real State (house-real)

Entertainment (ent):
- Movies (ent-movie)
- Subscription (ent-sub)
- Recreation (ent-rec)
- Books (ent-books)

Personal Care (pc):
- Salon (pc-salon)
- Toiletries (pc-toilet)
- Gym (pc-gym)
- Clothing (pc-cloth)
- Health (pc-health)
- Medicine (pc-med)

Travel (trv):
- Accommodation (trv-accom)
- Dining (trv-dine)
- Sightseeing (trv-sight)
- Transportation (trv-trans)
- Gifts (trv-gift)

Financial (fin):
- Salary (fin-sal)
- Deposit (fin-deposit)
- Withdraw (fin-with)
- DPS (fin-dps)
- Credit Card Payment (fin-ccpay)
- Bank Transfer (fin-bank)
- Loan (fin-loan)
- Loan Recovery (fin-recover)
- Borrow (fin-borrow)
- Borrow Return (fin-return)
- Tax (fin-tax)
- Charges (fin-charge)
- Mobile Recharge (fin-flexi)

Miscellaneous (misc):
- Initial Amount (misc-init)
- Giveaway (misc-give)
- Miscellaneous (misc-misc)

You always can send /cat command to list the subcategory

Available commands:

  • /new - Add new Transaction, Account or User
    • DebtorsCreditors - Add new debtor or creditors
    • Account - Add new account (Cash, Bank)
      • i.e: brac "BRAC Bank"
      • i.e: cash "Cash in Hand"
  • /newtxn - Add new transaction
    • Add a new transaction through a series of callback queries.
  • /users - List users
    • list all the persons involved in some loan/borrow with the system user
  • /balance - List Account Balance
    • list all the registered accounts and their balance
  • /expense - Fetch Expense of Current month
    • list transactions of current month
  • /summary - Transaction summary of current month
    • list transaction summary of current month
  • /allsummary - Transaction summary based on Type, Category, Subcategory
    • list transaction summary based on Type, Category, Subcategory
    • with a duration query parameter
  • /report - Transaction Report
    • list transaction report
    • with a duration query parameter
  • /cat - List Transaction categories
    • list all the registered categories
    • by selecting a category, list all the registered subcategories of that category
  • /help - Show Usage page

Live Demonstration

expense-tracker-quickstart.mp4

Future Work

A list of possible future work:

  • Add support for undoing a transaction
  • Add Database backup and restore support
  • Add support for multiple users

Self Hosting

If you want to host your own Expense Tracker Bot, refer to the self-hosting doc page.

Contacts

Telegram - masudur-rahman.

expense-tracker-bot's People

Contributors

masudur-rahman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

expense-tracker-bot's Issues

Revert last transaction

Sometimes a mistake could be made.
So, there should be an option to revert the last transaction.

Backup database

Occasionally backup database

  • with a telegram command (return db.sql as msg response)
  • in a particular interval (write to google drive)

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.