Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Draft: GSoC 2018 Proposal

Project: Fineract SMS/Email Notification Microservice.

Applicant: Ebenezer Kwesi Akyen Graham

Project Problem:

...

The notification service can be described as a messenger service responsible for handling email and SMS transactions. It enables an organisation's members (Staff and Customers) to get notified of events occurring on their accounts.

...

Navigation:

Children Display

Description

The notification service can be described as a messenger service responsible for handling email, push notifications and SMS transactions. It enables members (Staff and Customers) of a tenant to get notified of events occurring on their accounts.

It uses JMS Listeners to subscribe to event topics registered the system's message broker (ActiveMQ).

Once the message has been received, it determines the template, the gateway and the builds the content of the message.

Please consider contributing! 

  1. Repository
  2. Drive Containing Relevant documents

Service Roadmap/Feature

  1. Implement basic SMS and Email integration
    1. Interface with Twilio
    2. Gmail integration
  2. Incorporate notification microservice into demo-server to enable testing.
  3. Basic Message Templating
  4. Rest API
    1. Documentation
  5. Add support for FINCN Mobile

    1. Implement FCM push notification with a multi-tenanted approach
      1. Resources: Official FCM DocumentationFCM implementation in Java
  6. Replicate SMS/Email/Push Notifications functionalities for Portfolio/Office/Group/Employee Event Listener
  7. OTP through Push Notifications, SMS and Email
  8. Message Localisation
  9. Disable SMS and Email for specific users by using a custom field in customer
  10. Tenant Reputation Management
    1. Notification subscription and unsubscribe feature via SMS and email
  11. Message Templating
    1. Bulk SMS/Email/Push Notification
      1. Customized Bulk SMS
      2. Generic SMS
    2. Customized Messaging
      1. Templating
  12. Assess the feasibility of third-party integration with other messaging services
    1. Amazon SES Multitenant Solution
  13. Final test plan

Objectives for ongoing Iteration

Feature/ClassTo Do: FeaturesStatus
Rest Controller and Notification Manager
  1. Add fetch operations
  •  Completed
Email Service
  1. Allow configuration of service after instantiation
  •  Completed
Email Configuration Repository and schema
  1. More query for update and delete
  •  Completed
SMS and Email Service
  1. Allow reconfiguration of service after instantiation
  •  Completed
SMS configuration Repository and schema
  1. More query for update and delete
  •  Completed
Commands for SMS and Email Config and handlers
  1. Update and delete commands
  •  Completed
Rest Controller and Notification Manager
  1. Restructure API Naming Conventions
  •  Completed
Templating Feature
  1. Create basic HTML templating feature with thymeleaf
  •  Completed
Create frontend in fims-web-app
  1. More query for update and delete
  •  Completed
Authentication
  1. Implement Permitted Feign Client Authentication
  •  Completed




Objectives for 3rd Iteration



Completed

Implement SMS and Email functionality

Incorporate notification microservice into demo-server

Message Template

Create Rest API Documentation

Testing of SMS and Email from the web interface

Other Resource

Building a notification service in a multi-tenanted service-oriented architecture can be very complex. Here are a few resources to help assess some of the complexities involved.

  1. Building scalable multitenant email sending programs

...

Proposed Solution

My proposed solution is that notification topics are defined and potential recipients ( MFI members (Staff or Customers) ) are subscribed to the topic when their account is created. Hence, in the occurrence of an event which matches the topic, a topic mapper will provide all staff members who need to be notified of the event. NB: Topic definition and topic mappings are persisted into the database.

So, when an actual event occurs, the system knows the subscribers to notify and now the notification has to be generated. An event listener will listen for Spring Event Emitters generated. Then the notification service will start by creating a  notification object for the event, the notification then converted into an Email or SMS. To personalise the message, a subscriber prefines their language and communication preference during account creation. This is used to localize and separate notifications into SMS and Emails.

The localised messages are now formatted using a template associated to a topic.

The prepared messages will be passed to the Email services such as google’s SMTP server or Twilio SMS to be transmitted. I propose that the system allows multiple configurations to accommodate cases where the application supports multiple organisations who use different services.

Data (Notification, Notification mapping, Templates, Topics, Topics mappings, Subscribers) generated will be persisted into the Microservice’s database.

Subsystems Breakdown

EventListener

An event listener will listen for Spring EventEmitters generated. For instance for a new client creation the NotificationEventListener will capture the event emittered and generate the notification content

  • NotificationEventListener

    • Has a JmsListener to listen to emitted event

    • Initiates the NotificationEventService

  • NotificationService

    • Has an SMSService Object

    • Has an EmailService Object

    • Creates a NotificationMapper

    • Creates a recipient and their notification

    • Gets recipients details

    • Localize the message using subscriber preference

    • Sends the email or SMS

Domain

This package will define the class for the entities in the problem domain.

  • Notification

    • States the Recipient

    • states the action

    • states the content

  • NotificationMapper

    • Takes topic mapping and map notifications to subscribers

  • NotificationMapperRepository

    • Accumulate NotificationMappings

Configuration

This will be used to configure the behaviour of the system.

  • NotificationConfiguration

    • Has SMSConfiguration

    • Has EmailConfiguration

  • SMSConfiguration

    • Define sender’s Number

    • Defines and sets sms service authentication credentials

  • EmailConfiguration

    • Defines and sets mail service host

    • Defines and sets mail service ports

    • Defines and sets authentication credentials

