Skip to content

preact implementation. jsx templates. universal rendering.

License

neuland/tractor-store-preact

Repository files navigation

The Tractor Store - Preact

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

About This Implementation

Technologies

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

Limitations

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.

Todos

  • 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

How to run locally

Clone this repository and run the following commands:

git clone https://github.com/neuland/tractor-store-preact.git tractor-store-preact
cd tractor-store-preact

Install dependencies:

# install root dependencies (local only)
npm install
# install dependencies in all projects
npm run install:all

Start the development server:

npm start

Open 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.

Deployment

The application runs in a single Docker container with all 4 services. Only port 3000 (integration/gateway) is exposed.

Build and push to GitHub Container Registry

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

About The Authors

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.

About

preact implementation. jsx templates. universal rendering.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published