Giter Club home page Giter Club logo

chitie's Introduction

🤖chitie

Chitie stands for chi tiết & chi tiêu in Vietnamese it means detail on your expenses.

This is a bot for the Telegram messaging app using their bot platform. It helps you to keep track of your expenses, supporting your financial planning. It is simple, like sending a message to a friend on Telegram. No extra application is installed, but it can work on multiple platforms, desktops, and mobiles (like Telegram 😊)

Your data is secured on your server, which is very flexible as you can write your SQL to build reports.

# View demo

Build with

  • Flask
  • Vue.js
  • Postgres
  • Telegram

Setup on your server

Prerequisites

To host this bot on your own, you need a few things.

  • Server to run the bot on 1
  • A domain name with HTTPS enabled 2
  • A bot token, which you get from registering a new bot to the @BotFather

On your server:

  • Python3
  • PostgreSQL
  • Nginx

Configuration

Link your domain to the bot

Once you have chosen a bot, send the /setdomain command to @Botfather to link your website's domain to the bot. Then configure your widget below and embed the code on your website.

Set following environment variable on the running application session, or create an .env file in the root directory of the application

Property Example Description
DB_URL postgresql://user:password@localhost:5432/chitie PostgreSQL connection url
SECRET_KEY complex-random-string A secret key that will be used for securely signing the session cookie and can be used for any other security related needs by extensions or your application
SERVER_NAME chitie.yourdomain Your web domain
TELEGRAM_SECRET telegram-secret-string The secret string gotten from @BotFather when create new bot
TELEGRAM_WEBHOOK_SECRET some-secret-string To generate a secure url for webhook endpoint

Initial setup

Install dependencies

pip install -e '.[production]'

Init database schema

alembic upgrade head

Run application

uwsgi --enable-threads --socket 0.0.0.0:5000 --protocol http -w wsgi:webserver

Usage

Expense loggin

Send a message in the configured group with the format.

<expense subject: string> <amount: float><transaction_type:enum(‘’, ‘c’)>

There are two types of transactions – debit & credit. In a logging message, if the transaction type is empty, the default value is debit, and if the amount pattern is followed with a c letter, the transaction type is credit.

Example:

Debit expense:

Debit expense

Credit expense:

Credit expense

Commands

Command Description
/category List all categories
/review <month-year> Summary all expenses in the given time range. The default time range is the current month if not given

Demo

Init the expense chat group

Init the expense chat group

Logging your expenses by sending a message

Logging your expenses by sending a message

Review your expense in month

Review your expense in month

References

Footnotes

  1. I use Digital Ocean with $6/

  2. I use free SSL of Cloudflare

chitie's People

Stargazers

Nguyen Vu Loc avatar Minh Pham avatar Tuấn Nguyễn avatar Giau. Tran Minh avatar Tien Dao avatar Dat. Ba Dao avatar

Watchers

Nguyen Vu Loc 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.