Register
Submit a solution
The challenge is finished.

Challenge Overview

Challenge Overview

Technology stack

Project background

We built several bots for communication from/to Topcoder Slack, Client Slack, and Client MS Teams. The current architecture is as below.

In this project, we want to build the bots with the same functionality on AWS Lambda so that we can gain the benefit of serverless. The final architecture should look like

Here is the code of the existing bots for your reference. You might pull the custom code from them as needed.

For understanding detailed steps of interaction between bots, follow the description of these past challenges.

 

Currently, both of the bots were built by

  • NodeJS + Express

  • Botkit

  • MongoDB (Used by Botkit)

In this project, we will re-implement them with

 

General requirements

In the last challenge, we implemented the Central TC Lambda, in this challenge, we are focusing on the client Slack Lambda implementation, and also extend the implementation of the Central TC Lambda.

The client Slack Lambda should

  • forward the requests from Client Slack to the TC Slack via Central TC Lambda, then Central TC Lambda will process these requests and sends them to TC Slack.

  • handle the requests/responses from TC Slack via Central TC Lambda, then process and send them to Client Slack.

The scenario should be

1. In Client Slack, clients issue a request command to send a small project description message. For example, Issue a command @topbot request I need to build an email reminder service. “I need to build an email reminder service” is the description of the command, it can be any text. Then the client Slack Lambda intercepts the request command and calls the API of Central TC Lambda to initiate the request. You need to implement the API in Central TC Lambda

This would send the message to the TC Slack channel (in the Topcoder team) where the message would be shown along with a button “Post a response".

2. Clicking the “Post a response" button will open a dialog with a text area for the user to post a response (ex “Sure, let me add you to our Slack channel to discuss the project further”, the response message is arbitrary).

3. Clicking “Post” will send the response to the Client Slack channel as a regular message (both request and response should be visible in the originating channel). Central TC Lambda will intercept the response and call an API of the client Slack Lambda to forward the response to the Client Slack. You need to implement the API in the client Slack Lambda

After the response is sent, we should be able to see

(1) an acknowledgment should be posted to the TC Slack.

(2) The response is posted back to the Client Slack with the “accept” and “decline” buttons

4. Clicking on the “accept” button on the Client Slack will send a message to the TC Slack. The client Slack Lambda will intercept the message and call an API of the Central TC Lambda to forward the message to TC Slack. You need to implement the API in Central TC Lambda. Then in the TC Slack, there should be a message like “Great, the client accepted the project, please approve” with the “approve” button.

5. Clicking on the “reject” button on the Client Slack will send a message to the TC Slack. The client Slack Lambda will intercept the message and call an API of the Central TC Lambda to forward the message to TC Slack. You need to implement the API in Central TC Lambda. Then in the TC Slack, there should be a message like “Sorry, the client rejected the project”.

6. Clicking on the “approved” button on the TC Slack will send a message to the Client Slack. Central TC Lambda will intercept the message and call an API of the client Slack Lambda to forward the message to the Client Slack. You need to implement the API in the client Slack Lambda. Then the Client Slack will receive the message like “Your project was approved. Now you can use @topbot email command to invite more people in your project via email IDs”.

7. In the Client Slack, issue email command to invite people via email IDs. For example, issue the command @topbot email billsedison@test.com will send an invite to billsedison@test.com. For now, we don’t need to actually send the email, just to mock the command. The client Slack Lambda intercepts the email command and calls the API of Central TC Lambda to initiate the request. You need to implement the API in Central TC Lambda.

Then in the Client Slack, there should be an acknowledge message “User with <email ID> has been successfully invited to the project, you can access the project at Connect .” Replace <email ID> with the actual email ID in the email command.

In TC Slack, there should be a message “User with <email ID> has been successfully invited to the project”. Replace <email ID> with the actual email ID in the email command.

8. The help command should also be implemented in both Central TC Lambda and the client Slack Lambda.

9. The existing code of Central TC Lambda contains a launch command, the code related to the command should be removed.

Please note all the following up messages, responses, commands should be replied in the request thread that was posted in step 1).

All the API endpoints should be described in a swagger doc. 

The existing Central TC Lambda code is in https://github.com/topcoder-platform/Topbot/tree/central-lambda

The code of the original bot is  https://github.com/topcoder-platform/Topbot/tree/dev. You can take the code for reference.

For the DynamoDB storage of Central TC Lambda:

  • The created project should be stored in the table projects in DynamoDB. Each record should include

    • Created project description

    • Requester (client email or name)

    • TC Slack user’s email or name who is interacting during the project creation

    • Timestamp

Important notes

Please handle the edge cases properly, like

1. Invite the user who is already invited

2. Try email command in non-request thread

3. Multiple clicks on Accept and Decline

Concerns for the future challenges

In the next challenge, we’ll implement the client Teams Lambda and update the Central TC Lambda to support MS Teams accordingly.

 

Please note the code of communication to/from Topcoder slack in the following two existing code are completely different.

So keep in mind that the Central TC Lambda will support both Slack and MS Teams eventually when you are developing the code.

Final Submission Guidelines

  • The full source code of the client Slack Lambda

  • The updated source code of Central TC Lambda or a git patch against the latest commit hash of https://github.com/topcoder-platform/Topbot/tree/central-lambda

  • The swagger doc of the API in yml format.

  • The swagger UI or Postman collection to verify the API.

  • Deployment guide, make sure its properly described step by step, it should include the screenshots.

  • Verification guide - how to set up the environment, install the bots, verify the features, it should include the screenshots.

  • Short demo video - only the user interaction flow, no need to record build/setup steps

ELIGIBLE EVENTS:

2020 Topcoder(R) Open

Review style

Final Review

Community Review Board

Approval

User Sign-Off

ID: 30107574