This project demonstrates how to build a custom Slack application using serverless event-driven architectures on AWS to enable cross organizational communication within a multilingual teams by providing real-time message translation.
The interaction between deployed infrastructure and Slack is handled using the Javascript Bolt framework, which simplifies the process of building Slack apps by providing a simple and intuitive API for handling events and actions.
If you're interested in finding out more about how this works, read over this blog post -> Leveraging AWS Lambda and EventBridge for a Multilingual Slack Bot
This application can be downloaded to your Slack workspace using this link:
The application is triggered by Slack events that are routed through AWS EventBridge to relevant Lambda functions, which handle different actions like opening the app home, translating messages and setting language preferences. This setup allows for scaling without the complexity of managing a dedicated server, offering a robust solution for enhancing the functionality of Slack within an organization.
The architecture of the application is as follows:
- AWS account
- Slack account with permissions to create apps in the workspace
- Node.js and pnpm installed
- AWS CLI installed and configured
- Create a Slack app by following the Slack API Hello World tutorial
- Copy and past the manifest file from the
slack-app-manifest.json
file in this repository to the app settings. - Note the
SLACK_CLIENT_ID
,SLACK_CLIENT_SECRET
and theSLACK_SIGNING_SECRET
from the Slack app settings.
- Clone this repository.
- Navigate to the cloned directory and run
pnpm install
to install dependencies. - Have your aws credentials configured in your environment.
- Deploy the application using using the command
pnpm ci:deploy -c stage=dev
. - Note the api endpoint from the output of the deployment.
- In the App Manifest file, update the with the actual API endpoint.
- To install the app to your workspace, visit the site
<api-endpoint>/slack/install
in your browser. You will be redirected to Slack to authorize the app.
Once deployed and configured, the application will look something like this:
You can submit or remove an OpenAI API key or update the language preference in the app home.
You can add the app to a channel by running the command /invite @quipper
in the channel.
The app will automatically translate messages sent in channels based on the language preference set by the user.
The language preferences will translate any language to your primary language. If the orginal message is in your primary language, it will be translated to the secondary language.
Contributions are welcome! Feel free to open issues or submit pull requests to enhance the functionality of this Slack application.
- Andre du Plessis - Initial work - jaduplessis
Enjoy building your event-driven Slack applications!