How group900/ipricepro works
Project type and purpose
• This is a monorepo containing three npm/TypeScript packages:
• packages/shared: common types, constants, utilities
• packages/guide: exports Apple product definitions & helpers
• packages/price-data: scripts and functions to retrieve or load price data
• It’s a library/tooling project rather than a full-stack app. The goal is to provide reusable data-model definitions (“guide”) and price-fetching/loading logic (“price-data”), with shared code kept in “shared.”
File structure
• Top level:
• pnpm-workspace.yaml & pnpm-lock.yaml – pnpm workspace configuration
• .github/workflows/main.yml – CI pipeline for build & tests
• packages/… – three subdirectories, each with its own package.json and tsconfig.json
• packages/shared: central utilities, types, enums, constants
• packages/guide: AppleProducts.ts, index.ts/test – provides product catalog definitions
• packages/price-data:
– src/getProductPrices.ts (core API)
– scripts/find.ts, findAll.ts (entry points)
– results/*.json (mocked data)
– tests in index.test.ts
README for additional insights
• Only links to an external article; no further architecture details. We infer architecture entirely from the code layout.
Main components & their relationships
a. Components:
1) Monorepo & pnpm workspace (orchestrator)
2) Shared Package (shared code: types, constants, utils)
3) Guide Package (product definitions & tests)
4) Price-Data Package
– Core Module (getProductPrices API)
– Scripts (find.ts, findAll.ts)
– Data Store (JSON files under results/)
5) CI/CD (GitHub Actions)
b. Interactions:
– guide and price-data both import from shared
– scripts in price-data import getProductPrices, run against results JSON
– tests in each package invoke their respective index.ts or API
– CI pipeline checks out monorepo → installs via pnpm → runs build & tests across all packages
c. Architectural patterns & principles:
– Monorepo with isolated packages & internal dependencies
– Code sharing via a “shared” package to avoid duplication
– Scripts-as-entry-points under price-data following a CLI-style pattern
d. Key technologies: TypeScript, Node.js, pnpm workspaces, JSON data files, GitHub Actions