Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
519e533
Add storefront agent rules aligned with backend
pawelekbyra Jul 5, 2026
96af566
Add system map aligned with backend repository
pawelekbyra Jul 5, 2026
aedc399
Add storefront direction documentation
pawelekbyra Jul 5, 2026
cd8282f
Document storefront deployment environment variables
pawelekbyra Jul 5, 2026
0384208
Document temporary shortcuts and technical debt
pawelekbyra Jul 5, 2026
ebee50f
Mark Vercel-first deploy as temporary shortcut
pawelekbyra Jul 5, 2026
efb55fc
Add Vercel first deploy guide
pawelekbyra Jul 5, 2026
99b034a
Document Vercel Commerce direction
pawelekbyra Jul 5, 2026
d353ce1
Record Vercel Commerce adapter debt
pawelekbyra Jul 5, 2026
9ded922
Add Vercel Commerce prototype plan
pawelekbyra Jul 5, 2026
8042e97
Fix build when Spree env vars are missing
pawelekbyra Jul 6, 2026
4517b17
Add Spree configuration guard
pawelekbyra Jul 6, 2026
fec6eb2
Skip cached market fetches when Spree is unconfigured
pawelekbyra Jul 6, 2026
17ced31
Skip cached category fetches when Spree is unconfigured
pawelekbyra Jul 6, 2026
1b171c5
Skip cached product fetches when Spree is unconfigured
pawelekbyra Jul 6, 2026
850d10a
Avoid cookies during unconfigured featured products build
pawelekbyra Jul 6, 2026
556239f
Type product fallbacks as SDK responses
pawelekbyra Jul 6, 2026
0857d01
Type category product fallback as SDK response
pawelekbyra Jul 6, 2026
867ae07
Add Vercel deployment configuration
claude Jul 6, 2026
f8c3f90
Fix vercel.json: remove invalid nodeVersion property
claude Jul 6, 2026
fab88a2
Fix vercel.json env var defaults
claude Jul 6, 2026
0871b1d
Remove vercel.json - let Vercel auto-detect Next.js
claude Jul 6, 2026
bd70c7e
fix: add product type guard for canonical URL generation
claude Jul 6, 2026
e29341a
fix: properly type product in page component
claude Jul 6, 2026
d5e3855
fix: use proper ReturnType for product typing
claude Jul 6, 2026
057be5e
fix: add non-null assertions for product in page component
claude Jul 6, 2026
b64ba8e
fix: add missing pagination metadata fields
claude Jul 6, 2026
9437000
fix: add remaining pagination meta fields and use unknown cast
claude Jul 6, 2026
ba7fb32
fix: normalize empty response pagination metadata
claude Jul 6, 2026
b29ed62
fix: add missing ProductFiltersResponse fields
claude Jul 6, 2026
c4b9633
fix: add type guard for category in metadata generation
claude Jul 6, 2026
dfba892
fix: add type guard for product in metadata generation
claude Jul 6, 2026
8868305
fix: use product ID instead of slug for routing
claude Jul 6, 2026
7127bf9
fix: prevent self-redirect loop on transient markets fetch failure
claude Jul 6, 2026
3c2cbd5
feat: white-label rebrand + locale-only URLs (no country segment)
claude Jul 6, 2026
c0e62a9
chore: trigger Vercel deploy
claude Jul 6, 2026
9389939
chore: trigger deploy to refresh edge-cached /products response
claude Jul 6, 2026
34e9354
feat: add manual revalidate endpoint for product-list cache
claude Jul 6, 2026
b8d02ae
docs: przebudowa dokumentacji pod Kakałowy Sklepik
claude Jul 6, 2026
3ddd4aa
Merge pull request #2 from pawelekbyra/claude/ecommerce-shop-infrastr…
pawelekbyra Jul 6, 2026
1df2f67
fix: use "max" profile to force revalidateTag to bust immediately
claude Jul 7, 2026
2947941
fix: also revalidatePath the whole layout, not just the data tag
claude Jul 7, 2026
d356859
debug: temporarily disable products list cache to isolate root cause
claude Jul 7, 2026
7bb8e15
debug: also disable cache on the single-product fetch
claude Jul 7, 2026
b866d08
debug: log product fetch result on the detail page
claude Jul 7, 2026
96710af
debug: raw fetch bypassing SDK to see real baseUrl/status/body
claude Jul 7, 2026
dcbc9de
fix: guard product page against a falsy fetch result, restore caching
claude Jul 7, 2026
801387b
feat: daily EUR price sync from NBP exchange rate via Vercel Cron
claude Jul 7, 2026
2e4b722
debug: report which env var is actually missing
claude Jul 7, 2026
3ca4d0d
fix: allow product images from Render backend in next/image (#3)
pawelekbyra Jul 7, 2026
4d483db
feat: revalidate storefront cache on product webhook events (#4)
pawelekbyra Jul 7, 2026
171a1bf
feat: also revalidate cache on product status/stock webhook events (#5)
pawelekbyra Jul 7, 2026
6f80f8d
docs: dodaj instrukcję jak dopisywać kolejne webhook eventy produktowe
claude Jul 7, 2026
2dd7bf5
docs: dodaj instrukcję jak dopisywać kolejne webhook eventy produktow…
pawelekbyra Jul 7, 2026
7f4fe09
fix: nie blokuj strony na resolveCurrency przed Suspense
claude Jul 7, 2026
a81150a
docs: udokumentuj fix blokowania strony na resolveCurrency
claude Jul 7, 2026
9cf6a95
Merge pull request #7 from pawelekbyra/claude/image-upload-display-di…
pawelekbyra Jul 7, 2026
a95d762
fix: prefer large (720px) over xlarge (2000px) for eager gallery image
claude Jul 7, 2026
886f977
Merge pull request #8 from pawelekbyra/claude/image-upload-display-di…
pawelekbyra Jul 7, 2026
34baab5
fix: zastąp zepsuty CountrySwitcher przełącznikiem języka (F11 krok 0+1)
claude Jul 7, 2026
188affb
Merge pull request #9 from pawelekbyra/claude/image-upload-display-di…
pawelekbyra Jul 7, 2026
a77307b
fix: usuń niescommitowane martwe pliki CountrySwitcher/useCountrySwitch
claude Jul 7, 2026
e00172f
feat: renderuj logo sklepu w nagłówku i JSON-LD (F10)
claude Jul 7, 2026
6206c54
Merge pull request #10 from pawelekbyra/claude/image-upload-display-d…
pawelekbyra Jul 7, 2026
f1d77f2
Add error handling to API data fetching functions
claude Jul 7, 2026
5846bb0
Merge pull request #11 from pawelekbyra/claude/nextjs-json-parse-erro…
pawelekbyra Jul 7, 2026
daf433b
chore: trigger deployment
pawelekbyra Jul 7, 2026
d822799
Zaktualizuj SPREE_API_URL na Oracle backend (141.253.103.172)
pawelekbyra Jul 9, 2026
8c2bab5
fix: disable static pre-rendering for storefront pages to work around…
pawelekbyra Jul 9, 2026
c66e2e2
fix: use revalidate=0 instead of dynamic for cacheComponents compatib…
pawelekbyra Jul 9, 2026
2a7b056
fix: disable cacheComponents to allow route segment config
pawelekbyra Jul 9, 2026
a6343d2
fix: remove generateStaticParams to prevent pre-rendering at build time
pawelekbyra Jul 9, 2026
85424f9
fix: remove 'use cache: remote' directives incompatible with disabled…
pawelekbyra Jul 9, 2026
09dc679
fix: remove all 'use cache: remote' and cacheLife directives from all…
pawelekbyra Jul 9, 2026
b9fccc8
fix: remove all remaining 'use cache: remote' from components and ent…
pawelekbyra Jul 9, 2026
f3716d8
fix: remove orphaned cacheTag() calls left behind by earlier sed cleanup
pawelekbyra Jul 9, 2026
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
1 change: 1 addition & 0 deletions .deploy-trigger
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Deployment trigger: 2026-07-08T00:00:00+02:00
20 changes: 19 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
# Spree API Configuration (server-side only - not exposed to browser)
SPREE_API_URL=http://localhost:3000
# Development: http://localhost:3000
# Production (Oracle): https://141.253.103.172
SPREE_API_URL=https://141.253.103.172
SPREE_PUBLISHABLE_KEY=your_publishable_api_key

# Admin API secret key (sk_...) scoped to read_products/write_products.
# Used only by the /api/cron/sync-eur-prices Vercel Cron job to fetch PLN
# prices and write back computed EUR prices — never exposed to the browser.
SPREE_ADMIN_SECRET_KEY=sk_your_admin_secret_key

# Shared secret for Vercel Cron. Vercel automatically sends
# "Authorization: Bearer $CRON_SECRET" when calling scheduled routes if
# this env var is set — must match the same value set for the cron to
# authenticate. Any random string works.
CRON_SECRET=

# Store defaults (should match your Spree store settings)
# These are used by the middleware for initial redirects before API data is loaded
# Set these to your store's default_country_iso and default_locale
Expand Down Expand Up @@ -43,6 +56,11 @@ SPREE_WEBHOOK_SECRET=your_webhook_endpoint_secret_key
RESEND_API_KEY=
EMAIL_FROM=Your Store <orders@your-domain.com>

# Manual cache-busting for the product-list "use cache" entries.
# POST /api/revalidate with `Authorization: Bearer <secret>` to force a
# refresh instead of waiting out the 10-minute cacheLife.
REVALIDATE_SECRET=

# Stripe (optional - required for Stripe payment method)
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_your_stripe_publishable_key

Expand Down
20 changes: 20 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# sklepikFront — instrukcja dla agentów kodowania

To repozytorium to **storefront projektu Kakałowy Sklepik**: Next.js 16 + React 19, doświadczenie klienta, branding, UX, SEO, deploy na Vercel. Rozmawia ze Store API backendu przez `@spree/sdk`.

Backend, admin i API żyją w osobnym repo **`pawelekbyra/sklepik`** — tam też jest **kanon całego systemu**. Nie duplikujemy go tutaj:

- `sklepik/docs/kierunek-projektu.md` — cel projektu, podział repo, **hierarchia decyzji**.
- `sklepik/docs/architektura.md` — mapa systemu i hostingu.
- `sklepik/docs/stan-projektu.md` — bieżący stan i znane problemy.
- `sklepik/docs/roadmap.md` — backlog i priorytety.

**Konwencje techniczne tego repo i protokół dokumentacji: [`CLAUDE.md`](CLAUDE.md).** Tematy frontowe: [`docs/README.md`](docs/README.md).

Żelazne minimum:

- Frontend nie zawiera logiki commerce — produkty, ceny, koszyk, zamówienia to zawsze Store API. Jeśli brakuje pola/endpointu, opisz wymaganie względem repo `sklepik`, nie hardcoduj.
- Nie zmieniaj checkoutu/koszyka przy okazji zmian wizualnych; eksperymenty (quizy, VOD, AI) izoluj od krytycznej ścieżki zakupowej.
- Nie commituj sekretów. Zmienne środowiskowe: [`docs/deployment-vercel.md`](docs/deployment-vercel.md).
- Świadome skróty zapisuj w [`docs/technical-debt.md`](docs/technical-debt.md).
- **Po każdym zadaniu zaktualizuj dotknięte dokumenty** (tu i — jeśli zmiana dotyczy całego systemu — `sklepik/docs/stan-projektu.md`), tak żeby dokumentacja odzwierciedlała rzeczywisty stan.
41 changes: 34 additions & 7 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,30 @@
# Claude Code Rules for Next.js Spree Storefront
# Kakałowy Sklepik — storefront: zasady dla agentów

## Project Overview
## Kontekst projektu (przeczytaj najpierw)

This is a headless e-commerce storefront built with Next.js 16 and React 19, using the Spree Commerce API v3 via `@spree/sdk`.
To repozytorium to **storefront projektu Kakałowy Sklepik** (sklep z produktami kakao) — headless frontend Next.js 16 + React 19, konsumujący Store API v3 backendu przez `@spree/sdk`. Backend, API i panel admina żyją w osobnym repo `pawelekbyra/sklepik` — tam jest też **kanon całego systemu**:

- `sklepik/docs/kierunek-projektu.md` — cel, podział repo, hierarchia decyzji.
- `sklepik/docs/stan-projektu.md` — bieżący stan i znane problemy.
- `sklepik/docs/roadmap.md` — backlog i priorytety.
- Lokalna dokumentacja frontu: [`docs/README.md`](docs/README.md) (kierunek marki, deploy Vercel, dług techniczny).

Zasada nadrzędna: frontend nie zawiera logiki commerce. Produkty, ceny, koszyk, zamówienia — zawsze przez Store API. Brakuje pola/endpointu → wymaganie względem repo `sklepik`, nie hardcode.

## Protokół dokumentacji (obowiązkowy)

Po każdym zakończonym zadaniu, w tym samym PR/commicie:

1. Zaktualizuj dotknięte dokumenty w `docs/` (deploy, kierunek frontu) tak, żeby opisywały rzeczywisty stan.
2. Świadomy skrót → wpis w [`docs/technical-debt.md`](docs/technical-debt.md); spłacony dług → zmień status na `zamknięte`.
3. Zmiana istotna dla całego systemu (API, architektura, nowa usługa) → zaktualizuj też `sklepik/docs/stan-projektu.md` w repo backendu albo jawnie to zgłoś.
4. Nie twórz nowych plików-notatek — aktualizuj istniejące. Historia jest w gicie.

---

## Tech Overview

Headless e-commerce storefront: Next.js 16 + React 19 + Spree Commerce API v3 via `@spree/sdk`.

## Tech Stack

Expand All @@ -17,16 +39,21 @@ This is a headless e-commerce storefront built with Next.js 16 and React 19, usi
```
src/
├── app/ # Next.js App Router
│ └── [country]/[locale]/ # Internationalized routes
│ ├── (checkout)/ # Checkout route group (minimal layout)
│ └── (storefront)/ # Storefront route group (full layout)
│ ├── [locale]/ # pl = default, no URL prefix; other locales get /{locale}
│ │ ├── (checkout)/ # Checkout route group (minimal layout)
│ │ └── (storefront)/ # Storefront route group (full layout)
│ └── api/webhooks/ # Webhooks from the backend (transactional emails)
├── components/ # Reusable UI components
├── contexts/ # React Context providers
├── lib/
│ └── data/ # Server Actions for data fetching
│ ├── data/ # Server Actions for data fetching
│ ├── spree/ # SDK client, middleware, config
│ └── store.ts # Store name + default country/locale (env, defaults pl)
└── types/ # TypeScript type definitions
```

Uwaga: segment `[country]` został usunięty z URL-i (sklep jednorynkowy — kraj do rozwiązania rynku/waluty jest stałym defaultem server-side). Przykłady niżej używające starych ścieżek traktuj jako wzorce kodu, nie jako mapę routingu.

## React 19 Best Practices

### Avoid Unnecessary useEffect
Expand Down
Loading
Loading