All Projects → aws-samples → Simple Websockets Chat App

aws-samples / Simple Websockets Chat App

Licence: other
This SAM application provides the Lambda functions, DynamoDB table, and roles to allow you to build a simple chat application based on API Gateway's new WebSocket-based API feature.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Simple Websockets Chat App

Contacts api
Serverless RESTful API with AWS Lambda, API Gateway and DynamoDB
Stars: ✭ 66 (-85.46%)
Mutual labels:  aws, apigateway
Dazn Lambda Powertools
Powertools (logger, HTTP client, AWS clients, middlewares, patterns) for Lambda functions.
Stars: ✭ 501 (+10.35%)
Mutual labels:  aws, apigateway
Ridge
AWS Lambda HTTP Proxy integration event bridge to Go net/http.
Stars: ✭ 45 (-90.09%)
Mutual labels:  aws, apigateway
Serverless Chat
A serverless web chat built using AWS Lambda, AWS IoT (for WebSockets) and Amazon DynamoDB
Stars: ✭ 99 (-78.19%)
Mutual labels:  aws, websockets
Aws Mqtt Client
AWS Websocket Pub/Sub client
Stars: ✭ 147 (-67.62%)
Mutual labels:  aws, websockets
Aws Lambda Graphql
Use AWS Lambda + AWS API Gateway v2 for GraphQL subscriptions over WebSocket and AWS API Gateway v1 for HTTP
Stars: ✭ 313 (-31.06%)
Mutual labels:  aws, websockets
Archive aws Lambda Go Net
Network I/O interface for AWS Lambda Go runtime.
Stars: ✭ 151 (-66.74%)
Mutual labels:  aws, apigateway
Aws Serverless Workshop Innovator Island
Welcome to the Innovator Island serverless workshop! This repo contains all the instructions and code you need to complete the workshop. Questions? Contact @jbesw.
Stars: ✭ 363 (-20.04%)
Mutual labels:  aws, apigateway
Awesome Nginx Security
🔥 A curated list of awesome links related to application security related to the environments with NGINX or Kubernetes Ingres Controller (based on NGINX)
Stars: ✭ 417 (-8.15%)
Mutual labels:  apigateway
Assume Role
Easily assume AWS roles in your terminal.
Stars: ✭ 447 (-1.54%)
Mutual labels:  aws
Serverless Plugin Aws Alerts
A Serverless Framework plugin that creates CloudWatch alarms for functions.
Stars: ✭ 419 (-7.71%)
Mutual labels:  aws
Aws Google Auth
Provides AWS STS credentials based on Google Apps SAML SSO auth (what a jumble!)
Stars: ✭ 428 (-5.73%)
Mutual labels:  aws
Jmeter Ec2
Automates running Apache JMeter on Amazon EC2
Stars: ✭ 448 (-1.32%)
Mutual labels:  aws
Microwebsrv
A micro HTTP Web server that supports WebSockets, html/python language templating and routing handlers, for MicroPython (used on Pycom modules & ESP32)
Stars: ✭ 420 (-7.49%)
Mutual labels:  websockets
Pawl
Asynchronous WebSocket client
Stars: ✭ 448 (-1.32%)
Mutual labels:  websockets
Midway
🍔 A Node.js Serverless Framework for front-end/full-stack developers. Build the application for next decade. Works on AWS, Alibaba Cloud, Tencent Cloud and traditional VM/Container. Super easy integrate with React and Vue. 🌈
Stars: ✭ 5,080 (+1018.94%)
Mutual labels:  aws
Awslimitchecker
A script and python package to check your AWS service limits and usage via boto3.
Stars: ✭ 417 (-8.15%)
Mutual labels:  aws
Honeylambda
honeyλ - a simple, serverless application designed to create and monitor fake HTTP endpoints (i.e. URL honeytokens) automatically, on top of AWS Lambda and Amazon API Gateway
Stars: ✭ 454 (+0%)
Mutual labels:  aws
Lambdaphp
Quick and Dirty PHP website hosting using Aws Lambda
Stars: ✭ 449 (-1.1%)
Mutual labels:  aws
Serverlessui
A command-line utility for deploying serverless applications to AWS. Complete with custom domains, deploy previews, TypeScript support, and more.
Stars: ✭ 434 (-4.41%)
Mutual labels:  aws

simple-websockets-chat-app

This is the code and template for the simple-websocket-chat-app. There are three functions contained within the directories and a SAM template that wires them up to a DynamoDB table and provides the minimal set of permissions needed to run the app:

.
├── README.md                   <-- This instructions file
├── onconnect                   <-- Source code onconnect
├── ondisconnect                <-- Source code ondisconnect
├── sendmessage                 <-- Source code sendmessage
└── template.yaml               <-- SAM template for Lambda Functions and DDB

Deploying to your account

You have two choices for how you can deploy this code.

Serverless Application Repository

The first and fastest way is to use AWS's Serverless Application Respository to directly deploy the components of this app into your account without needing to use any additional tools. You'll be able to review everything before it deploys to make sure you understand what will happen. Click through to see the application details.

AWS CLI commands

If you prefer, you can install the AWS SAM CLI and use it to package, deploy, and describe your application. These are the commands you'll need to use:

sam deploy --guided

aws cloudformation describe-stacks \
    --stack-name simple-websocket-chat-app --query 'Stacks[].Outputs'

Note: .gitignore contains the samconfig.toml, hence make sure backup this file, or modify your .gitignore locally.

Testing the chat API

To test the WebSocket API, you can use wscat, an open-source command line tool.

  1. Install NPM.
  2. Install wscat:
$ npm install -g wscat
  1. On the console, connect to your published API endpoint by executing the following command:
$ wscat -c wss://{YOUR-API-ID}.execute-api.{YOUR-REGION}.amazonaws.com/{STAGE}
  1. To test the sendMessage function, send a JSON message like the following example. The Lambda function sends it back using the callback URL:
$ wscat -c wss://{YOUR-API-ID}.execute-api.{YOUR-REGION}.amazonaws.com/prod
connected (press CTRL+C to quit)
> {"action":"sendmessage", "data":"hello world"}
< hello world

License Summary

This sample code is made available under a modified MIT license. See the LICENSE file.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].