Challenge Overview

Project Context

Evernym provides solutions for verifiable credentials. We would like to use verity sdk from Enernym to test some ideas of universal identities.

Challenge Context

In this challenge, we are creating endpoints in existing API to support notifications.

Technology Stack

  • NodeJs 12

  • AWS SNS

  • AWS Dynamodb

  • Express

  • Android

Individual Requirements

The new endpoints will support sending notifications to both Android and iOS devices. In this challenge, we will work on Android because it's feasible to do it for everyone and for iOS it requires one apple developer account that is not available to everyone.

To send notification, we will use AWS SNS. Here is a guide for preparation aws resources https://aws.amazon.com/premiumsupport/knowledge-center/create-android-push-messaging-sns/

Please include all steps needed in the README file.

After creating the SNS platform application from the above step, we will use its ARN later. This should be configurable in Notification API: SNS_PLATFORM_APPLICATION_ANDROID_ARN

The two new endpoints are:

  1. POST /subscribe

    {

    "device": "android",

    "token": "device-token",

    "username": "handle",

    "evernymRelationshipDid": "DID",

    "sponsee": "sponsee"

}

  • Store all the information in AWS Dynamodb. Table name should be configurable.

  • The query of this table will be explained in POST /webhook

  • Create application endpoint (SNS) under SNS_PLATFORM_APPLICATION_ANDROID_ARN

  1. POST /webhook

    {

  "msgId": "msgId",

  "sponseeDetails": "sponsee",

  "relationshipDid": "relationshipDid",

  "metaData": {

    "msgType": "String",

    "msgSenderName": "Sender"

 }

}

  • Use sponseeDetails and relationshipDid to find subscription info in Dynamodb.

  • For the same sponseeDetails and relationshipDid, there could be multiple matched subscriptions (one person has multiple mobile devices)

  • Send notifications to all these devices.

  • Build notification message: Notification title and body should be configurable. Add the POST request body in message.data https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#Message.FIELDS.data

 

To test notification sending and receiving, you can use any sample Android application. For example here is one from Firebase https://github.com/firebase/quickstart-android/tree/master/messaging the app runs in Android Emulator.
 

Important Notes

  • Use async await pattern.

  • Use config to manage all configuration.

  • Use standard as your linter. Ensure there are no lint errors in your submission.

  • Typescript is not allowed. No build or compilation of code is expected.

  • No tests are needed.



Final Submission Guidelines

Git patch file.

README file should be updated to include environment preparation steps and verification guide.

ELIGIBLE EVENTS:

2021 Topcoder(R) Open

Review style

Final Review

Community Review Board

Approval

User Sign-Off

ID: 30152820