generator-angular-fullstack icon indicating copy to clipboard operation
generator-angular-fullstack copied to clipboard

Use only backend

Open nschurmann opened this issue 9 years ago • 6 comments

I really love this generator but the main thing that holds me back of using this in a production environment is that i need to use it with reactjs. Is there a way to decouple this generator? or at least have some guidelines to implement it with other generators.

nschurmann avatar Jan 17 '17 18:01 nschurmann

If you really like the back-end setup of this generator, but want to use a completely different front-end, that's up to you. It's been discussed before, and anything straying away from a 'full-stack angular + node' generator is out of this project's scope. If we wanted to do something like that, we'd have to rename the project. (I'm still not saying that that's entirely impossible)

I don't think it would be too difficult to use React on the front-end instead of Angular, especially with versions 4.x.x+. You'd need to make sure you enable JSX for TypeScript, or the JSX/React Babel plugin. Then I'd start with removing everything in client/app/app.js, and building a React app out from there.

Awk34 avatar Jan 19 '17 17:01 Awk34

I already used this generator as the base for server-side only backend, especially because its authentication mechanisms.

To do so, I simply removed the client part (and clean package.json + build files).

However, I think that this kind of fullstack generator should be split in 2 parts, because:

  • it is useful to have 2 separate gulp consoles while debugging (one with client logs, one with server ones)
  • it make it easy to use the client or the server part only
  • it could help to merge the energy of theses many interesting projects (the server side of react-fullstack & angular-fullstack should be the same code) = less work for generators developers + better generators

Toub avatar Jan 26 '17 20:01 Toub

Totally agree, maybe we can fork this project and use only endpoint generator and the app generator to provide a structure for the app.

nschurmann avatar Jan 30 '17 13:01 nschurmann

@nschurmann any fork for endpoint generator ?

Djalmar avatar Mar 31 '17 15:03 Djalmar

You can authenticate the same way this client does. Is the other app also an angular application?

On the client side, you have to do:

  • http post from login page
  • decode return token, and probably save it to sessionStorage or indexDB
  • add the token to http headers to authenticate you requests

Hope that helps.

Toub avatar Jul 21 '17 14:07 Toub

If anyone's interested, I've started an experimental combination of the angular-fullstack generator (using MongoDB/HTML/SASS) and react-slingshot here: https://github.com/rvillanueva/react-fullstack-starter

It has a few significant changes, like losing the yeoman generator integration for now and the gulp/grunt pipelines in favor of simpler npm commands.

My main goal is to use it as a boilerplate for my own projects, but might be useful for others in saving time dealing with correctly setting up webpack and basic authentication actions.

rvillanueva avatar Dec 25 '17 23:12 rvillanueva