How lingaaannela/nxt-react works
This is a coffee-gear storefront and learning demo. The main shopper flow is browsing products, adding items to a client-side cart, and submitting checkout; administrators can manage products and view stats, while separate pages provide learning topics and rendering demonstrations. The product collection is explicitly an in-memory mock store, not a persistent database. The graph uses the source index and excerpts for relationships; some route wiring is not shown, so uncertain connections are omitted.
Main entry points: api.ts Product API slice · actions.ts Product actions · mock-products.ts Mock product store · page.tsx Interactive catalog
Components 24
Shopper experience
- Home page
src/app/page.tsx - Product listing
src/app/products/page.tsx - Product detail
src/app/products/[id]/page.tsx - Interactive catalog
src/app/catalog/page.tsx - URL search input
src/components/ProductSearchInput.tsx - Checkout form
src/components/CheckoutForm.tsx - Order action
src/app/checkout/actions.ts
Client state and services
- Product API slice
src/lib/redux/api.ts - Products route
src/app/api/products/route.ts - Cart state
src/lib/redux/features/cartSlice.ts - Mock product store
src/lib/shop/mock-products.ts - Toast provider
src/lib/toast/ToastProvider.tsx
Administration
- Admin login
src/app/admin/login/actions.ts - Session checks
src/lib/auth/session.ts - Product actions
src/app/admin/products/actions.ts - Product forms
src/components/ProductCreateForm.tsx - Edit form
src/components/ProductEditForm.tsx - Stats dashboard
src/components/StatsDashboard.tsx - Stats loader
src/components/DynamicStatsDashboard.tsx
Learning and demos
- Topic content service
src/lib/topics.ts - Topic index
src/app/learn/page.tsx - Topic page
src/app/learn/[topic]/page.tsx - Virtualization demo
src/app/virtualize/page.tsx
Other components
- Shopper
Connections 24
- Shopper → Home page: opens
- Home page → Mock product store: reads products
src/app/page.tsx - Product detail → Mock product store: reads product
src/app/products/[id]/page.tsx - Product listing → URL search input: renders
src/app/products/page.tsx - Interactive catalog → Product API slice: queries products
src/app/catalog/page.tsx - Interactive catalog → Cart state: dispatches add
src/app/catalog/page.tsx - Interactive catalog → Toast provider: shows notice
src/app/catalog/page.tsx - Checkout form → Product API slice: queries products
src/components/CheckoutForm.tsx - Checkout form → Cart state: reads and clears
src/components/CheckoutForm.tsx - Checkout form → Order action: submits order
src/components/CheckoutForm.tsx - Order action → Mock product store: reads products
src/app/checkout/actions.ts - Product API slice → Product actions: calls mutations
src/lib/redux/api.ts - Product API slice → Products route: fetches products
src/lib/redux/api.ts - Products route → Mock product store: reads products
src/app/api/products/route.ts - Admin login → Session checks: creates session
- Product actions → Session checks: checks session
src/app/admin/products/actions.ts - Product actions → Mock product store: mutates products
src/app/admin/products/actions.ts - Product forms → Product actions: submits product
src/components/ProductCreateForm.tsx - Edit form → Product API slice: updates product
src/components/ProductEditForm.tsx - Product API slice → Product actions: wraps update
src/lib/redux/api.ts - Stats loader → Stats dashboard: loads dashboard
src/components/DynamicStatsDashboard.tsx - Topic index → Topic content service: loads metadata
src/app/learn/page.tsx - Topic page → Topic content service: loads topic
src/app/learn/[topic]/page.tsx - Virtualization demo → Product API slice: queries products
src/app/virtualize/page.tsx