5 ms·
Show HN: Realtime Chatroom Built with Laravel and VueJS
- cwyers 9y agoFrom the article that this code is from: > In today’s article, I am going to create a chatroom using Laravel 5.4, Pusher and VueJs. Since these tools are popular and almost every developer has heard of them, I will skip the theoretical introductions and discussions and go straight to the fun part. I, uh, I don't think almost every developer has heard of them. Even making the names links would help.
- prophesi 9y agoI'd say if you're a PHP dev, you'd know what Laravel is. And Vue is up there with React/Angular in popularity for Javascript devs. Pusher is the only odd one; You'd probably only hear about it if you've looked into real-time communication technologies.
- Jaruzel 9y agoI must be so old. I spend all day sitting on an IRC style 'chatroom' with a bunch of friends, that was written about decade ago. It uses a combination of javascript ('ajax') on the client side, and crappy ASP on the backend (because the only server at the time that was available was a Windows server). The comms is very simple asynchronous polling and formatting/parsing javascript. In fact the only updates over time have really been all client side to take advantage of new browser features. It works through firewalls and proxies (which websockets still do not) - basically anywhere you can see a modern webpage. My rambling point is... you don't need all these frameworks to push a message to a server, and fetch back a list of new ones. In fact for low volume handful-of-users chat traffic you don't even need a database (gasp!). I know we should all avoid re-inventing the wheel where possible, but are you (not 'you' the OP, but 'you' the fictional reader) really a web developer, if all you are doing is gluing ever changing frameworks together ??
- 1ba9115454 9y agoYou're friends were replaced by chat bots long ago. We've all been watching you like a mini ascii truman show.
- Jaruzel 9y agoI had suspected that actually.
- rakoo 9y agoThen that's good, because you already understand perfectly what is being built so you can focus on the how. Which is the point of the article.
- deleted 9y ago[deleted]
- yunyu 9y agoMost applications use SockJS or Socket/Engine.io instead of raw websockets, so you get the latency benefits when websockets are supported while still functioning (probably better than AJAX on a timeout with long polling) when they're not. I know your old architecture was simpler, but fetching periodically from a server is high-latency and bandwidth inefficient.
- Can_Not 9y agoMost people are here to learn, to build something more advanced, and/or to build something prettier. No need to condescendingly pretend like everyone else should be judged by your needs and nostalgia in a chat room.
- Jaruzel 9y agoI wasn't. I was challenging the modern need to just bolt pre-existing frameworks together. I WAS hoping for a discussion about it. Maybe my intent was not clear. Apologies.
- 9y ago
- MikeB1089 9y agoIS it me or is php syntax like this : public function __construct($user) that makes php seem to be abhorent? (Well, i am speaking for myself) Why would you use your time and energy to build another rails like framework when you could work on something better? One reason not to program in PHP is because of this old timer syntax. Do you like how php arrays are constructed? Really, tell me. I really want to know. Can we please move forward? I would rather see someone work and improve other frameworks such as django. And all these "implements" in Php. Weren't they copied from Java? I will take Java over everything else. Php is dead. Let it die. I am sure it was an ok language some time ago but there is no way to resurrect it by copying other frameworks over. Unless of course, it provides a easy entry to web programming, hence, saxophone players(not software engineers) write spaghetti code like wordpress and then they become mainstream and "successful". I am sorry for my vehement ranting by I am getting old and I see no impovement in software...
- Can_Not 9y agoSorry to bust your ignorance and/or biases, but laravel is actually a really powerful modern web framework and PHP7+ is marching right into the modern programming era.
- nickthemagicman 9y agoYou're making such negative claims.... based on not liking how a php constructor looks? A php array is pretty standard syntax... ['x' => 'y', 'z' => 'a'..] I've worked in both Rails and Python and PHP 7.0 is actually equivalent to most modern web languages. Type hinting, lambdas, function chaining, generators, etc., etc. Spaghetti code is because of the developer not the language. I'm sure even Erlang has it's fair share of spaghetti code apps. Put the haterade down!
- cutler 9y agoHave you seen Laravel Collections (https://laravel.com/docs/5.4/collections https://laravel.com/docs/5.4/collections)? It's a language extension which takes the pain out of PHP arrays.
- devwastaken 9y ago