Ask coding questions

← Back to all posts
How do I create a chat system?
LloydChittock

Hi repl community, I know it's tempting to just read the snippets when you see a beginner coder's post, but you're really going to need to read through this one to understand me. Oh well, it doesn't take superpowers to know that if you've read so far that you opened it... So let's get down to business!

Textify Messaging System

Textify messaging system is a chat server that I have decided to create as a way to begin my software development career and even start to get out there in the programmer community. However, since I'm only a human (you can guarantee that a coder like me couldn't have made a bot to say this...) I need some help with a couple of things- and those things I give you a million pleases for!

What programming languages should I learn? Are there any other things I need?

I know this much, it takes much more than just HTML/CSS/JS to code a chat system. However, I don't exactly know where to go from there. I have it on my plate to scrape through my Python and C++, but if there are any other languages that you recommend please reply and let me know! Also, since I know so little about this I probably won't even ask the questions right, so I'll just say this- what resources do I need? e.g. Web domains, Something I heard about so called WebSockets, etc. Please let me know!

Textify Team

Since I know I'm not hot-stuff or any one-man-army, I've created a team for anybody, anybody who wants to help hands on! There are no qualifications, if you are willing to help and push through this alongside me whether you too are a beginner or expert programmer, you may join! Just let me know in the replies and you should be invited shortly. There may also be the incentive of potential earnings... I'm not sure how we would go about that yet, but if we end up publishing and selling an offical app/platform, then you have every reason to expect an equal share of the profits!

Thanks Again!

Well, that's all of the problem's I have to give you for now, thank you all for taking the time to look at this and help! Please just leave a reply and I should see it. I love Repl.it because your guys' dedicated collaboration environment and caring community is what makes it so awesome!

Thanks a million!
@LloydChittock

Voters
V0RT3X21
programmeruser
Baconman321
SixBeeps
Comments
hotnewtop
Baconman321

First of all, let me congratulate you on your wonderful writing skills. Most beginners (and even some more experienced replers) will write "How do I do this" or something of the sort. I would recommend learning a backend for this. Usually, PHP is my preference... but for this one I say use Nodejs.

Nodejs is very popular so you are likely to get a lot of help. Nodejs is really good for this kind of stuff, and since it has the same syntax as JavaScript it's easy to get going because you can recycle your JavaScript skills (to some extent), which you will also need for this. Lastly, yes. I can join your team if you want. I may not be able to help that much since I am helping another fellow repler, but I will definitely help when I can.

Best of luck, you are going to ROCK the coding world, I can already see it in you.

-Baconman

LloydChittock

@Baconman321
Thank you so much for your advice and support! You should see an invite to Textify Team in your teams folder. Thank you!

Baconman321

@LloydChittock ok! I'll be there when I can :D

MicroSoftHelp

@LloydChittock If you would like, I could help with the protection end of things so you aren't vulnerable to xss attacks.

Baconman321

@MicroSoftHelp Honestly, wouldn't that be an easy fix? Just filter out html special chars and such?

MicroSoftHelp

@Baconman321 you would think, but there is ways to bypass that too

Baconman321

@MicroSoftHelp Just use a library to filter those things. You have to filter nodejs commands, and html characters, as well as script commands (probably others too).

xxpertHacker

@Baconman321 There's too many bad libraries out there to count.
Also, XHTML makes markup escaping effortless.
In 2 lines I could escape an entire paragraph of markup (in an XHTML document), in any programming or scripting language that I know (and you could too).

Baconman321

@xxpertHacker How tho?

xxpertHacker

@Baconman321 Go check my source for that webpage that was on the post :).

https://www.educba.com/xml-cdata

maxina

Well, you can basically use an language you want, I've only used python for online multiplayer stuff, using sockets. I suggest you start with this:
https://www.youtube.com/watch?v=3QiPPX-KeSc

xxpertHacker

I have it on my plate to scrape through my Python and C++, but if there are any other languages that you recommend please reply and let me know

The first part of your sentence indicates that you have previous C++ experience, in that case learning Rust can't be too hard, especially with prior experience in C-family languages.

Rust is an incredibly safe language that should result in few runtime errors.

A Rust user had said:

If you trust the Rust core team to root out unsoundness in the standard library, you can let even junior members of your team write safe Rust code on top of it, protected by all of Rust's safety guarantees...

Plenty of people have, like any other language, talked about their experience learning the language:
https://fasterthanli.me/articles/frustrated-its-not-you-its-rust

Even if it ends up being hard, eventually, you'll become good with experience.

(btw, they have a good community that you could probably ask for help)


I don't know it myself, but the entire Repl community seems to like Python, maybe that would be good to learn?


I know this much, it takes much more than just HTML/CSS/JS to code a chat system.

Hmm... so, here's the thing, forever, that was true, but think about it from this perspective, a JavaScript user doesn't want to learn a new language, so they could never have a server. Eventually, someone went around and just made a server-side runtime that runs using JavaScript.

Now, someone else had learned the other languages that you would've normally needed to know. This changed how a number of developers did stuff, why learn a fourth language, just reuse JavaScript!

There's nothing wrong with choosing not to learn a new language... I guess. :/

There were two runtimes made by the same person, Coder100 already mentioned the older one, Node.js, but the other one (and the more superior one,) is Deno.


... what resources do I need? e.g. Web domains, Something I heard about so called WebSockets, etc. Please let me know!

There's a whole plethora of technology out there, you can't possibly expect to learn it all (okay well, technically you can, but whatever), so you'll only need to know what is useful, likely you'll just need to learn more on a need-by-need basis.
In this particular case, you will definitely need to look into WebSockets.

WebSockets are a protocol allowing servers to push data to a browser without the client explicitly asking for it, in your case, that data would be new messages.

You could look into them on the web, here's a few links to get you started:


Rust has some good HTTP libraries:

Deno's third party OakServer is good:


I've written about alternative markup languages to HTML, yet, there is no "good" markup language that is supported by any browser.

Belive it or not, HTML is actually not a great language for developmental productivity.

I'd recommend trying to use an alternative markup language that compiles to a supported browser markup language, for example, Pug:
https://pugjs.org/language/comments.html
https://medium.com/@bretcameron/so-you-think-you-know-html-7813c03f8ff6

You'll need something that has templating, afterward you'll never look back.


... I forgot what I was going to write next, but good luck with your application!

Whacko

Read this.

Coder100

Programming languages to learn

The things you have to learn yet should be quite small. I recommend you learn in this fashion:

SixBeeps

>>> NodeJS + Express <<<

Best backend duo for literally any web-based project. In your case, you'll probably also want look at SocketIO, which is an alternative to WebSockets. Be sure to look into both, as they each have their advantages and disadvantages.

AloegelhiPlaysR

I'm not here to help you but to congratulate you. You've put some good effort in this post. I personally wish you the best of luck.

ReferenceError

You're looking for sockets with node.js. Socket.io is good for this, but you can also use websockets as well.