A micro frontends sample implementation of The Tractor Store built with Preact, ESI and Web Components. It's based on the Blueprint.
Live Demo: tractor-store-preact-production.up.railway.app
List of techniques used in this implementation.
| Aspect | Solution |
|---|---|
| 🛠️ Frameworks, Libraries | preact, preact-router, esbuild |
| 📝 Rendering | SSR with Hydration |
| 🐚 Application Shell | None |
| 🧩 Client-Side Integration | Custom Elements (preact-custom-element) |
| 🧩 Server-Side Integration | ESI + Declarative Shadow DOM |
| 📣 Communication | Custom Events, HTML Attributes |
| 🗺️ Navigation | MPA, One SPA per Team, Hard-Nav Between |
| 🎨 Styling | Self-Contained CSS (No Global Styles) |
| 🍱 Design System | None |
| 🔮 Discovery | None (Hardcoded URLs for Now) |
| 🚚 Deployment | Serverless (Cloudflare Workers) |
| 👩💻 Local Development | concurrently, nodeesi |
This implementation is deliberately kept simple to focus on the micro frontends aspects. URLs are hardcoded, components could be more DRY and no linting, testing or type-safety is implemented. In a real-world scenario, these aspects should be addressed properly.
- Web performance optimizations (e.g. on-demand loading, proper chunking, best practices, ...)
- Improve DX (linting, HMR, error handling)
- Show selected store on checkout page
- Migrate last lighthouse score changes
Clone this repository and run the following commands:
git clone https://github.com/neuland/tractor-store-preact.git tractor-store-preact
cd tractor-store-preactInstall dependencies:
# install root dependencies (local only)
npm install
# install dependencies in all projects
npm run install:allStart the development server:
npm startOpen http://localhost:3000 in your browser to see the integrated application.
Server- and client-side code is rebuilt automatically when you make changes. The servers restart automatically as well. You have to reload the browser manually.
The application runs in a single Docker container with all 4 services. Only port 3000 (integration/gateway) is exposed.
docker buildx build --platform linux/amd64,linux/arm64 -t ghcr.io/neuland/tractor-store-preact:latest --push .Image: ghcr.io/neuland/tractor-store-preact:latest
neuland Büro für Informatik is a software development company based in Germany. We have a strong e-commerce background and experience in building verticalized software solutions.