Challenge Overview

In this challenge series we’ll be building a platform for Topcoder notifications that will be integrated into many products - challenge pages, Topcoder Connect, etc. The overall architecture is based on a message bus (Kafka). Each of the Topcoder services (ex project & challenge services, message service,..) will post events to the message bus (ex a challenge has been posted, challenge received a submission, user has joined a project, etc). We have built a simple REST service that will serve as a proxy to Kafka. Each of the client apps (community pages, Topcoder Connect, etc) will then have a separate notification server that will subscribe to Kafka topics, filter messages, store the notifications for each user and track notifications as new or seen (scope of this challenge.

 

Notification server will receive messages from Kafka that are in fact events (message posted, challenge posted, etc) and it has to 'unroll' the event into specific notifications for each user that should receive it (for Connect that will be all project members, for challenge pages that will be challenge registrants, etc).
Each notification will have just two fields 'type':String (same as originating Kafka topic name) and contents:Json. 
Each user will also have a 'notifications profile' with settings(on/off) for different notification delivery mechanisms (Email, SMS, Desktop, etc) for each of the message types( project.created, challenge.created, message.posted, etc). We will build the notification delivery jobs in the next challenges.

The notifications server will have the following features:

  • List all notifications for a user
  • Mark a notification as read
  • Mark all notifications as read
  • Get notification settings
  • Update notification settings
The data will be persisted into a postgres database. All endpoints will be protected with a per user JWT token (configurable values for JWT parameters). The token itself will be generated elsewhere and will contain user_id field.

As we want each of the client apps to have its own notification server, it should be implemented as a module that can simply be instantiated and configured with logic on how to unroll the events into notifications. So for example, we could create a new notifications server for Connect with
const notificationsServer = require('notificationsServer');
//set configuration (port, keys, etc)
notificationsServer.setConfig(config)
//provide logic for unrolling the events into notifications
notificationsServer.addTopicHandler('topicName',handler);
//start the server
notificationsServer.start()
The above is just en example and you can change the implementation as needed. It should be possible for us to host the 'notificationsServer' module in a separate repository that all specific notificationsServers will depend on (we want them to share as much codebase as possible).
Note that it should be possible to deploy multiple instances of the notification server and use a load balancer if needed, so don't create any 'state' data in the notification server. Also, different instances should NOT process the same message from Kafka.

As part of this challenge you should also implement the notifications server for Topcoder Connect. To unroll the messages, call the api.topcoder-dev.com/v4/projects/PROJECT_ID/ endpoint using project_id field from the Kafka message. To call the api you have to add authorization header "authorization: Bearer + TOKEN" where token is a JWT for an admin user. you can use "___FILL___ADMIN___TOKEN___HERE" for testing. The server will be listening for these messages
notifications.connect.project.created
notifications.connect.project.updated
notifications.connect.message.posted
notifications.connect.message.edited
notifications.connect.message.deleted
notifications.connect.project.submittedForReview

Notifications BUS API server and Kafka are deployed to Heroku adn you can use them for testing. Sample topics are already created. Server details are posted in the forums.


Final Submission Guidelines

Submit a complete source code for the service and the specific Connect implementation
Submit a Deployment guide for deploying locally and on Heroku
Submit a Postman collection for verifying the endpoints (and instructions to verify the messages end up in kafka queue)
Submit a Swagger API spec

ELIGIBLE EVENTS:

2018 Topcoder(R) Open

REVIEW STYLE:

Final Review:

Community Review Board

Approval:

User Sign-Off

SHARE:

ID: 30060206