Skip to content

sieugene/mf-nextjs

Repository files navigation

The repository was taken as a basis mf-nextjs

Description

I have expanded this example based on the original. Adding dockerization, typescript, monorepo mode with ssr and remote mode without ssr.

Alert

It is not recommended in production, because it can cause unintended errors, the library used @module-federation/nextjs-mf, has a version higher than in this repository, but there are problems with it.

Deployed demo links

Examples on vercel, remote mode only, without SSR.
Shell app
App1
App2

Local

$ yarn install
$ make -B .env env=local
$ yarn dev

# http://localhost:3000 - main app
# http://localhost:3001 - cube app
# http://localhost:3002 - prisma app

Build Monorepo

$ yarn install
$ make -B .env env=local
$ yarn build
$ yarn start

# http://localhost:3000 - main app
# http://localhost:3001 - cube app
# http://localhost:3002 - prisma app

Docker Monorepo (SSR mode)

$ make -B .env env=local
$ docker-compose -f "docker-compose-monorepo.yml" up -d --build 
# http://localhost:3000 - main app
# http://localhost:3001 - cube app
# http://localhost:3002 - prisma app

Docker Remote (No SSR mode)

$ make -B .env env=local
$ docker-compose -f "docker-compose.yml" up -d --build 
# http://localhost:3000 - main app
# http://localhost:3001 - cube app
# http://localhost:3002 - prisma app

About

Microfrontends using Next.js and Module Federation (With SSR)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published