How abhiramposham/shopeasy works
ShopEasy is an e-commerce storefront. Shoppers browse and search products, view details, add items to a cart, authenticate when needed, and submit orders; the server routes requests to authentication and storage. The client also exposes home-page promotions and newsletter content. The excerpts show the browser API client and server route/storage calls, but not all page implementations; those page-level branches are represented using paths established by the tree and SOURCE INDEX.
Main entry points: App.tsx App router · routes.ts API routes · use-cart.tsx Cart state · use-auth.tsx Auth state
Components 21
Storefront
- Home experience
client/src/pages/home-page.tsx - Promotions and benefits
client/src/components/home
Shopping and checkout
- Product catalog
client/src/pages/products-page.tsx - Product grid
client/src/components/product/product-grid.tsx - Product cards
client/src/components/product/product-card.tsx - Product details
client/src/pages/product-detail-page.tsx - Cart interface
client/src/components/layout/cart-sidebar.tsx - Cart state
client/src/hooks/use-cart.tsx - Checkout
client/src/pages/checkout-page.tsx
Identity
- Sign in and register
client/src/pages/auth-page.tsx - Auth state
client/src/hooks/use-auth.tsx - Protected route
client/src/lib/protected-route.tsx
API and persistence
- API routes
server/routes.ts - Session authentication
server/auth.ts - Commerce storage
server/storage.ts - Domain schema
shared/schema.ts - HTTP server
server/index.ts
Client runtime
- App router
client/src/App.tsx - API client
client/src/lib/queryClient.ts - Client entry
client/src/main.tsx
Other components
- Shopper
Connections 26
- Shopper → App router: uses storefront
- Client entry → App router: renders
client/src/main.tsx - App router → Home experience: routes to
client/src/App.tsx - App router → Product catalog: routes to
client/src/App.tsx - App router → Product details: routes to
client/src/App.tsx - App router → Checkout: protects route
client/src/App.tsx - App router → Sign in and register: routes to
client/src/App.tsx - Home experience → Promotions and benefits: displays
- Product catalog → Product grid: displays
- Product grid → Product cards: renders
client/src/components/product/product-grid.tsx - Product cards → Cart state: adds item
client/src/components/product/product-card.tsx - Cart interface → Cart state: uses
- Checkout → Cart state: uses cart
- Sign in and register → Auth state: uses
- App router → Auth state: provides context
client/src/App.tsx - App router → Cart state: provides context
client/src/App.tsx - App router → Protected route: uses
client/src/App.tsx - Auth state → API client: sends requests
client/src/hooks/use-auth.tsx - Cart state → API client: sends requests
client/src/hooks/use-cart.tsx - API client → API routes: calls API
- HTTP server → API routes: registers routes
server/index.ts - API routes → Session authentication: sets up auth
server/routes.ts - Session authentication → Commerce storage: reads and writes users
server/auth.ts - API routes → Commerce storage: reads and writes commerce data
server/routes.ts - Commerce storage → Domain schema: uses data types
server/storage.ts - API routes → Domain schema: validates request data
server/routes.ts