Monday, November 16, 2015

Microsoft Open Tech and Mifos X

There being just over a month for Christmas, it's time to write about one of most rewarding Mifos X related projects, not only for SanJose Solutions but also the entire Mifos community. The second quarter of 2015 has proved to be a landmark time in our involvement in making Mifos X far more widespread and easier to install and setup as well as helping programmers and contributors to Mifos X get kick-started quickly. I recall an email I received from Paul Lor of AFSC, who had been trying, in vain to setup an instance of Mifos X on MS Azure. Like our earlier Mifos X Packaging Project last year, we agreed to nosedive into another adventure to reliably package Mifos X on multiple platforms. Like Paul, many people have been wanting to deploy Mifos X quickly and effectively but found themselves confronted with a lack of support for cloud instances, except Amazon AWS. The AWS instances were being manually updated after each release by Sangamesh Nadagoudar from Conflux Tech (fellow Mifos partner from Bengaluru).

Of the cloud service providers, Amazon has been the most popular and practical to get started with, whereas Microsoft with it's Azure offering is the tech giant's foray into the cloud space. The guys at MS Open Tech have been working on the Azure shell and ARM and to their credit, have provided the source code of the former on Github, which personally made it easier to persuade us to partner with them. I need to especially thank Ed Cable co-founder of Mifos Initative for his role in mediating and co-ordinating. And of course  Ross Gardler, Head of Microsoft Open Technologies and President of the Apache Software Foundation, who coordinated Microsoft funding in an effort which has changed the way Mifos X is deployed and in the future should even change the way it is developed.

Though my personal preference for the Desktop / Laptop and Server is and has been linux, many of the partners in India and Africa are known for their preference and comfort using MS Windows and so are many of the Government departments. From a business perspective, we at SanJose Solutions do understand the importance of these people and cloud is the big leveller today with interoperability being the mantra. By simplifying the Mifos installation process and the ease of install and deployment, we have seen a manifold growth in new partners and demand for Mifos services and customizations around the world.


Monday, May 25, 2015

1st Anniversary of SanJose Solutions

This is the day the Lord has made. Let us rejoice and be glad in it - Psalm 118:24

Today, we celebrate the first anniversary of SanJose Solutions, a day to thank God and many well wishers who've been instrumental in realizing this dream. In the past year, we've had some amazing highlights and special memories. We started with optimism, strong faith and burning desire to make an impact. Add to that the determination and persistence to learn and grow and challenge our limits and I'd say those have been our biggest assets. I recall the early stages - the excitement and effort and initial projects. As time has passed and we complete a year, we've found ourselves with a lot to be happy about and lots of work remaining to be done. I've realized that, looking back I can truly say that though I'm challenged in living and working for a greater mission and facing the human challenges that come with it, this is what gives me great fulfilment and satisfaction.

This occasion marks a special milestone for me personally. Living in Bangalore all these years, with it's globally renowned IT industry, software giants and multi-national companies, in one such place I started my career 11 years back, yet realized what I was looking for was more. Building great software was always my desire and it was about growing in my competency to build each software better than the last one that has been a great motivating factor. I realized early in my career that learning is the key to unlock my future dreams. To top it all, I needed a higher purpose which synchronises with my own personal mission to make a difference in the world.

Our nosedive into Mifos X has been greatly satisfying because it brought us in touch with some amazing organizations and their work and the awesome Mifos community. The Mifos Initiative, especially Ed Cable, has been a great supporter in our mission. The Mifos X Messenger and the Debian package for quick installation of Mifos X were some highlights in our contribution in this area, contributions well appreciated by the community, especially based on the feedback at the global summit at Dubai this past March.

Thursday, April 2, 2015

Special Day for SanJose Solutions

Today is a special day because on this day Lord Jesus set the perfect example of humility washing the feet of his disciples. Jesus also gave the mandate "Love one another as I have loved you". Here was a man, who at the consummation of a life which amazed his contemporaries, as reports the Gospel of Mark, gives perhaps his most important teaching and commandment. This is why today is called Maundy Thursday because of Jesus mandate to love one another. Born in a manger and having no place to lay his head, he showed the way of compassion,  mercy and love. Jesus said of his mission
The Spirit of the Lord is upon me,
and he has anointed me to bring good news to the poor,
proclaim freedom to the captives, 
and recovery of sight to the blind
Jesus clearly saw and identified himself with the poor both through his words and actions. It was last May end that I started SanJose Solutions with the aim of serving the Church and Society with quality technology solutions. It has been and continues to be an incredible journey with ups and downs, both of which have blessed and helped us. Through it all we have experienced the sure hand of Providence in a special way during these past months. Many of the things we have hoped and prayed for have become a reality and other things which we didn't plan or expect but have received in abundance more than we could imagine.

