How vampire0011/peripherals-hub works
PeripheralsHub is a mouse-and-keyboard catalog with price tracking, wishlists, affiliate purchase links, OAuth accounts, and an admin ingestion console. Shoppers browse and filter the catalog, save products to a wishlist, or follow a localized buy link; admins trigger mock or Playwright syncs whose product updates and logs persist for the console. The graph follows documented capabilities and indexed references; unsampled route and scraper internals are represented only where the README or index supports them.
Main entry points: auth.ts Auth configuration · products.ts Catalog and wishlist actions · schema.prisma Application database · syncEngine.ts Sync orchestrator
Components 27
Catalog storefront
- Catalog page
src/app/page.tsx - Storefront hero
src/components/hero.tsx - Filter and sort
src/components/product-grid.tsx - Product card
src/components/product-card.tsx - Affiliate links
src/lib/affiliate.ts
Accounts and wishlist
- Sign-in pages
src/app/login/page.tsx - OAuth controls
src/components/oauth-buttons.tsx - Auth configuration
src/auth.ts - Auth handler
src/app/api/auth/[...nextauth]/route.ts - Route protection
src/middleware.ts - Profile and wishlist
src/app/dashboard/page.tsx
Catalog ingestion
- Sync orchestrator
src/lib/engine/syncEngine.ts - Mock feed
src/lib/engine/mockSource.ts - Playwright scraper
src/lib/engine/playwrightSource.ts - Product upsert
src/lib/engine/upsertProduct.ts
Admin operations
- Admin page
src/app/admin/page.tsx - Live sync console
src/components/admin-console.tsx - Admin actions
src/lib/actions/admin.ts - Sync log endpoint
src/app/api/admin/logs/route.ts
Persistence and pricing
- Catalog and wishlist actions
src/lib/actions/products.ts - Application database
prisma/schema.prisma - Price trend calculation
src/lib/priceTrend.ts
Other components
- Shopper
- Administrator
- Google OAuth
- GitHub OAuth
- Configured scrape sites
Connections 37
- Shopper → Catalog page: browses
README.md - Catalog page → Storefront hero: renders
src/app/page.tsx - Catalog page → Filter and sort: renders
src/app/page.tsx - Catalog page → Catalog and wishlist actions: loads catalog
src/app/page.tsx - Filter and sort → Product card: renders products
src/components/product-grid.tsx - Product card → Affiliate links: localizes link
src/components/product-card.tsx - Product card → Catalog and wishlist actions: toggles wishlist
src/components/product-card.tsx - Shopper → Sign-in pages: signs in
README.md - Sign-in pages → OAuth controls: renders
src/app/login/page.tsx - OAuth controls → Auth configuration: starts sign-in
src/components/oauth-buttons.tsx - Auth configuration → Google OAuth: authenticates
src/auth.ts - Auth configuration → GitHub OAuth: authenticates
src/auth.ts - Auth handler → Auth configuration: exposes handlers
src/app/api/auth/[...nextauth]/route.ts - Route protection → Auth configuration: checks session
src/middleware.ts - Shopper → Profile and wishlist: views saved gear
README.md - Profile and wishlist → Auth configuration: reads session
src/app/dashboard/page.tsx - Profile and wishlist → Catalog and wishlist actions: loads wishlist
src/app/dashboard/page.tsx - Catalog and wishlist actions → Auth configuration: checks identity
src/lib/actions/products.ts - Catalog and wishlist actions → Application database: reads and writes
src/lib/actions/products.ts - Catalog and wishlist actions → Price trend calculation: computes price drops
src/lib/actions/products.ts - Catalog and wishlist actions → Shopper: returns catalog data
src/lib/actions/products.ts - Administrator → Admin page: runs sync
README.md - Admin page → Live sync console: renders
src/app/admin/page.tsx - Live sync console → Admin actions: requests sync
src/components/admin-console.tsx - Admin actions → Auth configuration: checks admin
src/lib/actions/admin.ts - Admin actions → Sync orchestrator: starts sync
src/lib/actions/admin.ts - Admin actions → Application database: reads stats and logs
src/lib/actions/admin.ts - Admin page → Admin actions: loads admin data
src/app/admin/page.tsx - Sync log endpoint → Auth configuration: checks identity
src/app/api/admin/logs/route.ts - Sync log endpoint → Application database: reads logs
src/app/api/admin/logs/route.ts - Sync orchestrator → Mock feed: fetches mock feed
src/lib/engine/syncEngine.ts - Sync orchestrator → Playwright scraper: fetches scrape feed
src/lib/engine/syncEngine.ts - Playwright scraper → Configured scrape sites: scrapes configured targets
README.md - Sync orchestrator → Product upsert: upserts each item
src/lib/engine/syncEngine.ts - Sync orchestrator → Application database: writes sync logs
src/lib/engine/syncEngine.ts - Product upsert → Application database: updates products and history
- Price trend calculation → Application database: uses price history