shiksha-platform / frontend-modulefederation

The frontend repo includes configurable UI components, modules and apps to create the Shiksha experience
10 stars 58 forks source link
event-bus microfrontends module-federation native-base postaljs react

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

{
"name": "[module-name]",
...
}
module.exports = {
  devServer: {
    port: 3001,
  },
  ...
...
module.exports = {
  name: "[module-name]",
...

Run All Modules and Host Application

yarn install
yarn start

Build Application for Production

yarn build

Run Module as Standalone Application

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

Use Module in Host Application


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

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

{
    "core":{
        "url": "http://localhost:3001"
    },
    ...
}
# 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/