Add client side logic for chat app.