Git Product home page Git Product logo

micro-frontends-app's Introduction

Micro Frontends App

This repository contains the source code of a simple micro frontends application written in Svelte and React.

A Brief Introduction to Micro Frontends

  • Micro frontends is similar thing on the frontend side, as microservices are on the backend side.
  • Applications are composed of a set of well-defined, loosely coupled components.
  • We can identify micro frontends in our applications by applying principles, such as Domain Driven Desing (DDD).
  • Each micro frontend is owned by a single cross-functional team.
    • Easier scaling of teams and projects.
    • Smaller scope enables faster onboarding of new teams and team members.
  • Teams can more freely pick their technology stack.
    • Prevents technology lock-in.
    • Makes applications more future-proof by allowing teams to more easily experiment with and migrate to new technologies.
  • We get independent updates, so that if one part of the application changes, we only need to update the micro frontend(s) that implement the changed functionality.
  • Micro frontends patterns can be very effective when migrating an existing monolithic application to a more modular architecture.
    • Strangler Pattern to kill the monolith by eating it piece-by-piece, until there is nothing left from the original implementation.
  • Micro frontends is no silver bullet. It comes with its own challenges, such as operational and governance complexity, and possibly bigger payload sizes.
  • The important thing is to understand the trade-offs, and make an informed decision on whether to adopt micro frontends in your applications.

Decision Frameworks

There exist several approaches to implement micro frontends.

Decisions frameworks like the one presented here, can prove to be really useful in the early stages of a project.

Libraries and Frameworks

Micro frontends continue to gain in popularity, so there already exist several libraries and frameworks to implement them.

Custom solution is also a perfectly viable option. It gives you the full flexibility to innovate and evolve your solution.

The sample application in this repository is implemented without any 3rd party micro frontend libraries.

Recommended Reading

Application Components

Application Shell (app-shell)

  • Gateway to the application.
  • Implements the top menu and client-side routing.
  • Loads (lazy), mounts, and unmounts micro frontends based on application state.
  • Technologies: Svelte, Router5, Ky, Bootstrap, Vite

Browse Micro Frontend (mf-browse)

  • Implements browse experience.
  • Shows a list of selectable items.
  • Technologies: React, Ky, Bootstrap, Vite

Detail Micro Frontend (mf-detail)

  • Implements detail experience.
  • Shows some details about the selected item.
  • Technologies: Svelte, Ky, Bootstrap, Vite

Backend (api)

  • Provides JSON data and images for the application.

Styling Solution

Application shell and the micro frontends use Bootstrap for styling.

Cross-Application Communication

Application shell and the micro frontends can communicate in a loosely coupled way by using the standard Custom Events API.

Building and Running the App

> docker compose up --build -d
> open http://localhost:8000

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.