How chel12/nextproject works
This is a Next.js storefront for browsing and purchasing game-related products, with account, order-history, and administrative features. The main customer flow is catalog browsing and filtering, adding configured items to a token-based cart, submitting checkout, and completing payment through a callback that updates the order and emails the customer. The graph separates storefront, commerce, identity/admin, and persistence concerns. Evidence is limited to the README, file tree, SOURCE INDEX references, and supplied excerpts; some unsampled links are therefore omitted.
Main entry points: prisma-client.ts Application Database · actions.ts Order Actions · route.ts Payment Callback · page.tsx Product Catalog
Components 21
Storefront
- Product Catalog
app/(root)/page.tsx - Catalog Search
shared/components/shared/search-input.tsx - Filter State
shared/hooks/use-filters.ts - Product Detail
app/(root)/product/[id]/page.tsx
Cart and Checkout
- Cart UI
shared/components/shared/cart-drawer.tsx - Cart API
app/api/cart/route.ts - Cart Store
shared/store/cart.ts - Checkout
app/(checkout)/checkout/page.tsx - Order Actions
app/actions.ts - Payment Creation
shared/lib/creat-payments.ts - Payment Callback
app/api/checkout/callback/route.ts - Email Delivery
shared/lib/send-email.ts
Identity and Admin
- Authentication
shared/constants/auth-options.ts - Session Lookup
shared/lib/get-user-session.ts - Profile and Orders
app/(root)/profile/page.tsx - Order Management
shared/components/shared/admin-orders-panel.tsx - User Management
shared/components/shared/admin-users-panel.tsx
Persistence and Services
- Application Database
prisma/prisma-client.ts - Client API Facade
shared/services/api-client.ts
Other components
- Customer
- Administrator
Connections 27
- Customer → Product Catalog: browses
app/(root)/page.tsx - Product Catalog → Filter State: uses filters
- Customer → Catalog Search: searches
- Product Catalog → Product Detail: opens product
- Customer → Cart UI: adds items
- Cart UI → Cart API: requests cart
- Cart API → Application Database: reads and writes
app/api/cart/route.ts - Cart API → Cart Store: updates client state
- Customer → Checkout: checks out
app/(checkout)/checkout/page.tsx - Checkout → Order Actions: submits order
app/(checkout)/checkout/page.tsx - Checkout → Client API Facade: uses services
app/(checkout)/checkout/page.tsx - Order Actions → Application Database: creates order
app/actions.ts - Order Actions → Payment Creation: creates payment
app/actions.ts - Order Actions → Email Delivery: sends payment email
app/actions.ts - Payment Callback → Application Database: updates order
app/api/checkout/callback/route.ts - Payment Callback → Email Delivery: sends confirmation
app/api/checkout/callback/route.ts - Payment Callback → Customer: payment status
- Customer → Authentication: authenticates
- Authentication → Application Database: checks user
shared/constants/auth-options.ts - Session Lookup → Authentication: resolves session
shared/lib/get-user-session.ts - Profile and Orders → Application Database: loads profile
app/(root)/profile/page.tsx - Administrator → Order Management: manages orders
- Administrator → User Management: manages users
- Order Management → Order Actions: invokes actions
shared/components/shared/admin-orders-panel.tsx - User Management → Order Actions: invokes actions
shared/components/shared/admin-users-panel.tsx - Order Management → Application Database: loads orders
app/(root)/admin/orders/page.tsx - User Management → Application Database: loads users
app/(root)/admin/users/page.tsx