Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# env files (can opt-in for committing if needed)
.env*

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
5 changes: 5 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!-- BEGIN:nextjs-agent-rules -->
# This is NOT the Next.js you know

This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` before writing any code. Heed deprecation notices.
<!-- END:nextjs-agent-rules -->
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@AGENTS.md
66 changes: 66 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Amazona — Amazon-style Storefront (Demo)

A full-featured, Amazon-inspired e-commerce storefront built with **Next.js (App
Router)**, **React**, **TypeScript**, and **Tailwind CSS v4**.

> This is an original demo project for learning purposes. It is **not**
> affiliated with, endorsed by, or connected to Amazon.com, Inc. All branding
> ("Amazona"), product names, and imagery are original placeholders.

## Features

- **Amazon-style layout** — dark top nav with category-scoped search, secondary
category nav, and a multi-column footer.
- **Home page** — hero banner, curated "shelf" cards, and a full recommended
product grid.
- **Search & listing** — full-text search across the catalog with department
filters, star-rating filters, and sort (featured / price / rating).
- **Product detail** — image, ratings, discount + list price, bullet features,
quantity selector, Add to Cart / Buy Now, and related products.
- **Cart** — line items with quantity edit and remove, live subtotal, persisted
to `localStorage` so it survives reloads.
- **Mock checkout** — shipping + payment form with validation, order summary
with tax/shipping, and an order-confirmation state. No real payment is
processed.

## Tech

- Next.js 16 (App Router, static prerendering via `generateStaticParams`)
- React 19 + TypeScript
- Tailwind CSS v4
- Client-side cart state via React Context + `useReducer`, persisted to
`localStorage`. No database — the catalog is seeded in `src/lib/products.ts`.

## Getting started

```bash
npm install
npm run dev # http://localhost:3000
```

Other scripts:

```bash
npm run build # production build
npm run start # serve the production build
npm run lint # eslint
```

## Project structure

```
src/
app/
layout.tsx # root layout: CartProvider, Header, Footer
page.tsx # home
search/page.tsx # search / listing
product/[id]/page.tsx # product detail (SSG)
cart/page.tsx # cart
checkout/page.tsx # mock checkout
components/ # Header, Footer, ProductCard, Stars, BuyBox, CartView, CheckoutView, SearchResults
lib/
products.ts # seed catalog + search helpers
cart-context.tsx # cart state (Context + useReducer + localStorage)
format.ts # price formatting (server + client safe)
public/products/ # generated SVG placeholder images
```
18 changes: 18 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { defineConfig, globalIgnores } from "eslint/config";
import nextVitals from "eslint-config-next/core-web-vitals";
import nextTs from "eslint-config-next/typescript";

const eslintConfig = defineConfig([
...nextVitals,
...nextTs,
// Override default ignores of eslint-config-next.
globalIgnores([
// Default ignores of eslint-config-next:
".next/**",
"out/**",
"build/**",
"next-env.d.ts",
]),
]);

export default eslintConfig;
17 changes: 17 additions & 0 deletions next.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type { NextConfig } from "next";

const nextConfig: NextConfig = {
// Allow the Vorflux preview proxy hostname to request dev-only resources
// (fonts, HMR) so the app hydrates correctly when accessed through the
// public preview URL during development/testing.
allowedDevOrigins: ["*.vorflux.com", "shf67bq5jzyg.preview.us1.vorflux.com"],
images: {
// Local placeholder assets are SVGs; allow them to be served through
// next/image without the optimizer rejecting SVG sources.
dangerouslyAllowSVG: true,
contentSecurityPolicy:
"default-src 'self'; script-src 'none'; sandbox;",
},
};

export default nextConfig;
Loading