How justeattakeaway/pie works
Project Type & Purpose
• A monorepo (managed by Yarn Workspaces & Turborepo) hosting PIE, Just Eat Takeaway’s global design system.
• It comprises three main sections:
– pie-docs: a static documentation site built with Eleventy.
– pie-storybook: a Storybook playground (MDX/TS) for Web Components.
– packages:
• components: dozens of Web Component packages (TS + Vite builds + custom-elements-manifest).
• CI/CD via GitHub Actions, publishing via Changesets to npm, hosting docs/storybook on AWS Amplify/CDN.
File-Structure Analysis
• Root:
– package.json, tsconfig.json, turbo.json, yarnrc.yml
– .configs & .github/workflows
• apps/
– pie-docs/ → Eleventy + Vite + Playwright/Visual Tests + static assets
– pie-storybook/ → Storybook configs + MDX stories + test utilities
• packages/
– components/ → one folder per component, each with src/, tests (accessibility/visual/unit), package.json, Vite configs
• configs/ → shared Vite/Changesets/Playwright setups for components
README Insights
• Confirms monorepo’s three pillars: docs, storybook, web components.
• References contributing guide, workflow tooling (DangerJS, Changesets, OSSF Scorecard).
Diagramming the Architecture
a. Main Components
1. Developer Workstation
2. GitHub Repo + GitHub Actions (CI/CD)
3. Monorepo Orchestration: Yarn Workspaces + Turborepo pipeline
4. Apps:
– pie-docs (Eleventy → static HTML/CSS/JS)
– pie-storybook (Storybook → static build)
5. Packages:
– components (Web Components + TS + Vite → distributed to npm & CDN)
– tools (lint configs, generators, CSS utilities)
6. External Services:
– npm Registry
– AWS Amplify / S3 / CloudFront (pie.design, webc.pie.design)
– Playwright & Percy (E2E & visual regression)
– Changesets (versioning + releases)
b. Relationships & Interactions
• Developer → pushes PR → GitHub Actions
• CI: Turborepo runs tasks in parallel (build, test, lint) across apps & packages
• On release: Changesets publishes updated packages to npm + deploys static sites to Amplify
• Apps consume Web Components via published packages (docs auto-import component JSON manifests & CSS)
• Storybook loads all components for interactive playground & MDX docs
c. Architectural Patterns & Principles
• Monorepo with workspace boundaries; Turborepo for build caching & orchestration
• Component-based architecture: each UI widget is a standalone package
• Static-first Frontend: Eleventy and Storybook produce static assets
• Polyglot tooling: shared config in /configs & /packages/tools
d. Key Technologies & Frameworks
• Yarn 3 Workspaces, Turborepo
• TypeScript, Vite, Rollup (for React wrappers), custom-elements-manifest
• Eleventy (pie-docs), Storybook (pie-storybook)
• Playwright, Percy for testing
• Changesets, DangerJS for releases
• AWS Amplify / S3 / CloudFront, npm Registry