How pika9000/ao-shop works
Áo Shop is a small Vietnamese clothing storefront. A visitor opens the product listing, which reads products from the database and renders add-to-cart controls; those controls update a browser-persisted cart, whose count appears in the navigation. The navigation also exposes sign-in and sign-out, handled through NextAuth with Google and email providers. The root layout supplies the shared navigation and cart/session providers. Source excerpts show these flows, but no checkout, payment, or product-detail implementation is established by the supplied evidence.
Main entry points: route.js Auth handler · CartContext.jsx Cart state · layout.jsx Root layout · page.jsx Product listing
Components 13
Storefront
- Root layout
src/app/layout.jsx - Product listing
src/app/page.jsx - Navigation
src/components/Navbar.jsx
Cart
- Add-to-cart button
src/components/AddToCartButton.jsx - Cart state
src/components/CartContext.jsx - Browser storage
Identity
- Session provider
src/components/Providers.jsx - Auth handler
src/app/api/auth/[...nextauth]/route.js
Data
- Prisma client
src/lib/prisma.ts - Product database
prisma/schema.prisma
Other components
- Visitor
- Google identity
- Email sign-in
Connections 15
- Visitor → Product listing: opens
src/app/page.jsx - Root layout → Session provider: wraps
src/app/layout.jsx - Root layout → Navigation: renders
src/app/layout.jsx - Root layout → Cart state: provides
src/app/layout.jsx - Product listing → Prisma client: queries
src/app/page.jsx - Prisma client → Product database: accesses
- Product listing → Add-to-cart button: renders
src/app/page.jsx - Add-to-cart button → Cart state: updates
src/components/AddToCartButton.jsx - Cart state → Browser storage: reads and writes
src/components/CartContext.jsx - Navigation → Cart state: reads count
src/components/Navbar.jsx - Navigation → Auth handler: starts sign-in
- Session provider → Auth handler: supplies session
- Auth handler → Prisma client: configures adapter
src/app/api/auth/[...nextauth]/route.js - Auth handler → Google identity: configures provider
src/app/api/auth/[...nextauth]/route.js - Auth handler → Email sign-in: configures provider
src/app/api/auth/[...nextauth]/route.js