Search code examples
javascriptphpsingle-page-applicationrestful-architecturedesign-decisions

Single Page Application - Should I use MVC Framework on the server side?


I'm developing a SPA application and I can't decide, whether to use server-side MVC framework or not.

I have chosen AngularJS as the client-side framework. I was thinking I could use Symfony 2 on the server side, but I also considered using pure OOP oriented PHP. Something like this - database class, model classes (User, UserDbManager, ...). I would use something like Slim to create the REST API.

It seems counterproductive to basically write the same code twice, once on the client side and once on the server side, if I could just use the server to serve the data from the database.

If anyone had done similar decision, I'd be happy, if you'd share your thoughts and tips about it.


Solution

  • I would decide depending on the complexity of the requirement.

    If it's a very simple I don't see a huge difference in using a framework or plain old php. But if it's a complex project, I would definitely go with a framework considering the fact that most of the core functions one might need are already there and quicker development. Again, it would come down to personal preference too.

    Codeigniter has been said easy to learn for beginners in framework. Symfony and zend are more commercially used (I am not saying others are not, but I see more vacancies asking for symfony or zend development experience).