Hackforge Academy

Category: react

Create the Host Application

Published on 22 Aug 2026

Explanation

The first step is to create a React host application that will act as the main container for the micro frontends.

Code:

npm create vite@latest host-app -- --template react
cd host-app
npm install
npm run dev

Explanation

Create a separate React application for a specific business feature. For example, the product application can be developed and maintained independently.

Code:

npm create vite@latest product-app -- --template react
cd product-app
npm install
npm run dev

Explanation

The micro frontend contains its own React components and business logic. It can be developed independently from the host application.

Code:

function ProductApp() {
  return (
    <div>
      <h2>Products</h2>
      <button>Add Product</button>
    </div>
  );
}

export default ProductApp;

Explanation

The host application needs a mechanism to load the micro frontend. Common approaches include Module Federation, Web Components, npm packages, or loading a remote application.

Code:

// Conceptual structure
Host App
   ↓
Load Product Micro Frontend
   ↓
Display Product UI

Explanation

The final architecture contains a host application and independently developed micro frontends. Each application can have its own development and deployment process while appearing as one application to the user.

Code:

Host App
├── Header
├── Navigation
├── Product Micro Frontend
├── Cart Micro Frontend
└── Payment Micro Frontend

Product Team  → Build → Deploy
Cart Team     → Build → Deploy
Payment Team  → Build → Deploy

🚀 Learn Spring Boot with real-world projects

💡 Build REST APIs step by step

🧠 Improve backend development skills

🎯 Get career-ready practical training

Join Our Free WhatsApp Community

Direct access to niche-specific mentors and peers on WhatsApp.

🐍

Python Community

Discuss Django, FastAPI, AI integration, and automation scripts with 15k+ developers.

Join Python Community
⚛️

React Community

Master Next.js, Framer Motion, and State Management. Share your latest UI components.

Join React Community

Java Community

Deep dives into Spring Boot, Microservices architecture, and high-performance backend ops.

Join Java Community