1

I'm trying to find the best way of developing a portal that a user can log in to and then be presented with a range of different apps (angular). They should share the same api-backend.

I think that each angular-app could (and should) be developed separately. The only thing I think I need to do is place the dist-folder (or create a symlink to it) in the "portal"-part.

When I say the portal, I mean the part where user is presented with a login-screen, and after successful authentication is routed to a app-menu. Pretty static stuff really.

The api-backend can be a separate express-app to make it less complex (atleast I think so).

My goal is to make the development-process effective and easy to maintain.

Each angular-app is scaffolded with yeoman, and I develop them while doing a 'grunt serve'. 'grunt build' will then produce a nicely packed app in the dist folder. I'm quite happy with this solution.

The Backend is an expressjs app, and I use nodemon to do it effectively.

My issue right now is how do I scaffold all of this ? I once tried setting up a large Gruntfile.js to build the backend, portal, and each angular-app and stitch everything together. I gave up.

As I see it, the parts I need to stitch together is:

Login/portal/menu (express/passport)
n * Angular apps
API-Backend (express/mysql)

I have a portal-part that works with passport, I have a API-backend that works, and I have some conceptual angular-apps that works.

my git-repo contains everything, and I have this structure:

 git
  |-- backend
  |      |
  |      +-- api 
  |          |-- app.js
  |          |    
  |          |-- lib
  |          |-- public
  |          +-- config
  |     
  |     
  +-- frontend
          |-- App1
          |     |--Gruntfile.js
          |     |--node_modules
          |     |--app
          |     |   |--bower_components
          |     |   |--images
          |     |   |--views
          |     |   +--scripts
          |     +--dist
          |       
          |-- App2
          |     |
          |     |--Gruntfile.js
          |     |--node_modules
          |     |--app
          |     |   |--bower_components
          |     |   |--images
          |     |   |--views
          |     |   +--scripts
          |     +--dist
          |
          +-- Portal
                |
                express/passport app

Should the portal-part and the api-backend be the same ?

Any good ideas on how to scaffold this is much appreciated :) (I even appreciate it if someone care to read my long question)

3
  • While this is a pretty good question, i believe that Stackexchange's Programmers would be a more suitable place for the topic. Consider a migration flag. Commented Feb 27, 2014 at 8:36
  • try to divide this git repository in other repositories, and link one main repository with submodules to the others repositories, since the dist/ is what matters in a frontend app no reason to have the entire bower package , of course if you declare a carefully written bower/git/npm ignore.. you wont have such a problem to work with bower only when deploying, when in development mode you basically don't have to worry about all the extra folders/files. Commented Feb 27, 2014 at 8:39
  • Thanks for your comment, the reason why I chose to check in the bower_components is because some of the packages' .bower.json do not include the proper "main"-attribute, and some of them has to be built etc. I've got enough diskspace and network speed, but not enough time to do all those changes each time I set up a new dev-environment :) Commented Feb 27, 2014 at 9:22

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.