How bryllim/workout-guide works
Purpose and principal workflow
Workout Guide is both a framework-neutral exercise catalog and asset package, and a static website for browsing its exercise gallery and guide. The principal website workflow starts when a gallery visitor opens the published site and browses the gallery or an exercise detail page. Separately, an npm package consumer imports the library to look up or search exercises and build asset URLs. Maintainers can regenerate the catalog and artwork from a compatible exercise-source export.
Components
Catalog and package
• Exercise lookup and search API — packages/workout-guide/src/index.ts: Exposes the typed exercise collection, ID/slug lookup, normalized text search with filters, and CDN-based asset URL generation; it loads the canonical manifest.
• Exercise and frame types — packages/workout-guide/src/types.ts: Defines the catalog metadata, three-frame exercise shape, search filters, asset URL options, and attribution types.
• Canonical catalog and artwork — packages/workout-guide/manifest.json: Stores the structured exercise records and frame paths; the README documents 302 exercises and 906 SVG frames in the package assets.
Static website
• Gallery, detail pages, and guide — apps/site/src/pages: Contains the home, exercise listing, per-exercise detail, and guide pages; the README documents these as the static gallery and integration guide.
• Site asset URL helper — apps/site/src/lib/paths.ts: Builds base-aware URLs for locally served exercise frames and uses the package’s frame type.
• Static site configuration — apps/site/astro.config.mjs: Configures Astro’s static output, published site/base paths, trailing slashes, and sitemap integration.
Catalog and asset generation
• Catalog import pipeline — scripts/import-catalog.mjs: Reads definitions and pose sources from a compatible export, copies or rasterizes frame sources, creates SVGs, and writes the package manifest and license files.
• PNG-to-SVG vectorizer — scripts/lib/vectorize-png.mjs: Uses image processing and tracing libraries to vectorize transparent PNG artwork and optimize the resulting SVG.
• Website asset synchronization — scripts/sync-site-assets.mjs: Copies package artwork into the site’s public frame directory and generates social-preview artwork from featured exercises.
External callers
• Gallery visitor — null (external): Opens the published static website to browse exercise information and illustrations.
• npm package consumer — null (external): Imports the published package API and uses its catalog and asset URL functions.
Relationships
• Gallery visitor -> Gallery, detail pages, and guide: opens the published static site; evidence: README.md.
• npm package consumer -> Exercise lookup and search API: imports the documented package API; evidence: README.md.
• Exercise lookup and search API -> Canonical catalog and artwork: imports the manifest and builds its in-memory ID/slug maps from it; evidence: packages/workout-guide/src/index.ts.
• Exercise lookup and search API -> Exercise and frame types: imports and re-exports the package’s type definitions; evidence: packages/workout-guide/src/index.ts.
• Site asset URL helper -> Exercise and frame types: imports the frame type; evidence: apps/site/src/lib/paths.ts.
• Catalog import pipeline -> PNG-to-SVG vectorizer: calls vectorizePng for each generated frame; evidence: scripts/import-catalog.mjs.
• Catalog import pipeline -> Canonical catalog and artwork: writes the manifest and generated assets into the package; evidence: scripts/import-catalog.mjs.
• Website asset synchronization -> Canonical catalog and artwork: copies package assets and reads the manifest to generate featured artwork; evidence: scripts/sync-site-assets.mjs.
• Website asset synchronization -> Gallery, detail pages, and guide: writes frame files into the site’s public directory for local serving; evidence: scripts/sync-site-assets.mjs.
Coverage limits
The page and component source excerpts were not provided, so the detailed rendering flow, page-to-package data calls, and whether gallery frames are served locally or via package-generated URLs cannot be established. The README describes a static gallery and guide; the explicit synchronization script establishes a local asset-copy path, but not its invocation timing.
Main entry points: index.ts Exercise lookup and search API · manifest.json Canonical catalog and artwork · import-catalog.mjs Catalog import pipeline · sync-site-assets.mjs Website asset synchronization
Components 10
Catalog and package
- Exercise lookup and search API
packages/workout-guide/src/index.ts - Exercise and frame types
packages/workout-guide/src/types.ts - Canonical catalog and artwork
packages/workout-guide/manifest.json
Static website
- Gallery, detail pages, and guide
apps/site/src/pages - Site asset URL helper
apps/site/src/lib/paths.ts
Catalog and asset generation
- Catalog import pipeline
scripts/import-catalog.mjs - PNG-to-SVG vectorizer
scripts/lib/vectorize-png.mjs - Website asset synchronization
scripts/sync-site-assets.mjs
Other components
- Gallery visitor
- npm package consumer
Connections 9
- Gallery visitor → Gallery, detail pages, and guide: opens
README.md - npm package consumer → Exercise lookup and search API: imports
README.md - Exercise lookup and search API → Canonical catalog and artwork: loads
packages/workout-guide/src/index.ts - Exercise lookup and search API → Exercise and frame types: imports and re-exports
packages/workout-guide/src/index.ts - Site asset URL helper → Exercise and frame types: imports
apps/site/src/lib/paths.ts - Catalog import pipeline → PNG-to-SVG vectorizer: calls
scripts/import-catalog.mjs - Catalog import pipeline → Canonical catalog and artwork: writes
scripts/import-catalog.mjs - Website asset synchronization → Canonical catalog and artwork: copies and reads
scripts/sync-site-assets.mjs - Website asset synchronization → Gallery, detail pages, and guide: writes frame files
scripts/sync-site-assets.mjs