{"id":17984270,"url":"https://github.com/danilop/serverless-positive-chat","last_synced_at":"2025-06-12T19:06:53.990Z","repository":{"id":150311204,"uuid":"171524432","full_name":"danilop/serverless-positive-chat","owner":"danilop","description":"An inclusive chat that avoids negative messages and translates the content in the language that you choose, tracking the main topics of a chat room.","archived":false,"fork":false,"pushed_at":"2020-01-27T13:45:11.000Z","size":35,"stargazers_count":54,"open_issues_count":3,"forks_count":5,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-06T10:01:35.473Z","etag":null,"topics":["amazon-api-gateway","amazon-comprehend","amazon-dynamodb","amazon-translate","amazon-web-services","aws","aws-lambda","serverless","serverless-application-model","websockets"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danilop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-19T18:10:10.000Z","updated_at":"2024-11-23T15:20:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"f3efb79f-0c1b-46cd-bd2b-c7e75f2d1d9c","html_url":"https://github.com/danilop/serverless-positive-chat","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/danilop/serverless-positive-chat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danilop%2Fserverless-positive-chat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danilop%2Fserverless-positive-chat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danilop%2Fserverless-positive-chat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danilop%2Fserverless-positive-chat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danilop","download_url":"https://codeload.github.com/danilop/serverless-positive-chat/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danilop%2Fserverless-positive-chat/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259519815,"owners_count":22870369,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amazon-api-gateway","amazon-comprehend","amazon-dynamodb","amazon-translate","amazon-web-services","aws","aws-lambda","serverless","serverless-application-model","websockets"],"created_at":"2024-10-29T18:19:58.690Z","updated_at":"2025-06-12T19:06:53.957Z","avatar_url":"https://github.com/danilop.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# serverless-positive-chat\n\nAn inclusive chat that avoids negative messages and translates the content in the language that you choose, tracking the main topics of a chat room.\n\n![serverless-positive-chat demo](https://danilop.s3.amazonaws.com/Images/positive-chat-demo.png)\n\nThs application is designed to be completely [serverless](https://aws.amazon.com/serverless/), using:\n\n- [Amazon API Gateway](https://aws.amazon.com/api-gateway/) to manage WebSocket communication between the browser and the Lambda function\n- [AWS Lambda](https://aws.amazon.com/lambda/) for the custom business logic\n- [Amazon Comprehend](https://aws.amazon.com/comprehend/) to detect the dominant language, the sentiment of the messages, and its main entities (topics)\n- [Amazon Translate](https://aws.amazon.com/translate/) to translate the messages to the language chosen by each participant of a chat room, or to a language supported by Comprehend for sentiment and entities detection.\n- [Amazon DynamoDB](https://aws.amazon.com/dynamodb/) to store messages, connection information, and the topics discussed in each chat room\n\n![serverless-positive-chat architecture](https://danilop.s3.amazonaws.com/Images/positive-chat-architecture.png)\n\nYou can find a brief description of the architecture here:\n\nhttps://speakerdeck.com/danilop/serverless-real-time-apps-lets-build-a-positive-chat\n\nA sample deployment is available at:\n\nhttps://pchat.demo.danilop.net\n\nPick a username, a chat room, and the language you want to use to receive your messages.\n\n```bash\n.\n├── README.md                   \u003c-- This instructions file\n├── positive-chat               \u003c-- Source code for the Lambda function\n│   ├── app.js                  \u003c-- Lambda function code\n│   └── package.json            \u003c-- Node.js dependencies\n├── www                         \u003c-- Source code for the web content\n│   ├── index.html              \u003c-- HTML page\n│   └── index.js                \u003c-- JavaScript running in the browser\n├── deploy.sh                   \u003c-- Deployment script\n└── template.yaml               \u003c-- SAM template\n```\n\n## Requirements\n\n* [AWS CLI](https://aws.amazon.com/cli/) already configured with Administrator permission\n* [AWS SAM CLI](https://aws.amazon.com/serverless/sam/) to manage serverless deployments\n\n## Setup process\n\nCreate two S3 buckets, one for the deployment packages and one for hosting the website. Bucket names must be unique, so those in the following example are probably taken:\n\n```bash\n$ aws s3 mb s3://positive-chat-packages # choose a unique bucket name here\n$ aws s3 mb s3://positive-chat-web      # ...\n```\n\nRun the `deploy.sh` script passing the followng options:\n\n```\n./deploy.sh {PACKAGES_BUCKET} {WWW_BUCKET} {STACK_NAME}\n```\n\nFor example, using the buckets you created before, you would use something like:\n\n```bash\n./deploy.sh positive-chat-packages positive-chat-web positive-chat-prod\n```\n\nThe `deploy.sh` script gets the WebSocket (WSS) URI from the output of the [CloudFormation](https://aws.amazon.com/cloudformation/) stack to pass it to the web app, uploading a configuration file on S3, so that you don't need to configure it manually.\n\nUsing a web browser, go to the S3 bucket you are using for the website, for example (replace the bucket name with the one you created to host the website):\n\nhttp://positive-chat-web.s3.amazonaws.com/index.html\n\nThen pick a username, a chat room, and the language you want to receive your messages translated to.\n\nAdd a CloudFront distribution to have HTTPS access with the domain of your choice. WebSockets are always encrypted (WSS) by the API Gateway.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanilop%2Fserverless-positive-chat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanilop%2Fserverless-positive-chat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanilop%2Fserverless-positive-chat/lists"}