There is no doubt that we at SanJose Solutions draw great strength from Christ's life in our mission to serve the poor, working along with other Mifos partners, towards our dream of universal financial inclusion. Mother Teresa of Calcutta said "when I see the poor, I see in them the face of Christ". Jesus said whatsoever you do to the least of my people you do so to me. This is what makes our work for us more than any regular job. It becomes for a mission that is close to our hearts.

However, it is not enough to dream - we must also apply. I had attended a Social Entrepreneurship Course at Bala Vikasa in Warangal, Andhra Pradesh last year during which I also conducted a session on technology for Social Entrepreneurs. It was amazing discovering the power of Entrepreneurship. It is interesting how industry and social work can benefit from each other. The recent episode of NDTV Dialgues last Sunday featured an expert panel including Nobel Laureate Prof. Mohammad Yunus talking about Financial Inclusion for the Poor in India. It is heartening to see several positive thoughts about how we can enable the dreams of millions of people across the country through Microfinance and how business practices and knowledge can be utilized to carve a new economy where there is inclusive growth of all sections of society and the gap between the rich and poor can be reduced. Our vision is to build a sustainable Social Enterprise which can continue providing the services we have started out with to many more organizations and for a long time to come. Today we have seen organizations which have done this and we know we have the tools and the means to make this a reality.

Today is also a special day for me because it is my birthday. SanJose Solutions for me personally has been an amazing journey finding great satisfaction in fulfilling my dreams and my heart's desires. During last year's Social Entrepreneurship course I learned that the major source of India's GDP is Entrepreneurs. Prof. Yunus said during the programme that human beings are born to create, to invent. We have been looking at the corporate sector to provide jobs, but human beings can create their own jobs, we are born entrepreneurs. We at SanJose Solutions dream and don't stop at that. We build bridges between our present and our dreams, and we move forward towards realizing them and the dreams of others. For me especially the latter has been a strong motivator in my work and mission. My dream is to build wealth, but not really for myself but for many poor across the world. My dream is for many people of today to have sufficient to ease their suffering and provide for their old age. It is for children who have talent but lack education, facilities and opportunities can find a way to realize and enable the dreams of others too. My dream is to continue this virtuous cycle of making a difference through technology and transform my country, and the world.

I returned from the U.A.E last month after meeting members of the Mifos community from across the world. Over 80 people from more than 20 countries came together and it was my first summit in Sharjah, the confluence of East and West. We had a series of sessions on technical, financial, business and management topics and a lot of meetings and community interactions and not to mention fun as well. I was invited as a guest speaker to conduct a couple of technical sessions. The first was a session on Mifos X Messenger, an application to send automated SMS to a client even numbers on Indias notoriously hard to send Do-not-disturb lists. The second session was targeted at partners who need a quick was to demo Mifos X or setup a production instance of it on a linux server. The summit concluded with a hackathon which was the first time it was scheduled as part of a summit and I'd say it proved to be something a lot of technologists enjoyed and hope to see continue and increase in future summits.

It is with great faith and confidence that we look at the future seeing the promised land where the least fortunate have future and a hope. We believe that together we can shape a new world. In the midst of suffering and an unjust world, we believe in making the kingdom of God, a heaven on earth. Though this is not our final destination, we know we are here for a reason to do a work, a mission with the time that we have. We know that we are both human and also spiritual created by God Almighty and called to be holy. We offer to the Lord our gifts seeking his blessing, knowing that only through his grace and strength does everything good come. And we look forward to continuing to run this race and fight this good fight and leave no stone unturned in marching forward on our mission. And may the Lord Almighty bless us and see us to our journey's end.

Tuesday, March 10, 2015

Mifos X Messenger Installation

Mifos X Messenger, the SMS Messaging System which sends SMS messages at different points in the Mifos X workflow can be installed by following these steps. I've tested out these steps for Debian / Ubuntu and it should be similar for Mac OSX, plus we've also been able to install on Windows, where step 1 is not applicable, but other steps are similar:

