Skip to content

RitulBhatnagar/scalable-chat-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build and Deploy a Chat Application That Scales Horizontally with WebSockets and Upstash Redis

What I have use?

  1. Fastify - Backend
  2. Websockets - Realtime
  3. Next.js - Frontend
  4. Tailwind & Shadcn UI - Styling
  5. Redis - Pub/Sub
  6. Docker/docker-compose - Containerization
  7. GitHub actions - CI/CD
  8. DigitalOcean - Host the backend
  9. Vercel - Host the frontend

System architecture

Screenshot

Data flow

Screenshot

Debugging

Websockets

  1. Using wss:// and not ws:// in production
  2. Use debug mode in Caddy server
{
    debug
}

Docker

  1. List our running docker containers
docker ps
  1. Stop a running container
docker stop <container id>
  1. Remove a container
docker rm <container id>
  1. List out networks
docker network ls
  1. Remove a network
docker network rm <network id>