How christianjjc/teslo-shop works
This is a Next.js storefront for browsing apparel, managing a cart, checking out, paying for orders, and administering products, orders, and users. The main customer flow starts at the product catalog, continues through cart and address/checkout, and ends with an order and payment; the excerpts directly verify only selected parts of that flow. The graph retains the tree’s major domain areas, including authentication, admin, and seeded catalog data. Edges are limited to shown imports/calls or documented setup; unsampled links are omitted rather than inferred.
Main entry points: page.tsx Product catalog · order Order actions · orders Order pages · admin Admin pages
Components 19
Storefront
- Product catalog
src/app/(shop)/page.tsx - Product detail
src/app/(shop)/product/[slug]/page.tsx - Catalog actions
src/actions/products - Product components
src/components/products/product-grid
Checkout & orders
- Cart
src/app/(shop)/cart/page.tsx - Cart state
src/store/cart/cart-store.ts - Checkout & address
src/app/(shop)/checkout - Order actions
src/actions/order - Order pages
src/app/(shop)/orders - Payment actions
src/actions/payments - PayPal button
src/components/paypal/PaypalButton.tsx
Administration
- Admin pages
src/app/(shop)/admin - Admin actions
src/actions/users - Product management
src/actions/products/create-update-product.ts
Shared services
- Authentication
src/auth.config.ts - Sign-in pages
src/app/auth - Prisma database
src/lib/prisma.ts - Sample catalog data
src/seed/seed-database.ts
Other components
- Shopper
Connections 19
- Shopper → Product catalog: browses
src/app/(shop)/page.tsx - Product catalog → Catalog actions: loads products
src/app/(shop)/page.tsx - Product catalog → Product components: renders grid
src/app/(shop)/page.tsx - Product detail → Catalog actions: loads product
src/app/(shop)/product/[slug]/page.tsx - Shopper → Cart: reviews cart
src/app/(shop)/cart/page.tsx - Cart → Checkout & address: offers checkout
- Shopper → Order pages: views orders
src/app/(shop)/orders/[id]/page.tsx - Order pages → Order actions: loads order
src/app/(shop)/orders/[id]/page.tsx - Order pages → PayPal button: renders payment
src/app/(shop)/orders/[id]/page.tsx - PayPal button → Payment actions: checks payment
src/components/paypal/PaypalButton.tsx - Shopper → Sign-in pages: signs in
- Sign-in pages → Authentication: uses auth
- Authentication → Prisma database: looks up user
src/auth.config.ts - Order actions → Authentication: checks session
src/actions/order/place-order.ts - Order actions → Prisma database: creates order
src/actions/order/place-order.ts - Shopper → Admin pages: administers store
- Admin pages → Admin actions: manages users
- Admin pages → Product management: manages products
src/app/(shop)/admin/products/page.tsx - Sample catalog data → Prisma database: seeds records
src/seed/seed-database.ts