I would skip what you had in mind. I would either build one monolith app or create a package that contains common logic to avoid duplication. My first suggestion is my favorite. If you have to reuse anything than it is not a good situation for micro-service.
Build a large laravel backend API with subsystems/modules
I'm going to build a large backend API using Laravel. At first, I was considering between Lumen and Laravel since it's just API. As I did some research, I then came up with the conclusion that Laravel would be a better fit for me as it has features that I will definitely need like, form request, route model binding, etc..
Ok, get back to the topic...
For the past few years, I've built and maintained 4 separate full-stack Laravel systems. These systems are used in a university to manage internship information of students. These 4 systems have some parts in common such as, student table, department/facility table, semester table. As a result, the admin has to maintain these common parts separately in each system which is literally not ideal.
Now, the university has a plan to bush up these systems. They wanna consolidate these 4 systems. And I'm in charge of it. I'm looking for an approach to share the common parts and separate the other irrelevant parts between the 4.
Currently, there are 2 approaches that I can think of
-
Build one Laravel app, one database, and make use of the module approach (https://github.com/nWidart/laravel-modules) to separate each system and put the common parts in the main system. My concern is that the database is gonna be extremely huge, not sure if it's gonna cause any problem in the future. Also, Each system requires its own authentication system. I still don't have a clear picture of this.
-
Build 4 separate Laravel apps, 4 separate databases + 1 main Laravel app, 1 main database, and use the API to share the common/dependency parts. That means each system still needs the user table for authentication purposes.
And also, should the frontend part (Vue CLI) use the same approach?
Any suggestions would be greatly appreciated.
Please or to participate in this conversation.