A chat app experiment consisting of a Node.js server and a JavaScript app running in the browser.
- Navigate to the project root directory
- run
$ npm install
- run
$ npm run dev
to start the node server withnodemon
(auto server restart after file change) - Open a new terminal tab and run
$ npm run watch
(auto-rebuild with babel compiler)
- Open a new browser and navigate to http://localhost:3000/
- Enter a email address as your chat username
- Ideally an email address bound to a Gravatar account
- Each new browser tab kicks of a new socket stream, binding to
ws port 3001
connecting to chat room 1 by default - User starts in room 1, switch chat rooms with the dropdown
- Handle HTTP requests & transform file-paths
- Import websocket-server
- Websocket Server
- Listens to new client socket connections
- Registers users and places them in rooms
- Broadcasts messages and configures new users with message history
- Define the structure of messages
- Pass messages between client socket class and DOM
- Queries the DOM, and acts as interface to App module
- Manage WebSockets communication for the client
- Connection handlers, message handlers etc.
- Better styling, throw away bootstrap
- Add cool chat features found in popular apps, such as, Slack