All Projects → unsafecode → react-microfrontends-demo

unsafecode / react-microfrontends-demo

Licence: other
Demo of microfrontends using React

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to react-microfrontends-demo

SwiftUI-Flux
🚀 This is a tiny experimental application using SwiftUI with Flux architecture.
Stars: ✭ 52 (+44.44%)
Mutual labels:  architecture
scalecube-js
Toolkit for working in microservices/micro-frontends architecture.
Stars: ✭ 63 (+75%)
Mutual labels:  microfrontends
documentation
This repository contains Enablement Documentation (STIX Shifter), Workgroup documents and materials (Endpoint), Working documents and output from the "Architecture Working Group", Architecture workgroup meeting minutes and recordings
Stars: ✭ 20 (-44.44%)
Mutual labels:  architecture
Villains-and-Heroes
Android app built with MVP architectural approach and uses Marvel Comics API that allows developers everywhere to access information about Marvel's vast library of comics. ⚡
Stars: ✭ 53 (+47.22%)
Mutual labels:  architecture
Peasy.NET-Samples
Showcases a middle tier built with peasy and consumed by multiple client consumers
Stars: ✭ 33 (-8.33%)
Mutual labels:  architecture
phd-resources
Internet Delivered Treatment using Adaptive Technology
Stars: ✭ 37 (+2.78%)
Mutual labels:  architecture
RxSwiftMVVM
RxSwift MVVM Moya HandyJSON
Stars: ✭ 58 (+61.11%)
Mutual labels:  architecture
repolib-android
RepoLib Rx - Android
Stars: ✭ 13 (-63.89%)
Mutual labels:  architecture
multithread-mpp
This is the best architecture of Kotlin Multiplatform Project I think! This project works on background thread using kotlinx.Coroutines.
Stars: ✭ 16 (-55.56%)
Mutual labels:  architecture
iOS-Clean-Architecture-Example
An iOS app designed using clean architecture and MVVM.
Stars: ✭ 50 (+38.89%)
Mutual labels:  architecture
movie-booking
An example for booking movie seat, combined of Android Data Binding, State Design Pattern and Multibinding + Autofactory. iOS version is: https://github.com/lizhiquan/MovieBooking
Stars: ✭ 80 (+122.22%)
Mutual labels:  architecture
Systemizer
A system design tool that allows you to simulate data flow of distributed systems.
Stars: ✭ 1,219 (+3286.11%)
Mutual labels:  architecture
bian
The Banking Industry Architecture Network e.V. (BIAN) model in Archimate 3
Stars: ✭ 48 (+33.33%)
Mutual labels:  architecture
pyprt
Python bindings for the "Procedural Runtime" (PRT) of CityEngine by Esri.
Stars: ✭ 36 (+0%)
Mutual labels:  architecture
arch-pattern-modularization
🌵Implementation of Modularization on Architecture Pattern
Stars: ✭ 27 (-25%)
Mutual labels:  architecture
arch
🎉 a Tool to Manage & Automate your Node.js Server 🎉
Stars: ✭ 13 (-63.89%)
Mutual labels:  architecture
OpenHarmony
华为鸿蒙分布式操作系统(Huawei OpenHarmony)开发技术交流,鸿蒙技术资料,手册,指南,共建国产操作系统万物互联新生态。
Stars: ✭ 373 (+936.11%)
Mutual labels:  architecture
architecture
Beauty and the Mess - “Performance of the system depends on how the parts fit, not how they act taken separately.”
Stars: ✭ 32 (-11.11%)
Mutual labels:  architecture
Movies-PagingLibrary-Arch-Components
Sample to practice PagingLibrary & RX
Stars: ✭ 92 (+155.56%)
Mutual labels:  architecture
drawer-with-bottom-navigation-architecture
Sample android kotlin project with both drawer and bottom navigation together
Stars: ✭ 42 (+16.67%)
Mutual labels:  architecture

Microfrontends Demo with React

Motivation

Microservices are very popular these days, and for a good reason. However, regardless of how accurate an architecture might be, frontend always poses a problem. Imagine you have a small digital store, and you designed your microservices for two main features: product catalog and cart. You can follow the pattern, and different microservices to implement them, but you will eventually end up putting them together in the frontend.

If you design it the usual way, you will likely design one single web app, with your framework or library of choice, and use the services you build. Doing so, however, actually turn your web app into one giant monolithic monster. More importantly, you will never be able to compose your frontend the way you can do with backend microservices.

Solution

One way (alternatives exist, check the References) to address this situation is leveraging the usual third-party component integration, i.e. splitting your frontend into several, distinct side projects, each implementing one set of features, and matching the microservices design.

For instance, in our examples, we should build one library for the product catalog and another one for cart. Each will contain UI components, services, etc... bundled together. Then, the actual web app will only reference each library, typically via the router.

As you probably guessed from the title, this demo is done in React, but you can replicate it in Angular as well (I was actually willing to do that, but I stumbed upon a strange issues and had to opt for React).

Advantages and limitations

Advantages

  • Composition is straightforward: just reference each microfrontend library the way you usually work with third-party packages.
  • Versioning can be achieved using web app package.json and semVer.
  • A/B testing: thanks to the previous point, making two building composing different versions of microfrontends is trivial. At that point, we can publish them and apply A/B testing easily.
    • This implies some compatibility among the different versions you pick, of course.
  • Testability is somewhat simplified, since each library can be developed and tested independently. Additionally, it is possibile to leverage small demo projects to test them end-to-end as well.

Limitations

This is a basic demo, and not a complete solution to tackle any situation or requirement.

  • Multiple Frameworks: so far, it is NOT possibile to mix different frameworks or libraries. The example is done with React, and can be rebuilt with Angular as well, but mixing them is hard.
  • Development and release is surely a bit harder, since managing several projects at once can be challenging at first. You need to build a library each time you make changes, and then restart create-react-app. Releasing also involves a bit of additionaly work, as you need to publish the libraries (typically, on a npm server, possibly private if can't make them public) and then build the web app itself.

Usage

git clone https://github.com/unsafecode/react-microfrontends-demo.git

cd cart
npm install
npm run build
npm link

cd ../catalog
npm install
npm run build
npm link

cd ../web
npm install
npm link @unsafecode/react-microfrontends-cart @unsafecode/react-microfrontends-catalog
npm start

Technical details

References and other projects

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].