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 will build a simple REST service that will serve as a proxy to Kafka (that is the scope of this challenge). 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.

 

In this challenge we will build a simple REST service that will connect to Kafka as a producer and will expose the following endpoints:

  • POST /event - post a new event to the kafka queue. Parameters:

    • type:String (fully qualified name - dot separated string; ex connect.project.update, challenge.created)

    • message: String (json formatted)

This endpoint will post the message to kafka. We want to avoid cluttering global topic namespace so all topics for this producer will be prefixed with “notifications.”, like “notifications.connect.project.update”. Create a helper for validating messages based on source system, message type and contents. We don't have any hard requirements for message validation yet, so validation should essentially be a no-op for now (all messages are passing validation).

  • GET /topics - it will retrieve just a list of topics in kafka

All api requests should be authorized using a JWT token with payload as {name:”name of the service that creates the event”} and a list of allowed services is kept in a configurable list. JWT secret and expiration time should be configurable (environment variables).

Connection to Kafka will be made over SSL using certificates, so KAFKA_URL, KAFKA_CLIENT_CERT and KAFKA_CLIENT_CERT_KEY should be configurable via environment variables. Use no-kafka npm module for interacting with Kafka.

For this challenge we have a kafka service deployed at Heroku. Post your handle in the forums to get the URL, certificates and sample topics you can use for testing.



Final Submission Guidelines

Submit a complete source code for the service
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

ID: 30059830