How dhrefund/amazonenextjs15 works
Project type and purpose
• This is a full-stack e-commerce web application built with Next.js (v15) and MongoDB/Mongoose.
• It supports user authentication (Auth.js with credentials, Google, magic link), shopping cart, checkout (Stripe & PayPal), order management, product catalog, browsing history, and an admin dashboard (orders, products, settings, users, web pages).
File structure
• Top-level “app” folder: Next.js 13+ App Router pages, split by locale and route groups (auth, home, root, admin, checkout, API).
• “app/api”: serverless route handlers for auth (NextAuth), product browsing history, file uploads (uploadthing), Stripe webhooks.
• “components”: shared UI pieces and domain components (cart sidebar, product cards, forms).
• “components/ui”: foundational primitives (buttons, dialogs, inputs) – a design system layer.
• “lib”: business logic/actions (order, product, review, setting, user, web-page), database client and models, utilities, validators, third-party wrappers (PayPal, uploadthing).
• “hooks”: client state and behavior hooks (cart store, browsing history, theme, device type).
• Configuration files for Tailwind, i18n, Next.js, ESLint, TypeScript.
README for additional insights
• Tech stack: Next.js 15, React 19, Tailwind CSS, Shadcn/UI, Recharts for charts.
• Database: MongoDB via Mongoose.
• Payments: PayPal & Stripe.
• Auth: Auth.js (NextAuth).
• Deployment: GitHub & Vercel.
• Utilities: uploadthing (file upload), resend (emails), zod (validation).