Micro-frontend is a design approach in which a frontend is decomposed into individual, semi-independent “micro-apps.” The micro- frontend concept is inspired by, and named after, microservices.
Micro-frontend is individual components that work together to create one seamless product for end-users. The thought process behind micro-frontends is similar to microservices, except that micro-frontends pertain to the client side together to form one cohesive unit, which helps to make the overall product more user-friendly and efficient.
Micro-frontends are a relatively new concept, and they offer a number of advantages over traditional monolithic frontends. Perhaps the most significant approach is that micro-frontends allow for a much more granular approach to front end development, which can lead to a more maintainable and scalable codebase.
Each micro-frontend can be developed independently and then deployed as a separate unit. This proves that changes can be made to one micro-frontend without affecting the others, which leads to a more responsive overall frontend.
Micro-frontends address the problems by breaking the front end into small independent modules. This modular approach has several advantages, such as shorter development times, easier maintenance and better scalability.
The micro-frontend architecture is an approach to frontend development that adopts microservice principles. In a micro-frontend architecture, development teams build and deploy various front end applications independently.
Then, these applications are combined by a “parent” frontend application representing a container to retrieve, display and integrate the various child applications.
Fig. Architecture Of Micro-frontend
In this model, the user interacts with what appears to be a single application, but in reality, they interact with independent applications published by different teams. By decoupling the various frontend applications, development works more independently and iterates more quickly.
This approach can result in faster feature development and delivery for the users of your application.
Let’s see an example by understanding a high-level diagram of the e-commerce application. The e-commerce application has three features; product features, payment features, and chatbot features. All these features have a separate micro-frontend and are independent, having a respective micro surface.
If there are some issues with the chat feature, the other two micro-frontends are not affected at all. This way, it becomes easier to deploy the issue and won’t hamper the other features.
Fig. High-level Diagram Of The E-commerce Application
By developing with micro-frontends, you will learn the true advantages of this front end development approach. Now, let’s explore the five benefits of using micro-frontends;
👉 Scalability
Micro-frontend development teams have an advantage because they can quickly start spinning up new teams when they need to deliver additional front end functionality. This allows you to scale your development process without disrupting other teams that are working on other parts of the application.
👉 Maintainability
When front end repositories are kept small and specialized, it’s easier to understand them, and this makes it simpler to do long-term maintenance and testing. This ensures that features can be easily tested in isolation and that the overall testing time is reduced.
👉 Faster deployment and troubleshooting
Embracing the micro-frontends architecture improves the development process. With this architecture, we can have smaller independent teams work on different features, and the deployment process becomes faster and with fewer errors.
👉 Autonomy
Each team is an expert in its domain. The team members have specialized knowledge of the data models, business requirements, API calls and user interactions connected with the billing service. Therefore, this knowledge allows the team to develop the front end faster than a less specialized team.
👉 Independent stack and versions
Autonomy allows each team to make choices about the technologies they use. For instance, a team could develop their micro-frontend using Vue.js, and the other team could develop their frontend using Angular.
This way, each team can concentrate on what works best for them without coordinating with or relying on other teams.
👉 Easy upgrades
The development teams can easily upgrade the architecture without touching the old one. They even can be tested independently. The easy upgrades make it even easier to deploy faster.
Webpack
It is a popular module bundler, a tool for bundling application source code in convenient chunks and loading that code from a server into a browser. They can be imported into any web page. Webpack preprocesses the different non-JavaScript files, such as Typescript and SaaS files.
Related Reads: How To Develop A SaaS Product? Best Practices & Process
Module federation
The module federation is a plugin that is added to the webpack and allows micro-frontends to load run time. They share common libraries so that libraries are not loaded several times. If you use micro-frontends angular, the model federation is very important. We need to install this plugin and hit the command.
Command:
npm i @angular-architects/module-federation
Related Reads: Angular Vs React Which One To Choose For Your App
Step 1: Create a workspace
We will start by creating a workspace. The workspace is where all the applications are clubbed. You can make any changes in the application in the workspace.
Command:
ng new my-workspace --create-application false
Step 2: Create an application shell and remote application
After creating the workspace, we move towards creating the application shell and a remote application. The shell application is a host application that will be the main application. The remote application is the micro-frontend app.
In the above example of an e-commerce application, the features such as payment, product and chat features are the remote applications. Therefore, these applications are connected to a shell application.
However, in a workspace, we need to create or generate the application in which we will add the model federation plugin to both of these applications. The model federation will e added to each remote application and the shell application.
Create application shell
Command:
cd my-workspace ng generate application shell
Create application remote
Command:
ng generate application remote
Step 3: Create module + routing
As we separate our remote applications feature-wise, we will create the module and routing in each application. After creating the module and routing, we will create a component.
Command:
ng generate module employer --project=remote --routing
Step 4: Create a component
Here, we will generate the component employer. Then we will configure the component backed with configuring the employee routing file. We need to have the specific route on which the component. Next, the module will be loaded and configured with routes.
Lastly, we need to expose the employer module in the webpack.config.js.
Command:
ng generate component employer --project=remote
Step 5: Adjust and configure remotes
We need to adjust and configure the remotes in the webpack.config.js. After that, the micro-frontends are loaded lazily with the route activated. And adapt app.component.html to have a router outlet and a router link.
Step 6: Run the application
At last, we have to run the application. As we know, micro contents are small applications connected to the shell. However, individual applications run separately, allowing them to load into the host application.
So here the question arises if we have deployed the code on the server side, how can we use it again? If the code is deployed on the S3 bucket, we can directly S3 link in the remote entry file. So instead of a local host request URL, we can simply use the S3 bucket link.
Micro frontends is a game-changing architecture that solves a ton of problems that come along with monolith frontend apps. Some benefits of using a micro frontend include a faster development process, increased efficiency, the ability to deploy upgrades incrementally, autonomous teams and more.
At Mindbowser, our experts have experience with the specific implementation of Micro frontends. Micro frontend with angular requires a high level of professional efficiency.
Therefore, we consider all the important aspects, such as automation requirements, operational complexity, quality, uniformity, etc., before taking the plunge.
The team at Mindbowser was highly professional, patient, and collaborative throughout our engagement. They struck the right balance between offering guidance and taking direction, which made the development process smooth. Although our project wasn’t related to healthcare, we clearly benefited...
Founder, Texas Ranch Security
Mindbowser played a crucial role in helping us bring everything together into a unified, cohesive product. Their commitment to industry-standard coding practices made an enormous difference, allowing developers to seamlessly transition in and out of the project without any confusion....
CEO, MarketsAI
I'm thrilled to be partnering with Mindbowser on our journey with TravelRite. The collaboration has been exceptional, and I’m truly grateful for the dedication and expertise the team has brought to the development process. Their commitment to our mission is...
Founder & CEO, TravelRite
The Mindbowser team's professionalism consistently impressed me. Their commitment to quality shone through in every aspect of the project. They truly went the extra mile, ensuring they understood our needs perfectly and were always willing to invest the time to...
CTO, New Day Therapeutics
I collaborated with Mindbowser for several years on a complex SaaS platform project. They took over a partially completed project and successfully transformed it into a fully functional and robust platform. Throughout the entire process, the quality of their work...
President, E.B. Carlson
Mindbowser and team are professional, talented and very responsive. They got us through a challenging situation with our IOT product successfully. They will be our go to dev team going forward.
Founder, Cascada
Amazing team to work with. Very responsive and very skilled in both front and backend engineering. Looking forward to our next project together.
Co-Founder, Emerge
The team is great to work with. Very professional, on task, and efficient.
Founder, PeriopMD
I can not express enough how pleased we are with the whole team. From the first call and meeting, they took our vision and ran with it. Communication was easy and everyone was flexible to our schedule. I’m excited to...
Founder, Seeke
We had very close go live timeline and Mindbowser team got us live a month before.
CEO, BuyNow WorldWide
If you want a team of great developers, I recommend them for the next project.
Founder, Teach Reach
Mindbowser built both iOS and Android apps for Mindworks, that have stood the test of time. 5 years later they still function quite beautifully. Their team always met their objectives and I'm very happy with the end result. Thank you!
Founder, Mindworks
Mindbowser has delivered a much better quality product than our previous tech vendors. Our product is stable and passed Well Architected Framework Review from AWS.
CEO, PurpleAnt
I am happy to share that we got USD 10k in cloud credits courtesy of our friends at Mindbowser. Thank you Pravin and Ayush, this means a lot to us.
CTO, Shortlist
Mindbowser is one of the reasons that our app is successful. These guys have been a great team.
Founder & CEO, MangoMirror
Kudos for all your hard work and diligence on the Telehealth platform project. You made it possible.
CEO, ThriveHealth
Mindbowser helped us build an awesome iOS app to bring balance to people’s lives.
CEO, SMILINGMIND
They were a very responsive team! Extremely easy to communicate and work with!
Founder & CEO, TotTech
We’ve had very little-to-no hiccups at all—it’s been a really pleasurable experience.
Co-Founder, TEAM8s
Mindbowser was very helpful with explaining the development process and started quickly on the project.
Executive Director of Product Development, Innovation Lab
The greatest benefit we got from Mindbowser is the expertise. Their team has developed apps in all different industries with all types of social proofs.
Co-Founder, Vesica
Mindbowser is professional, efficient and thorough.
Consultant, XPRIZE
Very committed, they create beautiful apps and are very benevolent. They have brilliant Ideas.
Founder, S.T.A.R.S of Wellness
Mindbowser was great; they listened to us a lot and helped us hone in on the actual idea of the app. They had put together fantastic wireframes for us.
Co-Founder, Flat Earth
Ayush was responsive and paired me with the best team member possible, to complete my complex vision and project. Could not be happier.
Founder, Child Life On Call
The team from Mindbowser stayed on task, asked the right questions, and completed the required tasks in a timely fashion! Strong work team!
CEO, SDOH2Health LLC
Mindbowser was easy to work with and hit the ground running, immediately feeling like part of our team.
CEO, Stealth Startup
Mindbowser was an excellent partner in developing my fitness app. They were patient, attentive, & understood my business needs. The end product exceeded my expectations. Thrilled to share it globally.
Owner, Phalanx
Mindbowser's expertise in tech, process & mobile development made them our choice for our app. The team was dedicated to the process & delivered high-quality features on time. They also gave valuable industry advice. Highly recommend them for app development...
Co-Founder, Fox&Fork