Develop backend (Spring) without frontend (angular)? - angularjs

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.

Related

RESTFUL App in symfony 3

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.

express angular single page app archetecture

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

Should I use Angular for a local only NW.js project?

I want to build a mid-size application using NodeJS and NW.js (formerly known as node-webkit). The application will grab some data from the internet but isn't talking with one special service which is under my control.
Is it a good idea to use AngularJS nevertheless or is the MVC approach of Angular oversized if there isn't neither a database nor a webservice on the controller layer?
I think Angular would be really fine for databinding and GUI handling, but I'm not sure if it's the right approach for this kind of application.
I see no reason not to use Angular in an nwjs project. I do it myself in the app I just finished building. It's a local-only deck tracking app for hearthstone that never communicates over the internet at runtime. It only ever monitors a log file that is generated by the Hearthstone game. Since the way I'm display information to the user is still technically a web page with a full DOM, Angular makes perfect sense since I'm already comfortable using it.

Should I use Angular JS for faceted search?

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!

Laravel and Angular.JS - Web App Dev

I have started learning Laravel and Angular, for one of my project at university. I want to rebuild the website www.lolcalculator.com with these two frameworks but I cant figure out exatly the best way to do that. From Laravel I want the less posible, because I will focus on Angular.
Can someone with more experience help me?
For example, do I need to use routing on both sides? Which functions of the website I should cover with Laravel(Mailer, Auth, Routing...) and which using Angular?
I just need to understand a bigger image, not in details.
Tnx a lot.
All the best :D
There's quite some information on the net regarding Laravel and Angular, but this one in particular is one that I found useful: http://scotch.io/tutorials/php/create-a-laravel-and-angular-single-page-comment-application.
You may also want to consider writting a front-end app in Angular and a separate back-end app in Laravel. The back-end app can then expose an API, consumed by the Angular front-end.

Resources