AWS IOT Chat Example

πŸ’¬ Chat application using AWS IoT platform via MQTT over the WebSocket protocol

Full Stack Web DevelopmentJavaScriptApache-2.0

Abstract

AWS IOT Chat Example is an open-source Full Stack Web Development project. πŸ’¬ Chat application using AWS IoT platform via MQTT over the WebSocket protocol. This is a React application demonstrating how to use the AWS IoT platform via MQTT over the WebSocket protocol to build a live chat application. The sample application serves as a starting point for users to build serverless projects with Amazon Cognito, AWS Lambda and Amazon DynamoDB. It is built using JavaScript, AWS Lambda, React, Redux, MQTT. Key capabilities include: Register user; Login / Logout; Create room. The complete source code is publicly available on GitHub under the Apache License 2.0, making it a useful reference for students building a Full Stack Web Development mini project or final-year project.

1. Introduction

This is a React application demonstrating how to use the AWS IoT platform via MQTT over the WebSocket protocol to build a live chat application. The sample application serves as a starting point for users to build serverless projects with Amazon Cognito, AWS Lambda and Amazon DynamoDB. The project showcases the solution to common user questions such as how to authenticate IoT devices with Amazon Cognito.

2. Objective

πŸ’¬ Chat application using AWS IoT platform via MQTT over the WebSocket protocol

This project demonstrates how JavaScript, AWS Lambda, React can be applied to a real-world Full Stack Web Development problem.

3. Key Features / Modules

  • Register user
  • Login / Logout
  • Create room
  • Join room
  • Real-time chat
  • Unread message indicators

4. Technology Stack

JavaScriptAWS LambdaReactReduxMQTT

5. System Requirements

General requirements for this technology stack β€” check the README for exact versions.

  • Node.js (LTS) and npm
  • A modern web browser
  • VS Code or any code editor
  • Git (to clone the repository)

6. Installation & Setup

git clone https://github.com/aws-samples/aws-iot-chat-example.git
cd aws-iot-chat-example
  1. Install and configure the AWS Command Line Interface
  2. Ensure that the aws cli region is the same as what you define in api/config.yml
  3. Please configure your output format to be json. Instructions
  4. jq to process command-line JSON.
  5. npm the node package manager (Node.js 20+ required)
  6. Clone the repository
  7. Deploy the backend
  8. Run the frontend client
$ git clone https://github.com/aws-samples/aws-iot-chat-example.git
$ cd api
$ npm install
$ npx serverless@3 deploy --region us-east-1
$ npx serverless@3 deploy --region us-east-1 --profile your-profile-name
$ cd ../client
$ npm install
$ npm start

Full setup instructions are in the project README.

7. Future Enhancements

Suggested extensions you can add to make this your own project.

  • Add role-based access control
  • Deploy on a VPS or cPanel hosting with a custom domain
  • Add automated tests and a CI pipeline

8. Viva / Review Questions

Common questions examiners ask for projects in this domain.

  1. Explain the frontend, backend and database layers of this application.
  2. How is user authentication and authorisation implemented?
  3. Describe the main database tables / collections and their relationships.
  4. Which REST APIs or routes are exposed and what do they return?
  5. How would you deploy this application to production?

9. Source Code & License

This project is developed by aws-samples and published on GitHub under the Apache License 2.0. Please follow the license terms and credit the original author when you use or modify this code.

Want to build this as your internship project?

Work on a Full Stack Web Development project like this with mentor guidance, weekly reviews and an internship certificate from Training Trains, Erode β€” online or offline.

Apply for Full Stack Web Development Internship