Features
Highlight features already realized by the app:
- Expense income logging by text in Telegram
- Multi-user support - more people can log the expenses and they are all organized in same database
- Spreadsheet enables you overview to see expense/income flows by category
- Spreadsheet enables you overview to see expense/income flows by month
- Custom dynamic categories can be entered - 16 expense - 10 income
- Monthly report in chat
- Monthly reocuuring expenses can be added to be automated
Planned improvments
Planned improvments (additional features to come):
- Your year in finance
- Additional weekly/monthly insights
- Weekly report
Introduction
Expense tracking these days is quite complex because of:
- Different income sources
- Different payment methods
- Single person often has more credit/debit cards in addition to paying by cash
Expense income tracking apps exist but they have downsides:
- Cannot connect to all services
- Tracking cash payments is still manual
- Do we need another app on the phone
For Millennial, Gen Z and younger generations, very natural input to smart devices is text messaging. With that in mind I designed an application that lives completely free in your google account (if you’re willing to pay the data toll to our friendly neighbourhood tech giant).
Final result
At the end we will end up with telegram chat where we can input our expenses and earnings. All expenses will be in google sheets where they will be automatically sorted monthly by category.


Architecture overview

Frontend of our app will be Telegram - a well known messaging application - very similar to Viber and Whatsapp. Major differentiation of Telegram is that it has great “Bot support” and it is very easy to configure Bot to send data to some webhook.
Some webhook in our case will be Google App Script Web App. One of the applications in Google suite is Google App Script. If you don’t know it yet, this is an app which enables you to simply put JavaScript code to communicate with your documents. AppScript will intercept our messages from Telegram, check the correct format, and put them into a form for spreadsheets. At last it will append the data to the spreadsheet. Our spreadsheet will then further organise data by months and categories.
Deployment guide
Google sheets
Google sheets part is easy - just open this document and copy it to your google account.
Google Sheets Template
Google sheets
Google sheets part is easy - just open this document and copy it to your google account.
Telegram Bot
Setup Telegram to your phone number - setup is pretty seamless. First verify your phone number to activate your account.
- Open telegram on your PC through this link: Telegram Web
- Open chat with @BotFather see screenshot below:
- In chat write /newbot and follow instructions
- The API key should now be shown at this point - you will need it - now proceed to next steps and leave the chat open.
AppScript
I have developed an AppScript script that handles communication between Telegram text input and google sheets. You can find the whole code here on Github: Github repository
- Go to Google App Script logged into your google account: App Script
- Create a new Project
-
Rename Project
- Copy the code from Git to the new project - file Code.gs
-
Now populate the initial variables:
- Telegram API key
-
ssID (Spread sheet ID) - this is in the part of Google spreadsheet URL
- AdminID (TelegramID - you can find it by going into your telegram account and write /start to @userinfobot)
- At last webAppUrl - we don't have it yet - proceed to the next step to get it
- Now save your project
-
Deploy the project - find Deploy button and select New Deployment
-
Select Type of deployment - Web App. Type a description of your deployment - and set the settings like on the picture below - and click deploy
-
After clicking deploy you will have to authorise the app for permissions on your google account to edit the sheets etc. - you will have to click advanced - and then follow further
-
After successfully authorising the app - Web App URL will be given - this is the url where Telegram sends messages. You will have to copy it and follow back to step 5 of setting google app script.
- Run function setWebbook to setup where Telegram bot sends the messages:
A log should open at the bottom and it should be something like this (my webhook was already set in this case so the output is a bit different)
- Additionally run function sheetPermisions function to authorize script to get access to the google sheet.
- Setting up daily trigger to check if there are any monthly reocuuring expenses (in the worksl)
Post deployment
Open telegram chat with the bot you created and write HELP. It should look something like this.

Configuration
In Google sheets open Categories and configure your custom categories. For now app supports 16 expense and 10 income categories. This is only limited by Spreadsheet template I made.
