Skip to content
← Back to Community
(Template Jam) Socket.io Chat Template
Profile icon
lynnlo

Here's a chat client I made for the template jam.

It uses a express server and socket.io for the server side and socket.io client for the client side.

It's very basic and minimal but it does have some features to prevent spamming and also has a custom message sound I made (Which can be easily replaced). The chat also supports chat rooms which can be easily turned off given you know a little bit about socket.io.

Of course this is meant to be a template so everything is made to just work and designs or features that would obstruct the ease of adaptability of the template was not pursued. I did not comment on my code because I think it's decently readable but if enough people thinks that would benefit the end users then I could do it.

Please feel free to try it out invite some friends to test it out.

If you have suggests or comments please comment below.

Voters
Profile icon
akhilpil0308
Profile icon
vvcdev
Profile icon
rivestoss
Profile icon
AnnabellK
Profile icon
ThomasSheumaker
Profile icon
dudeactualdev
Profile icon
LynnOng
Profile icon
AmazingMech2418
Profile icon
lynnlo
Comments
hotnewtop
Profile icon
sovereigndawn

how do you make a log for this?

Profile icon
lynnlo

@sovereigndawn You can append message, user, and time on a text file using the fs library on the send event.

Profile icon
dudeactualdev

@amazinmech2418 maybe Firebase

Profile icon
AmazingMech2418

One thing I would recommend is to use just a plain HTTP server. Express and Socket.io each take up a lot of storage and, while Socket.io is needed (at least I think... I'm not sure what other websockets you can use), express isn't. Instead of using the express.static, you can simply read the paths of URLs and send files through the fs module corresponding to the URLs. Also, if you want to take it a step further, you could add a database system and add end-to-end encryption (I'd recommend Diffie-Hellman rather than RSA because it is easier and faster in browser JS)... Anyways, great job!