How to reuse a single Ember App for multiple clients


#1

How would you design an ember app that should be used with different clients. In our specific case it will be the same web-app, but running on different POS systems - integrating with their APIs, most of them are RESTful, some are a javascript api communicating with the POS software directly. The UI stays basically the same across the clients, there might be tiny differences - i.e. for some client integration (using their iPad app) we’ll show error messages inside the native app by using the javascript-bridge to their app.

My initial thought was to move the data-adapters/serializers/initializers to an addon

  • one per POS, but then I struggled figuring out how to run each site
  • how would I use addon A in domain/app-A vs B in domain/app-B.

Ideally any A-addon specific code shouldn’t be sent to the browser in domain/app-B (even if not used at all)

So what I’m basically trying to find out is which way I should go:

  • add an addon for each POS, or
  • give each adapter/serializer it’s own POS-specific name and decide which one to use according to the (POS-specific) url-path, or
  • is there even another, better way?

Would I pass ember-cli a parameter at the serve/build command to figure out which addon to use?

(sorry if thats an easy one, but it’s my first ember project and coming from backbone it’s still difficult to think in the right/ember way - that said I’m very exciting about learning/using Ember)