https://github.com/sssshefer/module-federation
Connect multiple microservices into one effective monolithic application with Webpack Module Federation
https://github.com/sssshefer/module-federation
microfrontend module-federation monolith-architecture npm-workspaces webpack
Last synced: about 2 months ago
JSON representation
Connect multiple microservices into one effective monolithic application with Webpack Module Federation
- Host: GitHub
- URL: https://github.com/sssshefer/module-federation
- Owner: sssshefer
- Created: 2024-05-11T06:02:15.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-05-11T20:02:20.000Z (12 months ago)
- Last Synced: 2025-01-12T10:48:29.329Z (4 months ago)
- Topics: microfrontend, module-federation, monolith-architecture, npm-workspaces, webpack
- Language: TypeScript
- Homepage:
- Size: 101 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Monolithic Architecture with Webpack Module Federation
This project demonstrates how to consolidate multiple microservices into a one monolith application using webpack module federation>
Motivation
> Multiple separate builds should form a single application. These separate builds act like containers and can expose and consume code between builds, creating a single, unified application.
> This is often known as Micro-Frontends, but is not limited to that.
> From official webpack documentation. You can read more about module federation [here](https://webpack.js.org/concepts/module-federation/)
## Usage
Git clone the repo
```bash
$ git clone https://github.com/sssshefer/monorepo.git
```Install all dependencies for project
```bash
$ npm install
```
> [!TIP]
> You don't need to install dependencies for each service separately.
> Just run `npm install` in the root directory and all dependencies will be installed for all services without duplication.
> This is one of the advantages of workspaces in npmExample of running one specific microservice
```bash
$ npm run start -w admin
```How to run all services at once
```bash
$ npm run startAll
```> [!NOTE]
It is possible to run all services at once with package called concurrently. it allows you to run multiple commands *concurrently*