I would like to combine the two generators jhipster and angular.
The jhipster entity generator generates entities for both spring/JPA and angular route/view/controller.
A REST point is not always linked to a view, hence I would want to generate the java and angular parts separately. Are there common practices for these issues?
Have you tested out the JHipster framework itself? I hate to ask such a basic question, but if you look at the structure of what is being delivered by hipster, you'll notice that the Spring API controllers/endpoints are all going to be under your main/java/com/[projectname]/web/rest folder, and your Angular calls to those endpoints will all be mapped under the /webapp/scripts/ folder as part of your Angular services file. If you simply want to remove the Angular views and customize, it should be as easy as deleting those files from your project.
However, if you are looking for another form of REST scaffolding tool, my suggestion is to look up http://forum.spring.io/forum/spring-projects/roo if you want to go build based on your entities or DDL2HBM if you want to build based on an existing DB.
Related
I am familiar with developing AngularJS and Angular 2/4 UIs utilizing JHipster 4's JPA CRUD scaffolding but it feels unnatural. And I think developing MEAN-Stack UIs is the path of highest productivity.
How much refactoring is involved utilizing MEAN-Stack UIs with JHipster JPA (MongoDB) and Angular scaffolding?
Also, if using JHipster's new React support, how much refactoring is required to utilize MERN-Stack UIs with JHipster JPA (MongoDB) and React scaffolding?
Oh, I forget to mention my development target is PWAs (Progressive Web Apps) aka mobile first design.
You'll have to fork the jHipster generator, add your own templates for mongodb, express.js and nodejs.
The server side templates are mostly in generators/entity-server/templates, and generators/server/templates. These template files are written as EJS templates (EJS).
One of the steps during the app generation is to create JSON files from the JDL file. You can run just the json creation using a command like this:
yo jhipster:import-jdl jhipster-jdl.jh --db=mysql --json-only=true
The JSON files will get created in .jhipster folder (note the "." in front which makes the folder hidden) under your project.
Create your own sub-generators similar to the "server" and "entity-server" sub-generators, that use the generated JSON. The templates will have JavaScript that uses nodejs, express.js and mongodb, instead of Java with JPA, and Spring Boot.
This is not going to be easy, although you could follow the JHipster code and create the sub-generators.
I guess someone might have already done all this in one of the forks from JHipster, in which case you might want to start from there.
I am new to AngularJS and need some advice on how to structure a SPA with Web API for an external search application
Di I have to use
•MVC / razor views (leave all routing and rendering to Angular)? or just use 1 VS2015 app [use angularjs SPA template for VS2015 or just an empty web application with angular file and a webapi project under same solution?
any examples would be helpful to understand
For angular structure I am reading Google best practice and John Papa
Well, I think what you ran into now. I can suggest two of the ways you can choose.
If you want to keep your backend and frontend together you can go for angularjs SPA template for VS2015. It would come with the build pipelines, bundles and everything you'd need. Now you can choose to render your single page of angular to be rendered with a MVC razor view (if you want to have any mechanisms where you'd want to include your dependencies through the razor view) or just go with a blank html and web api controllers on the back. But you'd end up using one environment for all and I think that's best if you're building the full project.
Now, for the other way around, you can start with an web api project. You can instantiate your angular project with it or somewhere else. You can use yeoman or any scaffolding tool you like and use your own JS toolings you'd like to use. You can do the same in the VS project too but this approach is better if you want to keep the frontend and backend flavor separate.
And I'd suggest using typescript too.
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
I have an existing webapp built on Laravel. I am moving to an Ionic build to create the native version.
How would you suggest I separate my views, and how do I call the routes? Has anyone any example.
Here is what I am about to do:
1. move all my views to the public folder
2. install Ionic in the public folder,
3. Using UI-route & Angular make $http calls to the backend.
Thanks for your input :-)
You can't simply do that.
If you have a "classic" Laravel app with blade templates, what you need to do is to expose an API from it.
Then you create an ionic app in a different directory (they are not related, so you don't have to mix them). You just need to develop your ionic app like any other ionic app. Then in your factories where you do the request to your API, you do something like:
$http.get('https://example.com/api/foo')
Where example.com is the domain of your Laravel application (You are going to need to activate CORS in it).
You just can't simply create an ionic app inside laravel, because that application will be built into an .apk to be installed on the phone and you can't add Laravel inside the package.
So the TL;DR is having your normal Laravel app where it lives, add it some public API so your ionic app can access it and then build an Ionic app from zero that will use that API.
It depends on you, but I prefer to keep the ionic project nested in /public, since I want a single-project app, the sources are clearly separated by being or not in the subfolder, but it helps your productivity, benefits are:
Single source control: Single source set for source version control (GIT, SVN, ...), so when I work I can do a single pull/checkout and push/checkin
Single app to deploy: Single domain, no cross-domain problems, single deploy via FTP is available, any standard php server can handle it with a single and standard account to handle
Coherent project without interdipendencies: I do not want to split logic dependencies of the same model between many projects, when I change something in backend or frontend that involve the other side, I want to have in the same project all the sources to update. It make not sense to have to go to a different project to adjust compatibility, it would be uselessy messy
I need to add new features to an already existing application. The application is built using Lithium and jQuery. The features that needs to be included have a complex view which allow users to analyze data and perform CRUD functionality. I won't go into details about the features here, but after working on a few simple Angular tutorials and side projects, I know that using AngularJS to create this view will make my life a lot more easier than creating the view using jQuery.
Over the course of the next few months we may convert the entire app to AngularJS.
I am uncertain about where I should place the Angular files and how to setup routing. How can I integrate AngularJS to Lithium so that part of the Lithium routing works and part of it is handled by AngularJS.
I also found this answer on stackoverflow but it doesn't mention folder structures or how to integrate Angular with Lithium. I think this link mentioned in the answers is supposed to have what I am looking for but it doesn't seem to exist anymore.
The link is down, but you can clone the source repository and run it yourself here: https://github.com/nateabele/li3-angular-presentation
Regarding organization, the simplest way would be to place the directory structure for your Angular components inside of /webroot. The more advanced (and in my opinion better) way would be to make them two separate applications: an AngularJS UI app, and a backend API in Li3 that it talks to.