Test the app here: https://chat.arcade.build
Read the blog for more implementation details: https://aashishkoshti.in/blog/distributed-chat-app
- For running the web
- Create
.env
file in theweb
folderVITE_API_URL=ws://localhost:8080/chat/ws
- Use npm to start the web
~> cd web ~> npm install ~> npm run dev
- Create
- For running the server
- Create
.env
file and update the env variables from.env.example
fileENV=development REDIS_ADDR=<redis_container_name>:6379 REDIS_PWD=<redis_pwd> REDIS_DB=<redis_db> CHAT_CHANNEL=<channel> WS_TYPE=pubsub MAX_CHAT_LEN=10 STREAM_KEY=<stream> STREAM_CONSUMER_GROUP=<cg>
- Choose which message system to run, redis pubsub or redis streams
WS_TYPE=pubsub # for streams keep it empty
- Use docker for running the server app, all the services are listed in
scripts/docker-compose.yml
~> cd server/scripts ~> docker compose --env-file ../.env up
- Create