angularjs - How to build multiple applications from a single code base in Angular -
i'm working on angular application. based our application on https://github.com/swiip/generator-gulp-angular , working fine. angular seed project scans js files in directory , concats them single js file when go production.
we're building admin backend billing system. client wants "public backend" clients. place clients , log in , send messages basically. ui same public backend, re-use same directives everywhere. problem public backend tiny , admin backend huge. don't think serving full admin app random client practice.
how go building 2 applications same code base?
don't serve 2 applications same codebase. recipe disaster. rough outline of how handle this:
- audit application have built. identify components reusable between 2 projects , establish base project project.
- if built things modularity in mind, shouldn't back-braking. may need refactor right position. john papa's angular styleguide great place on front (it's been great i've learned angular).
- turn base front-end project bower dependency updated independently of custom application code. more on creating bower package here. maybe open-source you've built?!?
- build custom functionality on top of modularized base build. each group of custom functionality 1 of applications (in case sounds admin panel , public app).
- post launch, manage apps 1 product team if same. identify features common, build them base app , deploy changes via bower 2 custom apps. add in custom functionality on per-project basis; if codebases diverge enough, separate 2 product teams.
as noted others, manage apps build tool grunt/gulp pull in common dependencies you.
Comments
Post a Comment