1

I am building few sites for my company's client. The sites are mostly the same but could have some customisations.

so we decided to create duplicate sites instead of multi-tennant and we decided to use packaging system so we can install them as required by a site.

Now my question is if I have a package 1 (events) who also need to display items from package 2 (articles) how should i go about it?

My first thought was that I can create some sort of a route for news/all.json but then package 1 will KNOW it exists and there will be a dependency? (I also need to do the same on News ie get events)

Another issue is both events and news have categories which could be same, so with packages I would need a separate table news_categories and event_categories?

for me a package will consist of DB Migrations, Tests, Routes (User and Admin) (laravel package)

Finally the reason i didnt go multitennant is because my manager was like there are customisation then it will make DB/Code a bit ugly but I am not so sure now :(

Edited: when I talk about packages up there i really mean modules but in php (composer which is similar to npm) they are called packages.

  • Do you use npm? Because it already knows how to handle dependencies... and it sounds like what you're looking for. Although really you should not have duplicates (repeating the same article on multiple sites is not a good idea in terms of SEO.) – Alexis Wilke May 10 at 19:36
  • @AlexisWilke thanks for the reply. i get that. thats what i want to do but i am not sure how to make one package aware of the contents of the other package? I am going to edit my question to be more clear. – shez1983 May 10 at 22:51
  • Well... you mentioned laravel so that's why I thought it would be JSON/Node/JavaScript... Would you be able to share an example of package you already have? Most packagers offer a way to execute some code once a package is installed. For example, in a Debian package you have a postinst script. It's also often called hooks. – Alexis Wilke May 10 at 23:23
  • You may want to use UML to help you describe modules / packages dependencies – umlcat May 12 at 0:47
1

You must be shure that your packages are independent and don't change from one site to another cause in the long term you will have a problem with deployment and keeping track of the versions. If your package are generics and can be loaded in any site you don't have a problem if you call the modules (packages) by urls, but you must keep the urls or interfaces of communication standard and unchange (or keep the change on minimum). Other solution is taking a micreservices approach.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.