How heng148/stock_x works
This is a StockX-style resale marketplace: shoppers browse products and product details, then can watch items or buy; sellers create listings, while buyers can bid and manage purchases. Registration includes email verification, and authentication supports credentials and Google. Admin pages manage catalog, users, categories, and orders. The graph also includes notifications and recommendations as supporting capabilities. Most relationships come from sampled excerpts or SOURCE INDEX references; unsampled pages are represented at their exact enclosing paths, so their internal calls are not asserted.
Main entry points: index.ts Marketplace database · market.ts Listings, bids, orders · route.ts Email verification · page.tsx Product browse
Components 22
Identity
- Registration
src/app/(auth)/register/page.tsx - Email verification
src/app/api/register/send-code/route.ts - Account API
src/app/api/register/route.ts - Login API
src/app/api/login/route.ts - Authentication
src/auth.ts
Product discovery
- Product browse
src/app/(home)/browse/page.tsx - Product detail
src/app/(home)/[category]/[slug]/page.tsx - Product cards
src/components/ProductCard.tsx - Recommendations
src/server/recommend.ts
Marketplace operations
- Market actions
src/components/action/Marketactions.tsx - Listings, bids, orders
src/server/market.ts - Buyer and seller profile
src/app/(home)/profile
Administration
- Admin management
src/app/admin - Featured expiry
src/app/api/expire-featured/route.ts
Shared services
- Notifications
src/server/notifications.ts - Marketplace database
src/db/index.ts - Data model
src/db/schema.ts
Other components
- Shopper
- Seller
- Admin
- Google sign-in
- Resend email
Connections 25
- Shopper → Product browse: browses
- Seller → Market actions: lists items
- Shopper → Market actions: places bids
- Admin → Admin management: manages
- Registration → Email verification: requests code
- Email verification → Marketplace database: stores token
src/app/api/register/send-code/route.ts - Email verification → Resend email: sends code
src/app/api/register/send-code/route.ts - Registration → Account API: creates account
- Account API → Marketplace database: creates user
src/app/api/register/route.ts - Login API → Marketplace database: checks user
src/app/api/login/route.ts - Shopper → Authentication: signs in
- Google sign-in → Authentication: authenticates
- Authentication → Marketplace database: reads users
src/auth.ts - Product browse → Marketplace database: reads products
src/app/(home)/browse/page.tsx - Product browse → Product cards: renders
src/app/(home)/browse/page.tsx - Product cards → Recommendations: requests suggestions
src/components/ProductCard.tsx - Market actions → Listings, bids, orders: invokes actions
src/components/action/Marketactions.tsx - Listings, bids, orders → Marketplace database: reads and writes
src/server/market.ts - Listings, bids, orders → Notifications: notifies admins
src/server/market.ts - Notifications → Marketplace database: stores notices
src/server/notifications.ts - Admin management → Marketplace database: reads and manages
src/app/admin/categories/page.tsx - Featured expiry → Marketplace database: expires listings
src/app/api/expire-featured/route.ts - Buyer and seller profile → Marketplace database: reads profile data
src/app/(home)/profile/page.tsx - Listings, bids, orders → Buyer and seller profile: revalidates profile
src/server/market.ts - Marketplace database → Data model: uses tables