This is a boilerplate for a chat application build with Typescript & Socket.IO. It consists of a client app and a server app that communicates via Websockets.
Install and run the project, then open to tabs and test it out by sending some messages!
Read the docs on Socket.IO for a better understanding of how to send and listen for events, how to join and leave rooms, etc.
Checkout the comms file, that's where you define the communcation events between the client and server.
The client app is a bare typescript project without any framework/libraries. If you'd rather code in React/Vue/Svelt then create a new project with npm init vite@latest
and remove the old client project.
Just remember to add the proxy setting found in vite.config.js
to the new project. Also the new project folder must have the same name client
in order for the configured npm scripts to work.
Will run both client and server in parallel (not optimal for output)
npm install
npm start
Open two terminals and run the following commands
npm run client-install
npm run server-install
Open two terminals and run the following commands
npm run client
npm run server
Run the follow command to remove all three node_modules folders
npm run rm-node-modules
.