News for hackers. Stuff that matters.

Ask HN: Node.js with PHP application?

So the application that I am currently working on has a backend written on PHP (CodeIgniter) and MySQL. I am using AngularJS with Yeoman Angular Generator for frontend. It's basically a SPA. The backend is written to serve as REST api with multiple endpoints. I want you guys to give feedback on my tech stack choice. Thanks in advance. (the application is yet to be deployed)

I want to develop a dashboard for this application in which I want it to update realtime. I was wondering if Node.js with socket.io is a good choice. I would also want to know how to integrate it with my PHP and MySQL backend?

( 2 comments | 2 points | on HN )
Re:Ask HN: Node.js with PHP application? by mattkrea on Saturday June 27, 2015 @10:50AM (#9790324)
As much as I'd love to say "rewrite all the PHP in Node too" :-) yes, your description will work. After a few years in production it seems to me that Node's best position is right between the browser and the backend. Translating legacy APIs into modern, easy-to-use services.

In your case you might want to add some web hooks for the PHP application to let your Node layer know that things have happened which you can then send over Socket.IO. There may be a more efficient way to do this by tapping into the database directly though I don't tend to like going that route usually but that may just be preference.

Re:Ask HN: Node.js with PHP application? by mailanik on Saturday June 27, 2015 @01:38PM (#9790871)
Yah even I was thinking to re-write the application but again I will definitely affect my release time.