A small Next.js e-commerce flow: product catalog, shopping cart, checkout, and order history. Built with Next.js 15, TypeScript, Tailwind CSS, and SQLite (Prisma).
- Shop: Browse products on the homepage and add them to the cart.
- Cart: Open the cart from the header to change quantities or remove items.
- Checkout: Review the order and place it; you’re redirected to a confirmation page and the cart is cleared.
- Orders:
/admin/ordersshows all placed orders (ID, date, total).
Prerequisites: Node.js 18+, pnpm.
-
Install dependencies
pnpm install
-
Set up the database
Ensure
DATABASE_URLis set (e.g. in.envor.env.development). Example:# .env or .env.development DATABASE_URL="file:./dev.db"
Then push the schema and seed products:
pnpm db:seed
-
Start the dev server
pnpm dev
Open http://localhost:3000.
pnpm build— production buildpnpm db:push— apply schema to the database (no seed)pnpm db:studio— open Prisma Studio to inspect data