I have just spent the past 4 months working on taking a matchmaking service that was meant for tutors and students and have converted it over to Node JS and Angular 1. I just thought I would share my thoughts about PHP development compared to Node JS development. I took on this project thinking I was going to be migrating from PHP to PHP but using Laravel and building out a scalable API service. It turns out that we ended up using NodeJS and Angular. So I had to catch up quick. I started using WebStorm as my IDE and I got to say I have a newfound respect for JetBrains and their IDE’s. From PHPStorm to WebStorm, I gotta say that Zend Studio has some serious competition coming up. Especially in areas concerning the support of composer, npm and terminal integration. Still, Zend Server and Zend Studio along with my favorite debugging tool Z-Ray are still the most effective way of debugging most PHP applications, at least for me anyway. JetBrains IDE’s though have been the first non eclipse based IDE’s I have even found remotely in the same league. They aren’t just in the same league they are a serious contender. As always though, use the right tool for the right job. When in doubt, try them out.
First off, for those of you who aren’t familiar with NodeJS, it uses the MEAN stack but you can use MySQL / MariaDB / etc as opposed to MongoDB. NodeJS is essentially JavaScript that runs server side and can handle database interactions and do pretty much everything PHP can. JavaScript is one of the most annoying languages in my opinion to program for backend or front-end due to its syntax and the sheer amount of code you have to write as opposed to other languages. The upside is that almost all smart products today support JavaScript out of the box, making it easy to build a desktop application and API and then use the same code to build an iOS / Android application. Also, thanks to NPM (Node Package Manager) you can pull in dependencies just like you would in Laravel with composer, or if your old school include a PHP class that parses out CSV files for example. Why reinvent the wheel when someone has already built it for you? So if you need an authentication system, no problem. Stripe integration? Already a package for that. It’s almost like plug and play for coding. The same can be said for PHP though. This was the first project where I started from scratch with a team and developed a system that we had a working prototype of written in a framework called Slim in PHP completely from scratch in a different stack. The old code was only good as a visual aid or a wireframe for example. The rest of it was completely useless so we had to redevelop the entire system in only 4 short months. The PHP software was coded over a year and a half by a single coder. To his credit it was quite a robust system with many features but it obviously wasn’t planned out so it wasn’t very scalable. The database was quite messy and the code base was sloppy compared to most standards when working with a team. He didn’t have a team so I won’t hold that against him.
So first thing is we have 2 repos, the web app repo and the API repo. Angular is actually a pretty easy to use framework for the front-end. The structure is easy to understand, the framework is quite easy to use and is well organized and there is a lot of documentation. Now Angular is the framework which controlled the look and the fell of the site, all the html, layouts and such but when working on a truly scalable service it’s not like the traditional development environment in anyway. The API is built to handle every interaction with the database, so you don’t have any queries in your web application. Personally with the e-commerce platforms I work on API’s always feel like an additional afterthought that the developers added to allow other developers to access information or modify data without direct access to the software or the database. With Node we couldn’t do this. When you work with Angular sure you can use jQuery but I highly discourage it because you have to start thinking the Angular way. jQuery manipulates the DOM whereas Angular is essentially building out the DOM and you end up with a single page application.
So every single page load, Angular makes calls to the various endpoints which get returned as JSON arrays, which is easy enough. However, this is a real trouble maker when it comes to SEO as the data might load up as you scroll down the page, which allows for the page to load faster, but that data isn’t page of the pages source until you scroll down far enough, which triggers an ajax call to the API to pull in more content and images to load. I will post a follow up to this article as I just replied to an interesting UpWork project where the Angular version of the site wasn’t giving enough information for Google to parse, so the client is asking for a complete rewrite of the front-end in PHP to get the full SEO value of the content listed on the site. A lot would think of this as extreme, but the truth is the search engines aren’t keeping up with the most commonly used modern frameworks. Google is ahead of the pack but a lot of the other search engines are lagging behind. I will update this post when I get more details as this is a very interesting topic and a very good topic that developers should be aware of.
Anyhow, the project was merely weeks from launch when the bottom fell out and funding was pulled and we ended up with nothing to show for all of our hard work. I am looking into what parts of the source code could be shared legally with the public as I think it would make for a great example of best practices and be a great building block for any match-making based system in the future. I just need to make sure I pull out any of the copyrighted work and make sure that anything I release doesn’t breach any NDA’s. As soon as that’s all cleared up I would love to post a public repo link for anyone to use as a reference.
So while I have been away for a while, I just wanted to post something to let everyone know that I am still developing, Invelo of course is still getting its fair share of attention from the team and myself and the work continues. We have recently been looking into creating some apps for BigCommerce that will essentially port a few of our more useful and rather massive modifications over to BigCommerce. We are still trying to decide if we should focus on a single niche or we should just bring over the most popular that haven’t been built already by another development team. Our shipping solutions would have been great but it seems that BigCommerce already is chalk full of shipping apps. So it’s either product management, drop shipping or an upsell app that allows you to group together products typically sold together and allow for all the products to be added to the cart from a single page.
View Post