Skip to content

Tutorial: Build Your First MFE

Ready to build a micro-frontend at HEMA? This tutorial takes you from an empty repo to a fully deployed service that’s part of the hema.nl/hema.com ecosystem.

By the end, you’ll have a real, production-ready service with all the bells and whistles:

  • Next.js 15+ with App Router and standalone Docker output
  • AWS infrastructure (ECS Fargate + ALB or OpenNext/Lambda) managed entirely by CDK
  • CI/CD pipeline that deploys on every push to main
  • HEMA Design System for consistent, accessible UI
  • Web Shell wrapping your app with header, footer, and analytics
  • Internationalization across 5 locales and 2 domains
  • Sanity CMS integration for content-driven pages
  • Gateway registration so CloudFront routes traffic to you
  • Testing with Vitest (unit) and Playwright BDD (e2e)
  • Feature sandboxes — every branch gets its own environment

At HEMA, the online store is made of micro-frontends — independent Next.js apps that each own a piece of the customer experience. To the customer, it’s one website. To us, each service is independent and deployable on its own.

Diagram

Each MFE registers its routes with the Gateway and shares the Web Shell and Design System with all other MFEs.

Most MFEs run as Docker containers on ECS Fargate — this is the default for high-traffic pages (content, PDP). For lighter or bursty-traffic services (e.g., account pages), there’s also the OpenNext (serverless/Lambda) option. This tutorial follows the ECS Fargate path.

Need to peek at how it’s done? These repos follow the Golden Path:

Make sure you have:

  • SSO Access — Active HEMA account
  • AWS CLI — Configured with HEMA credentials (how to get access)
  • Node.js 22+ — Check with node --version
  • Git — Configured with HEMA GitHub access
  • Service Catalog — Access to https://servicecatalog.ui.hema.digital
  • Service Name — Approved by the platform team
PartWhat you’ll doTime estimate
1. Foundation SetupCreate repo, request AWS accounts30 min + wait time
2. CI/CD PipelineDeploy your pipeline to AWS15 min
3. Next.js App SetupScaffold app, Docker, routes45 min
4. Core CapabilitiesHDS, Shell, i18n, CMS, testing, APIs2–3 hours
5. DeploymentButler sandboxes, pipeline flow30 min
6. Local DevelopmentRun locally, env vars, daily workflow20 min