This project is a command-line interface (CLI) chat application that uses Websockets, JavaScript, Python, and the following AWS Services: API Gateway, AWS Lambda, and DynamoDB. On the client-side, I used JavaScript and a few CLI libraries to allow users to interact with the command line and use it as a chat graphical user interface (GUI). The back-end is serverless, using an AWS API Gateway to handle websocket requests and route traffic to a series of Lambdas according to request type. Finally, DynamoDB is used to persist users' connection IDs and keep track of users' respective chat rooms.
To get started with the project, follow the steps below:
- Clone the repository.
git clone [email protected]:daniel-jacks/socki-talki-v2.git
- Change into the 'clientside' folder.
cd socki-talki-v2/socki-talki-v2-clientside/
- Install the required dependencies locally.
npm install
- Run the app using 'node' command!
node client.js
OPTIONAL
Create global 'talki' CLI command:
- Install Node.js package globally using
npm install -g
- Run socki-talki from anywhere in the CLI using 'talki' command!
talki
Make sure you have the following prerequisites before attemping to build and run the application:
- Node.js
Once the application is running, you can use the following commands in the command-line interface:
- *help: Display a list of available commands.
- *config: Show the current username and roomname.
- *setUsername <username>: Set the username.
- *createRoom <roomname> -j: Create a new room with an optional auto-join flag '-j'.
- *changeRoom <roomname>: Change the current room.
- exit: Exit the application.
There are two portions to this codebase, and they work together to provide users quick and reliable chat functionality from the CLI!
- The 'clientside' folder, responsible for:
- constructing the message payload based off user input and sending to the server.
- receiving messages and relaying information to users via CLI GUI.
- The 'serverside' folder, responsible for:
- handling user requests depending on requested endpoint.
- updating users' usernames and rooms according to user requests (these values are stored in DynamoDB, however our Lambda functions access and update these tables according to user reqeusts).
Contributions to the project are welcome. If you want to contribute, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes.
- Commit your changes.
- Push the branch to your fork.
- Open a pull request.
MIT License