1. Install ruby version manager rvm see https://rvm.io/rvm/install:

    \curl -sSL https://get.rvm.io | bash -s stable --rails

2. Download messenger source code:

      git clone https://github.com/SanjoseSolutions/mifosx-messenger.git

3. Install dependencies

   bundle install

4. Configure mifosx-messenger

   setup config.yml

5.  Run messenger

   ruby app.rb

6. Setup Mifos X Webhooks to connect with MifosX Messenger

  In Mifos X go to Admin > System > Manage Hooks
  Click "Create Hook"
  Hook Template: Web

  Active: checked
  Content Type: json
  Payload URL: http://localhost:3000
  Events: transactions_loan : LOAN : REPAYMENT
                transactions_savings: SAVINGSACCOUNT: WITHDRAWAL 
                transactions_savings: SAVINGSACCOUNT: DEPOSIT

More details, video coming soon

Wednesday, October 22, 2014

Quickly Install Mifos X 1.25 on Debian/Ubuntu

I'm pleased to announce that Mifos X version 1.25, the world's leading platform for financial inclusion now can be installed automatically in minutes on Debian/Ubuntu or any similar distribution, using a deb package. I recently packaged Mifos X 1.25 into a Debian package and also setup a Debian repository for the same to facilitate this quick installation. For the impatient, jump straight to the section "Installing Mifos X 1.25 on Debian/Ubuntu". If you're still with me, read on for the back story..

This contribution came as a result of a recurring itch which I've been feeling for a long time now. This summer, I first tried to install the new Mifos X platform. At that time, I was new to Amazon Web Services and since I have a VPS with ample resources, plus a few Virtual Machines my preferred mode was manual installation on Ubuntu/Debian server. Following the steps in INSTALL.md and after the couple of hiccups, got it working on a Ubuntu VM and then installed an online demo on my Debian VPS. Over the months and weeks that followed, I often thought about improving this installation process and also found others on the mailing list facing problems getting stuck at some stage of manual installation. On a couple of Mifos users meetups Ed from the Mifos Initiative a lot of people run Mifos from Debian and Ubuntu though they did not have any concrete statistics on this. So finally I decided to answer this need and build the package and repository.

Mifos X is the world's leading Platform for Financial Inclusion with a great community, awesome architecture and cutting edge technology. Mifos X has always been available as Open Source and the repository is hosted on github.com and stable releases are available on sourceforge.net. Despite Mifos X availability, there was always the challenge of following the entire process documented in the INSTALL document. This process involves several steps:

  1. Installing Tomcat7
  2. Installing MySQL Server
  3. Installing JDK (via the OpenJDK 7 package on Debian/Ubuntu)
  4. Downloading and extracting the Mifos X release zip file
  5. Setting up and initializing the mifosplatform-tenants database
  6. Setting up and initializing the mifostenant-default database
  7. Creating a keystore with SSL private & public key pair
  8. Configuring Tomcat server.xml
  9. Dropping the mifosng-provider.war into the tomcat webapps directory
  10. Copying the community-app and api-docs folders into webapps/ROOT

After following all these steps there were a couple of issues I faced. First the MySQL root password had to be mysql. If it was something else, it wouldn't work. Second, the recent Mifos X releases require the use of JDK 7 but the default setting for Tomcat is to use JDK 6, so the /etc/default/tomcat7 needs to be modified to use JDK 7. Then, with the recent release, there was also the increase in memory requirement for Tomcat which needed to be configured in /etc/default/tomcat7. Apart from doing the steps mentioned above, I also ensured the deb package installation takes care of the above caveats, so now this installation process takes care of everything and gives you a working Mifos X setup with the provider app in the backend and the community app running on Tomcat.

Installing Mifos X 1.25 on Debian/Ubuntu

To install Mifos X 1.25 on Debian simply run these lines as root:
# echo deb http://mifos.sanjosesolutions.in stable main > /etc/apt/sources.list.d/mifosx.list
# apt-get update
# apt-get install mifosx
For Ubuntu, the steps are:
$ echo deb http://mifos.sanjosesolutions.in stable main |
                  sudo tee /etc/apt/sources.list.d/mifosx.list
$ sudo apt-get update
$ sudo apt-get install mifosx
That's it! You'll be prompted for the MySQL root password, which is used to create the 2 databases, and the username and password of the account to access Mifos. You'll also be asked for information to generate the SSL keys since Mifos X community Application runs on HTTPS (HTTP over SSL). It is our hope that many more people will be able to get started quickly with MifosX through this effort. Spread the word and join us in the fight against poverty.

