Another thing that we get for free, when you work on a single app, is all the handling of analytics and reporting because remember for our use case, when the user journey looks very solid, they start from the Wilco homepage and dive deeper to the game and the playing end portal and we want to keep these analytics in the same view to track the user flow along the way, so we need to have the same analytics, same for error reporting, we don't want two instances of error reporting to follow and many more.
We also have a lot of code that is shared between those two apps, whether it's the user session that we need to manage, whether it's the code that fetches things from the server, maybe it's error handling and stuff like this, so once we have one single React app code sharing is something that's very simple. Again there are some kind of solutions also for micro-frontend but it is a little bit trickier and a lot of things to set up.
When you have one single app you are able to leverage one single repo. You don't need to split it into a couple of repositories that you need to maintain, that you need to watch, that you need to manage. One single repo, just like one single app, again, as I said before, also for a micro-frontend. You are able to work on one single repo but you have to set it up. There is some kind of overhead to set up young workspaces or learner and so there are solutions but there is some kind of overhead but you get it for free.
And one last thing, on the technical side, you are able to get only single deployment, one deployment to watch and one deployment to monitor. There are pros and cons, for example, if you introduce change to only one app you will get also deployment to the other app but from what we saw, most of the cases you are changing both ways, so that's okay for us. But outside of the technical thing that you need to keep in mind, there is also one thing that I want to talk about when splitting a repository and splitting applications and this is the Conway's law.
For the one that is not familiar with Conway's law, it says that your product, what you build and the stuff that the users get is really a copy of the structure of your team or how you communicate. So for example if you have many teams inside your organization, for example, one for the front end and one for the back end and another one for the messaging view, another one for the menu, the product will look like this. You will see an isolated or pillars where you see that there is some kind of isolated teams and for our case we had only one team, one very small team remember we are a start-up we just started we are very small and I didn't want to create some kind of isolation in the product because our team was very small and very close to each other so I wanted all teams to be able to work on both apps and will be able to write a PR or write code that change all of them together and that's one of the things that you need to keep in mind. It's not just technical maybe the technical issues. These are more easy to evaluate but maybe the hardest thing that you will need to change is the team structure. This is very, very important to think about.
Okay, so I hope I convinced you that there is some value to keep this kind of application as one single app. So, let's see how we are going to do this. So, at the end of the day what you're going to build is a shell app. This is the hosting app that will be able to decide what is the right application that they need to bundle or what is the right application that they need to connect to the user's view. In this shell app, we'll get a request and, based on all kind of requirements, or all kind of parameters, we'll be able to decide what is the right mini app that they need to connect to the shell app. And this decision can be in all kind of properties. For example, in our use case, it was based on the user's path. If user goes to app vilko, it will get the dark one, and if it will get to anything.vilko, it will get the anything portal. You can also get it based not only on subdomain. You can get it based on the path of the app. Maybe you get it based on the user role. Maybe a regular user will get one experience and admins or internals or logged in users will get the other one. Maybe based on the view of the users, whatever you want to decide on.
Comments