GithubHelp home page GithubHelp logo

shubhambawner / frontend-modulefederation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shiksha-platform/frontend-modulefederation

0.0 0.0 0.0 2.34 MB

The frontend repo includes configurable UI components, modules and apps to create the Shiksha experience

Shell 0.09% JavaScript 89.76% TypeScript 1.96% CSS 4.75% HTML 3.44%

frontend-modulefederation's Introduction

Shiksha Platform Frontend (Uses Module Federation)

Modules

Module Description
core Core features like School, Classes, Students
teacher-app Host Application for teachers

Create New Module

  • copy module-template to packages/[module-name]
  • update packages/[module-name]/package.json
{
"name": "[module-name]",
...
}
  • Update packages/[module-name]/craco.config.js and assign a port for dev environment.
module.exports = {
  devServer: {
    port: 3001,
  },
  ...
  • update packages/[module-name]/moduleFederation.config.js
...
module.exports = {
  name: "[module-name]",
...

Run All Modules and Host Application

  • Install dependency
yarn install
  • Run all modules
yarn start

Build Application for Production

yarn build

Run Module as Standalone Application

lerna run start --scope=[module-name]

Use Module in Host Application

  • Add remote module url to remotes in packages/[host-app]/moduleFederation.config.js

# e.g. core module is runninig on localhost:3001 then

  remotes: {
    core: 'core@[window.appModules.core.url]/remoteEntry.js',
  },
  • Add entry to modules.json
# e.g. core module is runninig on localhost:3001 then

{
    "core":{
        "url": "http://localhost:3001"
    },
    ...
}
  • To use exposed component from remote module in react. The lazy load componennt must be enclosed within <React.Suspense>
# e.g. usiing AppShell component from core module

const AppShell = React.lazy(() => import("core/AppShell"));
...
<React.Suspense fallback="Loading ">
 <AppShell/>
</React.Suspense>

Developer Documents

https://shiksha-platform.github.io/docs/Developer/Frontend/

frontend-modulefederation's People

Contributors

sagarkoshti1990 avatar shruti3004 avatar arajput avatar sagaarr avatar chakshugautam avatar reddyganesha15 avatar coolbung avatar shaukatmakandar786 avatar imgbotapp avatar shubhambawner 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.