How to record my cash flow.

I need to a solution  to record my usually cash flow so I can analyze the cash flow of my ordinary usage of my money. So how can I collect my statistics of my cash flow. Luckily I have the skill to program so I can collect the data by setup several program or website.


Collecting the flow

First I should collect the usage of money in my everyday life. So I should have setup a program to conveniently submit my everyday using cash. So a method to submit the data easily in many clients is to setup an API in a server and submit the data by the url. For example https://www.example.com/cash_flow/1/food/ would record the 1 Yuan deal for food. So I should set an API in my server. The first thing comes to my mind the the Python which I am studying recently.

Writing the code

Because the service is very tiny which wouldn’t to very sophisticated so the micro-framework Flask is my best choice. So I write the code without much effort.


Adding an authorization

Although the service is very tiny and no users except me well know it.  So I decide to add a very simple auth method. The OAuth 2 is too big and complex to set up. And we don’t need much to protect the data. A basic Auth is a good idea.

Deploying

So We should deploy the code in my machine. And I want to deploy the code by using the docker. So we need to docker to deploy the my app efficiently.

The first problem is that there is a WordPress blogger in my server and I want to run the docker alongside the WordPress blogger but app in the docker can’t connect to the outer mysql so I should think a way to run the docker which can connect to the mysql easily.

A idea is to connect the container to the host or we can containerize the Mariadb so other container can connect to the database. As to improve my skills of using Docker. The choice to containerize all my services may be a hard but beneficial choice. The detail of upgrading to docker will be introduced by another article.

Conclusion

Ok I have the API to submit my cash flow to upgrade. It can meet my demand to log my cash flow. What I need to do now is to deploy the Docker.