Skip to content

vamshikrishnab/create-nextjs-mfe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

create-nextjs-mfe

A CLI tool to create Next.js Micro Frontend applications using Module Federation.

Installation

npm install -g create-nextjs-mfe

Usage

Create a new Micro Frontend application:

create-nextjs-mfe create host-app --type host --port 3000 --remotes "remote1,remote2"

Options

  • --type: Type of application (host or remote)
  • --port: Port number for the application
  • --remotes: Comma-separated list of remote applications (for host apps only)

Project Structure

The CLI will create:

  • A host application
  • Remote applications as specified
  • Module Federation configuration
  • TypeScript and TailwindCSS setup
  • Exposed components (Counter and Card)

Getting Started

  1. Create your applications:
create-nextjs-mfe create host-app --type host --port 3000 --remotes remote1,remote2
  1. Install dependencies:
cd apps/remote1
npm install --legacy-peer-deps
cd ../remote2
npm install --legacy-peer-deps
cd ../host-app
npm install --legacy-peer-deps
  1. Start the applications:
# Start remote apps first
cd apps/remote1
npm run dev

# In another terminal
cd apps/remote2
npm run dev

# Finally, start the host app
cd apps/host-app
npm run dev

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages