This post is part of a series on a project I am doing to build banking architecture.
This weekend I finally managed to get around to doing more development work on the banking project. The tasks I decided to tackle was to finish implementing the server calls into the iOS application.
I am pleased to announce that the project is now live for the most alpha of alpha testing. You can download the application here. Read on for the breakdown of the application and server installation.
The functionality implemented into the iOS app is broadly the following:
- Tabbed controller
- Listing of accounts
- Payment to a selected account
- Deposit into your own account
- Retrieval of your own account’s data
Currently alerts are used for a visual notification of actions (payments and deposits), and crashes are handled not so well.
The main accounts controller was replaced with a tabbed one. There are currently three tabs available: account, payments, deposits. These all link to single views which are shown on click of the icon.
Listing of accounts
This list was implemented in the last work done on the system. The call returns all accounts on the system in JSON format. In order to implement this in iOS I tried to do it the correct way, having a data source, a table list view, and a content type.
The content type is
recipient which just holds all of the information in the
accounts table. The data source is a function which does a server call and
parses the data into a collection of
recipients. This currently does no caching, local data storage, or anything fancy. The aim was to get the implementation
done and improve later.
This data source is then linked to a
TableView which automatically iterates through the items. I added a
didSelectRowAtIndexPath action that stores the selected account information
(account holder name and account number) and then shows the payment view. This information is then used when making payments.
Payment to a selected account
Once the account is selected from the previous view, this information is used to display the payment recipient, and in the TCP call to the server. This is a simple TCP call,
and with the abstraction of the
TCPClient class is easy to implement.
Deposit into your own account
A separate view was created for the deposit. This simple view allows a user to input a number up to 100 for deposit into their own account. There is no restriction in the amount of times this call can be made. The aim is to test the system and build an ecosystem.
Retrieval of your own account’s data
Every time the account landing page is viewed, a call is done to retrieve account data. This updates the balance. A user may also click a button which manually updates the account information.
Improvements on the iOS app
This is a long list. A few of the immediate improvements:
- Use a generic class for handling responses from the server
- Implement TLS
- Crash less, handle more cases
- Show a transactions list
- Use push
- Implement search
- Implement design
As an alpha POC, the application serves its purpose and I am super stoked to be able to use this on a server. The list above includes some critical implementations and features, but right now the basic payments functionality is working beautifully (edge cases aside).
Banking server installation
After having to reset the MySQL root password (I can’t tell you how many times I’ve had to do this), I created the table and user. I then updated the config file and started running the MySQL scripts one by one. A shell script could be handy here, eventually implementing a real migrations strategy is ideal.
I came across a few problems during the installation:
- I needed to install two packages (uuid and redis)
- The redis package failed to install, so I ended up copying my local version (available here, just untar into the
- Redis server needs to be installed, running, and config updated in config.json
I then ran the server:
nohup ./bank --mode=serverNoTLS &
Once the app does TLS connections, the mode will be changed to default TLS.
At this stage, everyone is happy. The app works, I can sign up, log in, see my balance, see accounts on the system, make payments, make deposits. Success.
Nice big strides made this weekend, the project can now be used by people other than myself. So, please download the app, create an account and make some payments/deposits. If you have feedback, please create an issue or get in touch with me.
For the next steps in this project, I will probably do a quick web user interface, and maybe some of the more mundane (but necessary) like writing tests. I’m slowly getting closer to the broader goal: building the bank side of finance, like making loans, trading, and capital management. This will include implementation of regulations.