Coder Social home page Coder Social logo

jareechang / webpack-5-mod-federation-poc Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 0.0 3.29 MB

Webpack 5 module federation proof of concept

TypeScript 47.22% HTML 0.94% JavaScript 34.77% HCL 17.06%
webpack module-federation microfrontend microfrontends-demo microfrontend-react microfrontend-architecture react react-router aws cloudfront

webpack-5-mod-federation-poc's Introduction

Webpack 5: Module Federation (proof of concept)

Testing out the module federation in webpack 5.

This is an experimental project and it is not intended for production use.

Proof of concept of isolated application stitched together with webpack 5 module federation.

Getting started

1. Starting the apps

// Install deps
yarn

// Within root directory
yarn run start

// Visit http://localhost:4000

Production

1. Create infrastructure (via terraform)

terraform plan

terraform apply -auto-approve

// Get the output vars and add to your github secrets for your actions 

Note: Remember to run terraform destroy -auto-approve after your finish to not incur any charges from AWS

2. Setup Build Environments Variables (Github actions)

These need to be set on the github secrets for your workflows to work. These will all be available and created via terraform.

Name Description
WEBSITE_HOST Website domain or cloudfront domain
AWS_ACCESS_KEY_ID Build AWS Access key id
AWS_SECRET_ACCESS_KEY Build AWS Access key
AWS_S3_BUCKET_NAME S3 bucket name where the assets are synced to
AWS_CF_DISTRIBUTION_ID Cloudfront distribution id

Project Summary

Kittygram. View and search for photos of cats, and manage your account.

Teams

Teams are divided are split up into respective functions.

  1. Marketing Team - Host application (home page, common, and tying everything together)
  2. Accounts Team - Account Flows (profiles, login, logout, favourites etc)
  3. Search Team - Search Flows (Search results, display)

Architecture

Separate delivery pipeline which allows for independent releases in the holistic web application.

Even though the teams and projects are separate, the code base is shared via monorepo (lerna).

AB testing

Included Lambda@Edge functions to randomly weight the page being served from two s3 buckets (original and experiment).

  • View Request - Randomly adds cookie source= to Origin-Response
  • Origin Response - Handles the fetching data from the origin (s3 bucket), the lambda determines which page to be served based the cookie value

Overview of architecture

Kittygram architecture

Technologies

Resources

webpack-5-mod-federation-poc's People

Contributors

dependabot[bot] avatar jareechang avatar

Stargazers

 avatar  avatar

Watchers

 avatar  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.