Use Twilio Chat SDK along with Twilio Flex. Makes use of Undocumented Preview API from Twilio.
To start the server on localhost:4000, do the following:
cd server
npm install
npm start
Let the server be running.
From the root folder, run
npm install
npm start
Browse to localhost:3000 to see the chat window.