SMSService

Use the Twilio SMS service and google SMTP Server

  • SMSDomainService

  • AuthenticateClient

  • AuthenticationClientRecordsRepository

EmailService

  • EmailDomainService

  • AuthenticateClient

  • AuthenticationClientRecordsRepository

This component will use the template component to form the message format. The template will abstract the various message formats. I believe using Apache Velocity to prepare default themes and allow the user to generate custom templates woube be a good consideration. Also, given that Fineract CN and Velocity [ http://velocity.apache.org/  ] share the same license it will be easier to use them

Template

  • SMS templates

  • Email Templates

API & DAO

The DAO  will be used to access resources in the Database and also persist data from the notification Microservice into its down database

  • TopicDAO

    • Get and set predefined topics

  • SubscriberDAO

    • Get and persist subscriber communication preference

    • Get and persist language preference

  • NotificationDAO

    • Get and persist content

    • Get and persist notification id

    • Get and persist action

    • Get and persist action ID

    • Get and persist office id

    • Get and persist topic mappings

  • TopicMapperDAO

    • Get and persist topic id

    • Get and persist topic mappings

Testing Fineract CN:

I am setting up a personal VM on Google Cloud to host Fineract CN for testing purposes and understanding the system.

This VM will be using during the program until the Official Apache VM is fully functional.  

  1. Project idea:

Response: Fineract CN SMS & Email Notifications

  1. Briefly cover what you expect to complete in this project and when including a detailed description of the project and a project plan.

Response:

 

Time

Deliverables

Pre GSoC

Complete setting up VM on Google Cloud to test Fineract CN

Week 1

Discuss with Mentor to Finalize the Proposed Solution

Design system and prepare essential UML diagrams

Week 2

Research and begin implementation

Implement Event Listeners

Implement Email and SMS service

Service Constants

Begin system Documentations

Week 3 - 4

Official Check in with Mentor

Implement Configurations

Document this weeks implementations

Week 5 - 6

Official Check in with Mentor

Implement Domain Classes

Document this weeks implementations

Week 7 - 8

Official Check in with Mentor

Implement APIs

Document this weeks implementations

Week 9 - 12

Official Check in with Mentor

Implement SMS and Email services

Implement Web interface for configuration

Document this weeks implementations

Finalize Documentation and development

Post GSoC

Iterate over previous implementations

Implement localization and templating

 

  1. Why are you the right person for this project?

The mission

I am an African enthusiast and the mission of the initiative resonates deeply with me. To give context. I want to help end poverty too and Africa has one of the highest poverty index ever recorded. I am passionate about tech solutions hence I am highly motivated to contribute given that the projects make a high impact on the society through Fintech.

Desire to Contribute

I have been following the Fineract project (Mifos Initiative) for almost a year now and I have always desired to contribute. I believe that participating in GSoC is a step towards becoming a lifelong contributor and a committer.

I am a FOSS enthusiast and this is my way of joining the FOSS community

Technical Skills

Working on this project presents a great opportunity for me to gain real-world experience, which has always been my desire.  I equally take internships every year season to learn new skills and impact the society.

I java studied Java, MySQL and JavaScript for almost 2 year and I have about 8 months of technical experience

  1. If in college, current area of study:

Response: BSc (Hons) Computing

  1. Contact information and preferred method of contact (email, Gitter ID, Skype id, telephone number, time zone);

Email: ebenezergraham69@gmail.com

Gitter ID:  @ebenezergraham

Skype id: ebenezer.graham

Timezone: +4:00 (GMT)

  1. Career goals

Response: Systems Analyst and a Programmer

  1. Please share any links to source code you have written or websites you have built.

http://ebenezergraham.bitballoon.com/ 

www.pactmart.com

www.ebenezergraham.github.io 

www.tedxalc.com  

  1. If you have visited our IRC channel, what nickname did you use?

Response:

dev@fineract.apache.org 

mifos-developer@lists.sourceforge.net 

Gitter (OpenMF, community-app, Fineract-CN-mobile, DataImportTool)

  1. Have you contributed to other open source projects? If so, which?

Response: Gitschool

  1. Have you any previous experience with AngularJS/Java/Spring/Hibernate/MySQL/Android?

Response: Java and MySQL

  1. What other commitments do you have this summer? (working on this project is a full-time job and must be your primary commitment!)

Response: 20 hours per week to study and take online course

  1. Have you deployed and run the Apache Fineract platform (https://github.com/apache/fineract) and the reference user interface (https://github.com/openMF/community-app)?

Response: Yes I have studied the codebase but haven’t deployed Fineract CN

  1. Have you submitted any patches or source code to Mifos X yet? Please provides links to the commit in GitHub or the JIRA ticket (students looking to be seriously considered should make at least one submission)

Response: Yes

  1. What motivates you the most about working with the Mifos Initiative for Google Summer of Code?

Response: I want to learn new techniques, learn how to engage with an opensource community and I believe GSoC will allow me to learn it in the best possible way.

  1. Have you previously participated in the Google Summer of Code?

Response: No

  1. Are you applying to multiple organizations this year?

Response: No

...