How ski043/shoemarshal works
Purpose and Runtime
This is a full-stack Next.js App Router e-commerce application with a public shoe storefront and authenticated administrative dashboard. It runs as a React/TypeScript server-rendered application, with route handlers for third-party callbacks and webhooks. Root composition and global styling begin at app/layout.tsx and app/globals.css.
Route Domains and Entry Points
The storefront is isolated in a route group, so it shares commerce layout/navigation without changing public URLs. Primary customer entry points are the landing page, catalog/category views, product detail, bag, and payment outcomes:
• app/(storefront)/page.tsx
• app/(storefront)/product/[id]/page.tsx
• app/(storefront)/bag/page.tsx
The management area is rooted at app/dashboard/layout.tsx, with dashboard overview, product management, banner management, and order views:
• app/dashboard/page.tsx
• app/dashboard/products/page.tsx
• app/dashboard/orders/page.tsx
Storefront Commerce Flow
Storefront pages render product discovery and presentation through composed storefront components, including category selection, featured products, product cards, image galleries, and account navigation:
• app/components/storefront/FeaturedProducts.tsx
• app/components/storefront/ProductCard.tsx
• app/components/storefront/Navbar.tsx
A customer navigates catalog/category pages to a dynamic product (product/[id]), adds items to the bag, then proceeds into Stripe-backed payment. Dedicated success and cancellation routes provide post-checkout return states:
• app/(storefront)/payment/success/page.tsx
• app/(storefront)/payment/cancel/page.tsx
• app/api/stripe/route.ts
Identity, Cart, and Checkout Boundaries
Kinde supplies authentication, including its catch-all authentication handler; a separate creation endpoint likely provisions application-side user state after identity events:
• app/api/auth/[kindeAuth]/route.ts
• app/api/auth/creation/route.ts
Cart state is backed by Upstash Redis rather than the relational database, separating transient/session-oriented shopping state from durable commerce records. Stripe is encapsulated behind a local client module and API route, with Stripe webhooks serving as the payment-system boundary:
• app/lib/redis.ts
• app/lib/stripe.ts
• app/api/stripe/route.ts
Durable Data and Business Mutations
Prisma defines the durable domain model and connects the app to Neon/Postgres. Server-side mutations are centralized in app/actions.ts, providing the likely boundary for validated product, banner, cart, or checkout-related operations. Zod schemas formalize server validation:
• prisma/schema.prisma
• app/lib/db.ts
• app/actions.ts
Dashboard create/edit/delete routes drive administration of products and banners, while order data feeds operational views:
• app/dashboard/products/create/page.tsx
• app/dashboard/products/[id]/page.tsx
• app/dashboard/banner/[id]/delete/page.tsx
Media and Presentation Infrastructure
Product and promotional media upload through UploadThing route/core integration; persisted uploads are then consumed by dashboard forms and storefront renderers. Static sample shoe imagery remains in public/:
• app/api/uploadthing/core.ts
• app/api/uploadthing/route.ts
• app/components/dashboard/EditForm.tsx
The dashboard includes reporting-oriented widgets, notably charting and recent-sales views, while shared Shadcn-style primitives provide the UI layer:
• app/components/dashboard/Chart.tsx
• app/components/dashboard/DashboardStats.tsx
• components/ui
Deployment Dependencies
Material external services are Kinde (identity), Neon/Postgres via Prisma (durable records), Upstash Redis (cart), Stripe (Checkout and webhook events), and UploadThing (media). The project is configured as a Next.js deployment, intended for Vercel, with Tailwind styling and static public assets.
Main entry points: actions.ts Server actions · (storefront)/page.tsx Storefront routes · dashboard/page.tsx Dashboard views · create/page.tsx Product & banner editing
Components 20
Storefront
Public commerce routes and UI.
- Storefront routes · Landing, product detail, and bag entry points.
app/(storefront)/page.tsx - Product detail
app/(storefront)/product/[id]/page.tsx - Bag
app/(storefront)/bag/page.tsx - Storefront components · Navigation, featured products, and product cards.
app/components/storefront/FeaturedProducts.tsx - Payment return states · Checkout success and cancellation outcomes.
app/(storefront)/payment/success/page.tsx
Administration
Authenticated management and reporting.
- Dashboard shell
app/dashboard/layout.tsx - Dashboard views · Overview, products, and orders.
app/dashboard/page.tsx - Product & banner editing · Create, edit, and delete management routes.
app/dashboard/products/create/page.tsx - Reporting widgets · Charts and sales summaries.
app/components/dashboard/Chart.tsx
Application Core
Server mutations and integration boundaries.
- Root layout & styles
app/layout.tsx - Server actions · Centralized validated commerce and administration mutations.
app/actions.ts - Kinde auth handlers · Authentication callback and user provisioning endpoints.
app/api/auth/[kindeAuth]/route.ts - Stripe checkout & webhook · Local payment boundary for checkout and Stripe events.
app/api/stripe/route.ts - UploadThing integration · Media upload route and core configuration.
app/api/uploadthing/route.ts
Data & Providers
Durable, session, and third-party services.
- Prisma domain model
prisma/schema.prisma - Neon Postgres
- Upstash Redis · Session-oriented cart state.
- Stripe · Checkout sessions and webhook events.
- Kinde
- UploadThing
Connections 21
- Root layout & styles → Storefront routes: composes
- Root layout & styles → Dashboard shell: composes
- Storefront routes → Storefront components: renders
- Storefront routes → Product detail: navigates to
- Product detail → Bag: adds items to
- Bag → Stripe checkout & webhook: starts checkout
- Stripe checkout & webhook → Payment return states: returns customer
- Storefront routes → Server actions: reads and mutates
- Dashboard shell → Dashboard views: hosts
- Dashboard views → Reporting widgets: renders
- Dashboard views → Product & banner editing: manages
- Product & banner editing → Server actions: invokes
- Server actions → Prisma domain model: uses
- Prisma domain model → Neon Postgres: persists to
- Server actions → Upstash Redis: updates cart
- Stripe checkout & webhook → Stripe: creates sessions / receives events
- Kinde auth handlers → Kinde: handles identity events
- Kinde auth handlers → Server actions: provisions app user
- UploadThing integration → UploadThing: uploads media
- Product & banner editing → UploadThing integration: submits media
- Server actions → Neon Postgres: stores commerce records