I am still quite confused about REST API, Angular and so on.
I would like to build simple web app which allows users to book events and I would like to do it in Symfony 3 + Angular.
In future, I could make it work on mobile phones as well.
The reason I want to do it is to learn symphony 3, REST API and Angular better and to increase chance I will get hired.
I have few questions:
1) Apart of the fact I am going to learn Angular what is the real benefit of using Angular rather than twig templates and HTML for the front end ?
2) As far I have seen people usually suggesting light weight frameworks to build REST API. Why would not they suggest symphony ?
3) What would you suggest to build to show you have got good skill set to get hired ?
1) Angular a complete framework. In your case, you would use angular as front end. This would be two options.
First one is completely using Angular, Symfony serves the RESTful API. Then twig is not involved anymore.
The other is used Angular within twig, acting like a server side rendering Angular. This way is not very common right now, rather less examples could be found.
In any case, Angular could provide single-page application, which could give your users better user experience, faster load speed, move the html view part completely to browser(make server less tasks regarding rendering the view). You could also achieve this by using twig+javascript, but it would be a bit more complex depends on your skills.
But in my opinion, the best benefits would be separate the frontend and backend from architecture perspective.
2) Symfony is a very complete PHP framework. Building a REST API is only an example of using Symfony. And in this way, some features from Symfony could not be used. I would say some lightweight framework would deliver the same result as using Symfony. It would also be easier using some lightweight framework(less code, less configuration, etc.). However, the performance of Symfony and large community might also need to take into consideration when you choose the right framework.
3) Always a good protfolio by showing your experience and skills.
Related
I am programming a spring-boot project. I only want to create the backend. Another developer will later on create the frontend with AngularJS.
I want to develope my backend without spending to much effort to create a test-frontend, since I dont know anything about JSP,Angular..
What should my Controllers(#Requestmapprings) return (Model, ModelAndView,JSON-Objects, Strings, ...??), so the angular-developer can use them for creating the view?
Is there any easy way to develop my backend without creating a frontend at all and still being able to test it somehow? I dont want to spend time to create basic Forms/Buttons/checkboxex but i would like to check if my scripts are working..
You must start looking into REST services.
https://spring.io/guides/gs/rest-service/
To see how it is consumed by angular please refer.
https://spring.io/guides/gs/rest-service/
You can get lots of tutorials and documentation on developing REST services independent of frontend.
I would suggest taking micro services approach based on the UI requirement and then segregate the services based on the functionality. This would make the code maintainability and development easier. If you are going to use spring-framework, it has vast stack of features, which are production ready.
Hi i am a beginner to nodejs & angularjs.
I have a requirement for an angularjs application, i am planing to do the back end REST API's using expressjs.
For my application I have two parts; one front end UI for general users & one admin panel or managing the entire application database.
I found a number of angular-express seed projects on github.
So my question is that which one is the best choice for me among the following :
1. Doing a single app using express+angular(is it possible to create a separate area for admin)
2. Implement a middleware for REST API's and admin panel using node. Then do a separate angular-seed project.Host the two app separately.
Another question is that whether I should use express or sails js?
Anyone please can help me.
Thanks in advance.
If you're new to AngularJS i'd strongly recommend starting from nothing so that you get an overall look at how everything comes together, my personal experience is that it's better to use seed projects or generators should once you have a basic understanding of how an AngularJS and nodeJS project comes together
Technically both option one and two are valid however I would go with option one, this means you can build authentication and authorisation into your application and use that to stop people accessing the admin section - This reduces complexity because you don't have to manage multiple projects and may also benefit you personally as it allows you to dive into security and expand your knowledge.
Should you use express or sails? That comes down to exactly what you're building - each library has it's own pros and cons, i'd say it's down to you to weigh up these pros and cons and make a decision on what library you would like to go with.
You can use app generators. One of the best generator is Yeoman
And here Yeoman generators you can query the generator you want
what are the advantages of using 2 MVC architectures(frontend and backend) in same project. AngularJS and Spring MVC.
Without using AngularJs, can I update single div data without loading the entire page? Is AngularJS responsible for updating single <div> data out of multiple <div>s without loading entire page? If so, please explain in detail.
Once you have a single-page application you have to make sure all the different parts of that application are consistent, that's what the MVC/MV-Whatever in the front end is doing for you. That's not an issue in an old-school web application because the relevant state is regenerated with each request, but once the updates are coming in bits and pieces then different pieces of the front end need to be coming from the same model and that model needs to get updated consistently.
Obviously you can implement div updates with raw JavaScript, you don't need frameworks just to do AJAX. The JavaScript frameworks are written in JavaScript, after all. The frameworks and libraries do make things easier by doing things like papering over browser inconsistencies and providing convenient and useful features (like databinding in Angular).
The server-side MVC does become less complex and involved than it was in the old-school web application, you have less POST-Redirect-GET going on, the front end is more in control about what it is asking for. The front-end application is decoupled much more from the server-side because that whole server-side view layer of JSPs or Facelets or whatever is greatly reduced or just missing, instead you have services supplying JSON over HTTP and there is a much more limited, well-defined contract.
You can update a single element of your page without using AngularJS. As an alternative, for example, you can use JQuery.
You should wonder for the best approach for your project. This answer explains very well the differences between this two approaches.
As an aside note, AngularJS is not exactly a MVC architecture. Instead, the community has decided to call it MVW (Model View Whatever). Check this source for more details.
I'm thinking about upgrading my site. It's a trade place a lot like ebay.com.
My site is build in Laravel 5.1, but without any front-end framework. Because of that, I was wondering if it made any sense to use a front-end framework like angular js?
Pros and cons please.
I don't know that much about angular js, but if I convert my laravel application to fully obey the REST principles, i'm also well suited for building an iOS-app when that time comes???
http://tilsalg.dk - Link to my site
I don't know whether it is suitable to use angularjs for this purpose. The problem is as far as I am concerned, that website which are written in javascript (so angular) can not be indexed well by SEO's. I'm hearing a lot that Google can index it but I'm a little sceptical about this. For a trading website like ebay it's very important that the site is SEO optimized. Of course if you use REST principles you can always change the frontend and that is also the way to do it.
I'm planning to build a webpage that compares large amounts of products.
I need faceted search/filters for that, so the visitor can filter the product on price/color etc.
I couldn't find a ready to implement webshop script for that, so I'm planning to build it myself.
I'm a fan of Laravel, but to avoid page refreshes if the user is changing the filters in the side bar, you need a kind of AJAX calls to your Eloquent ORM.
So that's when AngularJS can be handy, but now I'm confused if I do need Laravel for such a stack. Because if you use AngularJS and MongoDB, you don't need Laravel at all.
So I'm not sure what is best practice.
Disclaimer: I know nothing about Laravel, but a quick google tells me it's a PHP framework for making a restful API.
The 'standard' stack for angular apps at the moment is the "MEAN" stack. That is: MongoDb, Express, Angular, Node. I'm not sure this can be considered a "Best Practice", because it's not necessarily better, but it is definitely the common practice, and as such will be easier to get support and help with.
All that being said, angular really doesn't care about the back-end. It's a front-end framework for making single page web applications. All it really needs is a decent API that you can access by creating a custom service. There is no reason you can't replace node and express with PHP and laravel, and mongo with SQL, you just won't get such a nice acronym!