GithubHelp home page GithubHelp logo

federation-cars's Introduction

Example for module federation.

Looks like a simple dashboard to show a list of EV cars and clicking on them will show different details.

  • As long as Nx does not support Webpack 5, this uses Lerna
  • App "fc-shell": React as the "host" or "app shell"
  • App "fc-list": React app for the list of cars, using CRA
  • App "fc-details": Angular app for the EV details (like on ev-database)
  • Web Components (lit/Stencil) as UI library for both Angular and React (UI Library, Card)
  • Docker container with reverse proxy for testing/deploying all apps together

Developing

nvm use
yarn install
yarn start

Open http://localhost:3011.

But this requires you to open ports 3011 up to 3014. It might also lead to CORS errors. Running yarn start:dev-nginx starts an Nginx reverse proxy that redirects subpaths of localhost:3019 to the micro frontend services on different ports. Running yarn start:proxied will tell webpack to use proxied paths for module federation.

Also advantage of Nginx: SSL not between servers, only between browser and Nginx.

For local development:

yarn start:dev-nginx
yarn start:proxied

Open http://localhost:3019/fc_shell/.

Building

Run with

yarn build
yarn serve

Open http://localhost:3011.

For production:

  • TODO fix todo in fc-shell/webpack.config.js
  • TODO make a Dockerfile to deploy all micro frontends in one container with Nginx reverse proxy to emulate "production"

Remove this

The demo is annotated so navigate through the demos and apps available.

Included apps:

Heavily borrows from https://github.com/module-federation/module-federation-examples/blob/master/comprehensive-demo

Notes

  • Test CRA: Very difficult. Ejecting works, but after that Webpack 5 is needed and a lot of plugings conflict with the ejected webpack.config.

TODO

  • Typescript
  • CORS?
  • Test deploy as a single docker container
  • Test Angular
  • Test Lit/Stencil
  • App for chart with monthly cost over time
  • Google actions build script

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.