An interactive app exploring the Moon's origin, phases, surface features, and human exploration.
Inspired by NASA's Artemis II mission.
- React + TypeScript
- Vite for bundling and dev server
- Vitest + Testing Library for tests
Prerequisites: Node.js and pnpm
pnpm install# Start dev server
pnpm dev
# Run tests
pnpm test
# Build for production
pnpm build# Run the Playwright visual tests (builds, then captures screenshots)
pnpm test:visual
# Regenerate baseline screenshots
pnpm test:visual:updateVisual tests live in tests/visual/ and capture the home page plus all seven chapters across the 320, 768, 900, and 1800 viewport widths. WebGL canvases are masked and scenes are frozen so screenshots stay deterministic.
Baselines are committed PNGs generated in the pinned Playwright Linux container, so they only match on Linux. Running pnpm test:visual on macOS or Windows intentionally fails, since locally generated screenshots would never match the committed baselines.
To regenerate baselines, dispatch the Visual Update GitHub Actions workflow on the branch that holds the change; it commits refreshed PNGs back to that branch. Run it once you have intentionally changed layout and Visual Tests is failing on diffs you have reviewed.
# Run the Playwright behavior tests (builds, then asserts DOM behavior)
pnpm test:e2eThese tests live in tests/e2e/ and assert DOM behavior (roles, visibility) rather than pixels, so there are no baselines and they run on any host. Use them for behavior the jsdom-based unit tests can't observe, such as responsive show/hide driven by CSS media queries. CI runs them on every push and pull request.
# Optimize every managed raster image under public/
pnpm optimize:images
# Optimize only specific files or folders under public/
pnpm optimize:images -- public/moon/lunar-near-side.jpg public/moon/lunar-far-side.jpg
pnpm optimize:images -- public/moonpnpm optimize:images re-encodes each managed .jpg, .jpeg, or .png source file in public/, then refreshes its AVIF output based on the rules in scripts/optimize-images.mjs.