Code Monkey home page Code Monkey logo

micro-frontend-single-spa's Introduction

micro-frontend-single-spa

A proof of concept using single-spa to implemented the micro-frontend architecture where all the micro-apps are running on seperates servers and has seperate code base.

git cloning

git clone https://github.com/agrawald/micro-frontend-single-spa
cd micro-frontend-single-spa
git submodule update --init --recursive

legend

  • ms - back-end spring-boot micro-service to expose some REST API
  • ma - front-end react micro-app to realize micro-frontend architecture

structure

This repositoy is a strucvtured as git submodules, following are the sub modules which are included

ms-notifications

This is a spring-boot based backend application which is used to expose the following two REST APIs

GET /notifications

This API will be used to get all the notifications.

GET /template?scope=<admin or user>

This API will use scope to provide customized template which will show menu items in navbar on the UI.

ma-notifications

A micro-app to hook itself with ms-notfication REST API /notifications to fetch all the notifications and displayes them on a popup screen. This app will be triggered from master container, ma-container, and the menu item linked to this app is in ma-navbar micro-app.

ma-tasks

A micro-app to display all the tasks, does not use any backend API. The tasks are hardcoded. This app will be triggered from master container, ma-container, and the menu item linked to this app is in ma-navbar micro-app.

ma-navbar

A micro-app to display the navbar. The menu items on the navbar will be customized based on the single-spa customProps passed to it. The customProps which we pass from the ma-container is called as scope. This scope property will be used in the react component to make a backend API call, /template?scope=? to ms-notification (ideally it should be a seperate microservice but for the sake of simplicity). When a template is recieved from the backend API, the navbar will change what menu items to display.

ma-container

This is the master container micro-app which weaves all the micro-app togather into a single-spa. In this page, index.tsx we are passing a customProps known as scope to all the child micro-app.

technology stack

  • react
  • single-spa
  • spring-boot

micro-frontend-single-spa's People

Contributors

agrawald avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.