Report your experiences to the Mifos X mailing list mifos-users@lists.sourceforge.net
Check out the github repo at https://github.com/SanjoseSolutions/mifosx-packager
Send feedback to terence@sanjosesolutions.in

UPDATE: Here's a YouTube screencast of the live installation process:

Wednesday, October 15, 2014

MifosX Messenger - automated SMS notification app

As mentioned in my previous blog post, the architecture of MifosX makes it play very nicely with heterogenous technologies using the REST API and Webhooks to communicate. To fulfill my client's requirement, I started working on a SMS sending application to notify group members about financial transactions like loan repayments, and deposits and withdrawals to savings accounts.
I used the Sinatra framework of the ruby programming language because of it's simplicity. Though not as famous as Rails, it's elder brother, Sinatra is perfect for quickly writing great applications without enforcing a directory structure on the programmer. A simple application in sinatra can be as few as 5 lines. Your hello world in sinatra would look like (you won't believe this):

require 'sinatra'

get '/hi' do
  "Hello World!"
end

Having several years experience developing Web Applications, I've used several kinds of frameworks for different tasks. MVC frameworks like perl-Catalyst, ruby-on-Rails and python-django are great for developing modular applications. However, as the above code snippet shows, it's possible to get cracking with a much leaner and meaner application with a intuitive block for each request path and request type. I had the joy of using another microframework like Sinatra before: perl's Dancer framework. Dancer proved great for implementing a webhook handler app. With the help of CPAN's great array of libraries and modules, I could quickly develop an application with a few lines of code.

Having emphasized the simplicity and speed of developing with microframeworks like Sinatra, it's flexibility with directory structure shouldn't deter those looking to write maintainable applications. Since ruby itself is object oriented and provides neat ways to organize a growing project, it's possible to write a perfectly modular and well organized and maintainable application with Sinatra. In fact, MifosX Messenger uses a handful of classes which specialize in the different functionalities required to get the app working. The workflow starts when a financial transaction is recorded in MifosX.



As the above sequence diagram shows (click for full size view), MifosX Messenger gets notified when any financial transaction it has subscribed to is performed. It parses the JSON in the POST request data received and uses the clientId, loanId and resourceId to fetch information from Mifos via the REST API. Once it has collected the necessary information, it uses a MessageTemplate class to construct the SMS and sends it to the mobile number of the client.





Falling in love with MifosX

I've been a Free and Open Source Software(FOSS) enthusiast and programmer for several years now. Recently I got the opportunity to work on my dream project: MifosX, the world's leading FOSS platform for financial inclusion. Being excited about the scope of the work is one thing, the fact that what you do helps transform lives of so many people, giving them hope and a future. That's what this is all about - using software as a means to help MicroFinance Institutions (MFIs) scale up to reach many more poor with minimal increase in their organizational cost. In case you're new to Mifos, here's a video that demonstrates the power of this platform with a case study of how it can help a MFI:


I had worked on Mifos earlier too, and was surprised to see that the old application I had contributed to had given way to a completely new rewrite as an SPA (single page application) written in AngularJS with a neatly separated REST backend provider application. While it was a considerable change for me, coming from the old application, I feel very excited because the new architecture makes it possible to have different kind of front-end application or module talk to the backend app. It is therefore much easier to build tools which can talk to Mifos backend and leverage the comprehensive API with functionality for an incredibly wide array of functionality covering a host of financial and supporting services. Another new development in MifosX which I'm very excited about is the Webhooks functionality using which an independent web service can be notified when different kinds of financial transactions, etc are recorded. This makes it possible to integrate with Mifos X, systems that can perform actions in real time when financial transactions are recorded.

A classic application of this webhooks functionality is to send automatic SMS to clients when financial transactions are recorded. In a normal software application, one would need to modify the backend application itself to do anything like this, but with Mifos X webhooks, an independent application can be used for this purpose. Since I had previous experience writing application for webhooks for github repository, I started the MifosX Messenger project to integrate a couple of Indian Bulk SMS providers to send automatic SMS using their services. MifosX Messenger can work with multiple SMS providers and can be extended very easily to add more providers, by just adding a new subclass for the provider.

Therefore, MifosX has facilitated development of application in any platform enabling a heterogeneous system with components in different technologies working in unison using the web requests to communicate effectively. This gives rise to endless possibilities.