Skip to content

SeanOverton/golang-chat-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go chat CLI

I made a CLI chat app because I wanted to understand scaling services that have stateful websockets.

Simulating a scalable architecture locally

The main topic this project demonstrate was a scalable architecture for a system that uses websockets to communicate with clients.

Inspiration: https://www.youtube.com/watch?v=hl3_MANBiyc

The setup we are tring to achieve locally is here. (Image generated by diagrams.py in ./media directory) Local setup

Generating the image

  1. cd media
  2. pip install -r requirements.txt
  3. Download graphviz and add it to your PATH https://graphviz.org/download/
  4. python diagrams.py

How to set up the chat CLI

  1. Build server image.

cd server docker build --platform=linux/amd64 -t golang-chat-server .

  1. Run docker compose to spin up 2 servers and rabbitMQ.

docker compose up

  1. In 2 new terminals, start 2 respective clients connecting to the seperate servers.

cd client/src go run main.go localhost:8080 go run main.go localhost:8081

  1. Happy chatting.

About

scalable chatapp webserver using websockets and simple CLI chat app. Both in golang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published