How shuxrat4ik/wongeidwqiegzierw-pqle works
This repository implements a digital-games marketplace: users browse and filter titles, manage a cart or wishlist, check out, and access owned games and downloads. It also includes account, admin catalog, and newsletter capabilities. The README provides no architecture detail; connections below are limited to relationships shown in sampled source or SOURCE INDEX references, so unsampled API behavior is represented cautiously.
Main entry points: auth.tsx Account sessions · supabase.ts Browser database client · db.ts Catalog queries · page.tsx Storefront
Components 25
Storefront and discovery
- Storefront
app/page.tsx - Pro catalog
app/pro/page.tsx - Game detail
app/games/[slug]/GameDetailClient.tsx - Catalog queries
lib/db.ts - Seed catalog
lib/top-games.ts - Game cards
components/GameCard.tsx
Accounts and collections
- Account sessions
lib/auth.tsx - Sign in and registration
app/auth/page.tsx - Game library
app/library/page.tsx - Wishlist state
hooks/useWishlist.ts - Seed collections
lib/game-collections.ts - Browser database client
lib/supabase.ts
Commerce and delivery
- Cart state
hooks/useCart.ts - Cart checkout entry
app/cart/page.tsx - Checkout handler
app/api/checkout/route.ts - Affiliate links
lib/affiliate.ts - Download handler
app/api/download/route.ts - Signed downloads
lib/server/download-service.ts - Service-role client
lib/supabase-admin.ts
Catalog and engagement
- Admin catalog API
app/api/admin/games/route.ts - Admin authorization
lib/require-admin.ts - Newsletter engine
lib/newsletterEngine.ts - Newsletter delivery
lib/sendNewsletter.ts
Other components
- Shopper
- Supabase
Connections 31
- Shopper → Storefront: browses
- Storefront → Catalog queries: fetches catalog
app/page.tsx - Storefront → Cart state: uses cart
app/page.tsx - Storefront → Wishlist state: uses wishlist
app/page.tsx - Pro catalog → Catalog queries: fetches games
app/pro/page.tsx - Pro catalog → Seed catalog: filters fallback
app/pro/page.tsx - Game detail → Seed collections: reads collections
app/games/[slug]/GameDetailClient.tsx - Game detail → Catalog queries: uses game data
app/games/[slug]/GameDetailClient.tsx - Sign in and registration → Account sessions: uses auth
app/auth/page.tsx - Account sessions → Browser database client: reads session
lib/auth.tsx - Cart state → Account sessions: reads user
hooks/useCart.ts - Cart state → Browser database client: reads cart
hooks/useCart.ts - Cart state → Catalog queries: normalizes game rows
hooks/useCart.ts - Cart checkout entry → Account sessions: uses auth
app/cart/page.tsx - Cart checkout entry → Browser database client: uses database
app/cart/page.tsx - Cart checkout entry → Catalog queries: uses game data
app/cart/page.tsx - Shopper → Checkout handler: submits checkout
- Checkout handler → Service-role client: loads games
app/api/checkout/route.ts - Checkout handler → Affiliate links: builds affiliate links
app/api/checkout/route.ts - Download handler → Service-role client: creates client
app/api/download/route.ts - Download handler → Signed downloads: requests signed download
app/api/download/route.ts - Game library → Account sessions: uses auth
app/library/page.tsx - Game library → Seed collections: loads seed collections
app/library/page.tsx - Wishlist state → Account sessions: reads user
hooks/useWishlist.ts - Wishlist state → Browser database client: uses database
hooks/useWishlist.ts - Wishlist state → Seed collections: uses seed collections
hooks/useWishlist.ts - Admin catalog API → Admin authorization: checks admin
app/api/admin/games/route.ts - Admin authorization → Service-role client: uses service client
lib/require-admin.ts - Newsletter engine → Newsletter delivery: sends newsletter
lib/newsletterEngine.ts - Browser database client → Supabase: connects
lib/supabase.ts - Service-role client → Supabase: connects
lib/supabase-admin.ts