Overview
The Federated Modules Monorepo Starter is a starter kit for developing web applications. It is composed of React microfrontends and shared components using Module Federation. The aim of this starter kit is to provide a convenient setup for building modular and scalable applications.
Features
- Module Federation: Allows for the composition of React microfrontends and shared components, enabling the development of modular applications.
- Fast Installation: Utilizes the pnpm package manager for faster installation and to solve NPM doppelgangers problem.
- Dev Experience: Integrates with husky for better development experience by providing git hooks.
- Development: Start the development environment with
pnpm dev. This command will run the entire application. - Building: Compile the application with
pnpm build. - Local Serve: Simulate a real server environment with
pnpm serve:local. This command serves the static files viaserve. - Testing: Run tests for the whole application using Jest and React Testing Library with
pnpm test. For End-to-End (E2E) tests using Playwright, usepnpm e2e. E2E tests are run againstserve:local. - Linting: Launch ESLint check for the entire application with
pnpm lint. - Deployment: Deploy the application to AWS using CDK with
pnpm infra:deploy. The deployment includes S3 and CloudFront. It is recommended to have separate AWS accounts for each stage (dev/stage/prod) to avoid naming conflicts.
Installation
To install the Federated Modules Monorepo Starter, follow these steps:
- Install Node 16 or later.
- Install the pnpm package manager. Visit the official documentation for installation instructions.
- Run
pnpm installto install the dependencies. - [Optional, but recommended] Install husky and initialize it by running
npx husky installto provide a better dev experience with git hooks.
Summary
The Federated Modules Monorepo Starter is a comprehensive starter kit for developing modular web applications using React and Module Federation. It provides a convenient development environment, testing capabilities, and deployment to AWS. By utilizing technologies such as Turborepo, pnpm, and TypeScript, it offers efficient monorepo management and faster package management. With the inclusion of popular libraries and tools like React Router, React Helmet, and Material UI, it enables developers to build scalable and customizable applications.