How Best to Replicate This App or Codebase? Packages or multiple apps?
My partner and I have built a fairly large Laravel app that provides a solid foundation for the business needs of our company. Some refactoring is likely needed now. Each of our clients will use this base app, but in drastically different ways. The clients differ so much in their requirements that logic in models and controllers usually has many differences from client to client. Unfortunately I have no control over the requirements of each.
I'd like to host a separate version of the app for each client to ensure changes for one client don't break functionality for another. Does anyone have experience hosting (many) similar, yet separate and different apps? What is the best way to go about it?
I have considered making the current version of the app a 'base' git repository and making each client a fork.. but it seems like quite a bit of work.
Another idea I had was to 'packagify' what I currently have as a base app, then use it (and extend where needed?) in each specific client app. How feasible is it to go this route? If it is indeed my best option, where do I start?
Thanks to All! I'm happy to clarify details if needed.
Edit: In refactoring the app should I look to use a command oriented structure or repository pattern? I have a basic understanding of these topics (especially the latter) but want to make sure I make the best decision.
Consider using Git submodules. They allow you to reference other repos for particular functionality. A good article is available here:
http://blogs.atlassian.com/2013/03/git-submodules-workflows-tips/
And here
https://devcenter.heroku.com/articles/git-submodules
If you want a more package manager like setup checkout Private Composer, like Satis
https://getcomposer.org/doc/articles/handling-private-packages-with-satis.md
Personally, I think a command-oriented approach combined with repositories the greatest flexibility in customizing the needs of your app for different clients. Why? Both methods make it very easy to tack extra functionality onto your existing codebase without having to actually rewrite existing code.
Thanks for the suggestions. Git submodules are unfortunately not what I'm after. I'd like to replicate the app and have a clone for each client, but I don't want to have to maintain the 'core' functionality in each individual clone.
The current app has too much logic in a traditional model and should be refactored nonetheless, but where do I start when refactoring to command + repository architecture?
Also, is it possible to architect things in a way so that everything from this app could be extendable from within a package? Could I refactor it into a 'core' package and then be able to extend / override views, models and controllers as needed? (or repositories / commands)