How skyscanner/backpack works
Project type and purpose
• This is a front-end design system monorepo (“Backpack”) containing dozens of React component packages, SCSS mixins, theming utilities, storybook configuration, examples and build scripts. Its purpose is to provide a consistent library of UI building blocks, styles and tooling for Skyscanner’s products.
File structure
• Top-level config and tooling directories:
• .github/ (CI/CD workflows, templates)
• .storybook/ (Storybook config)
• scripts/ (shell and JS helpers for linting, testing, transpilation)
• gulpfile.js (per-component build tasks)
• babel.config.js, tsconfig.json, webpack/postCssPlugins.js
• examples/ (per-component playground code, stories)
• packages/
• A folder per component (bpk-component-xyz), each with its own src/, tests, snapshots, README, index.(js|ts)
• Higher-level packages: bpk-mixins, bpk-stylesheets, bpk-theming, bpk-react-utils
• Root manifests: package.json, package-lock.json, .gitmodules
• Linting/formatting: .eslintrc, .stylelintrc, .prettierrc, Husky pre-commit hooks, Percy visual-testing config
README for additional insights
• Confirms a monorepo distribution (@skyscanner/backpack-web), a long list of internal packages, external dependencies (@skyscanner/bpk-svgs, bpk-foundations-web).
• Points to documentation site and changelog, suggests CI automation via GitHub Actions.
a. Main components
• Developer Workstation (IDE, Git, npm/yarn CLI)
• Version Control Platform (GitHub repo with submodules)
• Monorepo root – code organization:
• Config & tooling (babel, webpack, gulp, lint, test scripts)
• packages/ (individual React component libraries)
• examples/ & storybook/ (documentation playground)
• Build & Test Pipeline (GitHub Actions + Percy visual tests, Jest + snapshot tests, lint, typecheck)
• Artifact registry (npmjs.com for publishing individual @skyscanner/backpack-web packages)
• Documentation site (consumes storybook build or static site generator)
• External Foundations (bpk-svgs, bpk-foundations-web packages from separate repo)
b. Relationships & data flows
• Developer → GitHub (push PR)
• GitHub Actions → run lint, tests, storybook build, Percy checks
• On successful CI → npm publish individual packages
• Consumers (other Skyscanner apps) → npm install @skyscanner/backpack-web packages
• Developer/Designer → run Storybook locally or view hosted docs
• Build scripts (gulp, webpack, babel) transform src/ → dist/ bundles
c. Architectural patterns & design principles
• Monorepo with package-per-component promotes code reuse and version consistency
• Workspace isolation: each package has its own entry point, tests and styling
• Automated CI gating ensures quality (lint, typecheck, accessibility tests)
• Storybook as living documentation and visual QA
• Separation of concerns: theming, raw mixins, React utils are distinct foundational layers
d. Key technologies & frameworks
• Node.js, npm/Yarn (monorepo package management)
• React + TypeScript/JavaScript
• SCSS modules and theming via bpk-theming
• Babel, Webpack, Gulp for transpilation & bundling
• Jest + snapshot tests, accessibility tests
• ESLint, Stylelint, Prettier for code quality
• Husky hooks, Danger.js, Dependabot for maintenance
• Storybook for component sandboxing
• GitHub Actions + Percy for CI/CD