Mbeca (pronounced as 'besha') means "money" and Ciaku (pronounced as 'shiaku') means "mine" in Kikuyu, one of the venacular languages in Kenya. Put together, you get "My money". This project is aimed at helping a user to visualize his money.
- Overview
- Features
- Tools Used
- Deployed Application
- Contributors
- Testing The Application Locally
- Areas of improvement
For many years, I have used Google Sheets to record how my money comes in and goes out. At the end of each day, preferably at night, I consistently update this file with the current state of my money.
It works well, but it is quite cumbersome to use over a long period of time. For example, I have to manually create the table structures occassionally. I also have to manually add the formulas to generate a chart of my income and expenses. The data is good, but if you cannot visualize it, then it is hard to know what is going on.
Besides detailed budget, income and expenses data, I wanted to have a summary of the health status of my money. I would compare my expenses to my budget and see if I was spending too much. Of course, expenses are made possible by my income. This cashflow is what can enable one to buy an asset and experience freedom or live a liability-filled life.
Mbeca Ciaku is an attempt to create an easier solution to this small problem. Besides simplicity, I wanted to make an application that would be usable by multiple other people. These users can download their data for offline analysis. The downloaded data would be organized and encrypted in a PDF file.
Inspired by MPesa, I found the encryption process of personal data very interesting. This feature is really useful in the quest to guard against the rampant MPesa fraud cases. If you are an active MPesa user, sometimes you would like to refer to your transactions to settle a dispute, confirm a payment, or to make a complaint. Whatever the case, Safaricom allows you to easily request for a copy of your transaction data for free. The statement would be sent to you via email. This file is encrypted and can only be accessed by you. At the time of this writing, decrypting the file is dependant on the user providing their National ID number plus a one-time numeric token sent to their phone. The decryption format is "ID-token".
- Password-based user authentication
- Two-factor authentication
- Email notification
- Interactive tables with search, sort and pagination functionality
- Download of user data as PDF file
- Encryption of downloaded PDF file
- Tests
- Custom support dashboard
- Dynamic charts
- Flask (Python framework)
- Flask Bootstrap for styling and cross-browser responsive design
- Flask-WTF for form validation
- Flask-Login for user authentication
- Flask-Mail for email notification
- Flask-SQLAlchemy for database management
- Flask-Migrate for database migrations
- PyFPDF for PDF generation
- PyPDF2 for PDF encryption
- Unittest for unit testing
- ChartJS for data visualization
- [] Twilio Verify API for SMS verification
- Mbeca Ciaku on Heroku
-
Clone the repository
$ git clone git@github.com:GitauHarrison/mbeca-ciaku.git
-
Change to the repository directory
$ cd mbeca-ciaku
-
Create and activate a virtual environment
$ virtualenv venv $ source venv/bin/activate # OR using virtualenvwrapper $ mkvirtualenv mbeca-ciaku
-
Install dependencies
(mbeca-ciaku)$ pip3 install -r requirements.txt
-
Create
.envfile in the root directory to store all needed environment variables(mbeca-ciaku)$ touch .env
-
Update
.envfile with the variables seen in.env-templatefile in the repository root directory# Example .env-template file SECRET_KEY= PDF_FOLDER_PATH= QUESTIONS_PER_PAGE=
Note on how to generate a random string for the
SECRET_KEYvariable:# On terminal $ python -c "import os; print(os.urandom(24))" # Output: b'\xc5\xdd\xb3s\xab<\xcc;h$>\x83f>e$\x03\xb8\xc8\xd1\xce\tZ\xd1' # Or (mbeca-ciaku)$ python -c 'import secrets; print(secrets.token_hex(16))' # Output: ff4fcb6dc2243c5050677dca63c05112 # Or # Get password from https://www.grc.com/passwords.htm
-
Run the application
(mbeca-ciaku)$ flask run
-
Paste the localhost URL http://127.0.0.1:5000 into your browser. You should be able to see the application.
-
Run the tests
(mbeca-ciaku)$ python3 -m tests.py
- User interface design
- Proper display of multiple graphs on specific charts (based on data years)
- Disabling of the Edit link in the help page after a specified duration
- Automatic email notifications to remind users to update their data


