How byui-cse/wdd330-sleepoutside works
SleepOutside is a starter storefront for outdoor gear. A shopper can browse product pages, add a selected product to the cart, review the cart, and reach a checkout page. The sampled JavaScript shows product lookup from category JSON, cart persistence in browser local storage, and cart rendering. The tree also includes catalog and checkout pages, but their runtime wiring and checkout behavior are not shown, so those connections are left unverified rather than inferred.
Main entry points: product.js Add To Cart · utils.mjs Storage Helpers · product_pages Product Pages · index.html Cart Page
Components 11
Storefront
- Catalog Page
src/index.html - Product Pages
src/product_pages - Cart Page
src/cart/index.html - Checkout Page
src/checkout/index.html
Product Data
- Add To Cart
src/js/product.js - Product Lookup
src/js/ProductData.mjs - Category JSON
src/json
Cart
- Cart Renderer
src/js/cart.js - Storage Helpers
src/js/utils.mjs - Browser Storage
Other components
- Shopper
Connections 11
- Shopper → Catalog Page: browses
- Shopper → Product Pages: selects
- Shopper → Cart Page: reviews
- Shopper → Checkout Page: continues
- Add To Cart → Product Lookup: looks up
src/js/product.js - Product Lookup → Category JSON: fetches category
src/js/ProductData.mjs - Add To Cart → Storage Helpers: saves item
src/js/product.js - Cart Renderer → Storage Helpers: reads cart
src/js/cart.js - Storage Helpers → Browser Storage: reads and writes
src/js/utils.mjs - Product Pages → Add To Cart: uses handler
- Cart Page → Cart Renderer: uses renderer