feat(ADM-018): completed feature

This commit is contained in:
chattie
2026-08-17 22:23:10 +02:00
parent cf1c69fc8b
commit d595b4871f
871 changed files with 47411 additions and 281 deletions

View File

@@ -0,0 +1,41 @@
# Architect — F-013 Storefront shell (Next.js)
## Decision
Create a dedicated frontend package at `project/storefront/`. The backend remains the modular monolith package in `project/`; the storefront never imports `project/src/**` backend internals.
## Package boundary
- `project/storefront/package.json` owns Next.js, React, Tailwind and frontend scripts.
- Root/backend lint can ignore `storefront/**`; storefront quality gates run inside `project/storefront`.
- Frontend API access goes through `project/storefront/src/lib/api.ts` only.
## Stack
- Next.js App Router with TypeScript.
- React Server Components by default.
- Tailwind CSS for shell styling.
- No client components in this slice unless unavoidable; home/layout can be server components.
## API client
Add a typed public API client:
- `ProductSummary` type mirrors public catalog response fields needed by the shell.
- `searchProducts(input)` calls backend `GET /products/search`.
- `getProductBySlug(slug)` calls backend `GET /productos/:slug` for future detail pages.
- Backend base URL from `NEXT_PUBLIC_API_BASE_URL` or `API_BASE_URL`, default `http://localhost:3000`.
- Client throws sanitized errors; no backend internals or DB types imported.
## UI shell
- App layout with top navigation and footer.
- Home page renders server-side with navigation, hero, basic category/search affordances and a small product preview fed by the typed API client when backend is available.
- If backend is unavailable, render a graceful empty state; build must not require a live backend.
## Quality gates
Frontend commands:
- `npm run lint`
- `npm run typecheck`
- `npm run build`
Root gates:
- Existing backend `npm run lint`, `npm run typecheck`, `npm test` should remain green.
- `./scripts/verify.sh` green.
## Out of scope
No catalog detail pages, category pages, cart UI, checkout UI, authentication UI, SSG/ISR catalog behavior, or image optimization pipeline in this ticket.

View File

@@ -0,0 +1,21 @@
# Documenter — F-013 Storefront shell (Next.js)
## Documentation updated
- Updated `project/README.md` with storefront commands:
- `cd storefront && npm install`
- `npm run dev`
- `npm run lint`
- `npm run typecheck`
- `npm run build`
- Added `Storefront shell (Next.js)` section documenting:
- package location: `project/storefront/`
- Next.js App Router, React, TypeScript and Tailwind stack
- server-rendered home/layout/navigation
- typed public API client at `src/lib/api.ts`
- `server-only` API client boundary
- API base URL configuration
- explicit out-of-scope catalog pages/cart/checkout UI
## Evidence
- `cd project && npm run lint` — PASS after README update.
- `./scripts/verify.sh` — PASS after README update.

View File

@@ -0,0 +1,49 @@
# Implementer — F-013 Storefront shell (Next.js)
## Summary
Implemented a dedicated Next.js storefront shell under `project/storefront/` with TypeScript, React, Tailwind CSS, server-rendered home layout/navigation, and a typed public API client for backend catalog endpoints.
## Code changes
- Added standalone frontend package: `project/storefront/package.json` and `package-lock.json`.
- Added Next.js config and TypeScript config:
- `project/storefront/next.config.ts`
- `project/storefront/tsconfig.json`
- `project/storefront/postcss.config.mjs`
- `project/storefront/next-env.d.ts`
- Added App Router shell:
- `project/storefront/src/app/layout.tsx`
- `project/storefront/src/app/page.tsx`
- `project/storefront/src/app/globals.css`
- `project/storefront/src/components/site-header.tsx`
- `project/storefront/src/components/site-footer.tsx`
- Added typed backend public API client:
- `project/storefront/src/lib/api.ts`
- Defines DTOs for public product/image payloads.
- Uses `GET /products/search` and `GET /productos/:slug`.
- Uses `API_BASE_URL` or `NEXT_PUBLIC_API_BASE_URL`, defaulting to `http://localhost:3000`.
- Imports `server-only` so the API client cannot be accidentally bundled into client components.
- Does not import backend internals.
- Updated formatting/lint boundaries:
- `project/eslint.config.mjs` ignores `storefront/**` for backend lint.
- `project/.prettierignore` ignores `storefront/` for backend formatting; storefront has its own quality scripts.
- `project/storefront/.prettierignore` ignores generated Next files such as `next-env.d.ts` and `.next/`.
## UI behavior
- Home is a server component (`async` page, no `use client`).
- Layout includes navigation and footer.
- Home fetches a small product preview via the typed API client when backend is available.
- If backend is unavailable, home renders a graceful ready-state instead of failing build/runtime rendering.
## Evidence
- `cd project/storefront && npm run lint` — PASS.
- `cd project/storefront && npm run typecheck` — PASS.
- `cd project/storefront && npm run build` — PASS.
- `cd project && npm run lint` — PASS.
- `cd project && npm run typecheck` — PASS.
- `cd project && npm test` — PASS: 17 files passed, 7 skipped; 64 passed, 33 skipped.
- `./scripts/verify.sh` — PASS.
- QA correction run with `set -e`: storefront lint/typecheck/build, storefront lint after build, backend lint/typecheck/test, and verify all PASS.
## Notes
- New frontend dependencies are isolated to `project/storefront/package.json`, including `server-only` to enforce server-side API access.
- No catalog detail pages, category pages, cart UI, checkout UI, auth UI, or ISR catalog pages added.

View File

@@ -0,0 +1,16 @@
{
"feature_id": "F-013",
"agent": "leader",
"verdict": "APPROVED",
"summary": "F-013 closed with reviewer, security, and QA gates approved. Next.js storefront shell added under project/storefront with server-rendered home/navigation, Tailwind styling, typed server-only public API client, docs and green checks.",
"evidence": [
"work/artifacts/F-013/reviewer.json verdict APPROVED",
"work/artifacts/F-013/security.json verdict APPROVED",
"work/artifacts/F-013/qa.json verdict APPROVED after revalidation",
"work/artifacts/F-013/documenter.md present",
"./scripts/verify.sh final close run: PASS",
"storefront lint/typecheck/build PASS in QA/build evidence",
"backend lint/typecheck/test PASS in QA/build evidence"
],
"timestamp": "2026-08-15T15:33:17Z"
}

View File

@@ -0,0 +1,15 @@
{
"feature_id": "F-013",
"agent": "qa",
"verdict": "APPROVED",
"summary": "QA approved after correction. Home renders as a server component with navigation, frontend API access is through typed server-only DTO/client, no backend internals are imported, and frontend lint/typecheck/build plus backend checks and verify are green.",
"evidence": [
"Acceptance: Home renders server-side with navigation -> project/storefront/src/app/page.tsx is async server component; layout includes SiteHeader navigation and SiteFooter",
"Acceptance: Frontend never imports backend internals -> storefront source uses typed public API client in src/lib/api.ts and no project/src imports; API client imports server-only",
"Acceptance: Build, lint and typecheck green -> set -e run: storefront lint PASS, storefront typecheck PASS, storefront build PASS, storefront lint after build PASS",
"Acceptance: verify.sh green -> ./scripts/verify.sh PASS in same set -e run",
"Backend regression: cd project && npm run lint/typecheck/test PASS in same set -e run",
"Graceful backend-unavailable state verified by code path: getPreviewProducts catches API failure and renders ready-state message"
],
"timestamp": "2026-08-15T15:32:26Z"
}

View File

@@ -0,0 +1,19 @@
{
"feature_id": "F-013",
"agent": "reviewer",
"verdict": "APPROVED",
"summary": "F-013 review approved. Storefront is isolated under project/storefront, uses Next.js App Router with server-rendered layout/home, has navigation and Tailwind styling, and consumes backend public endpoints through a typed API client without importing backend internals.",
"evidence": [
"Read work/current.md and work/artifacts/F-013/architect.md/implementer.md",
"Inspected project/storefront/package.json, Next config, TS config, App Router layout/page, header/footer, and typed API client",
"Verified no imports from project/src backend internals in storefront source",
"Verified home page is a server component: no use client directive; async page fetches through typed API client and handles unavailable backend gracefully",
"cd project/storefront && npm run lint: PASS",
"cd project/storefront && npm run typecheck: PASS",
"cd project/storefront && npm run build: PASS",
"cd project && npm run lint/typecheck/test: PASS",
"./scripts/verify.sh: PASS",
"gentle-ai review mode status: receipt-driven development off globally, ordinary gates used"
],
"timestamp": "2026-08-15T15:30:21Z"
}

View File

@@ -0,0 +1,16 @@
{
"feature_id": "F-013",
"agent": "security",
"verdict": "APPROVED",
"summary": "Security approved. Storefront has isolated dependencies, no secrets, API access is server-only, no backend internals are imported, and dependency audit reports no high vulnerabilities.",
"evidence": [
"Checked project/storefront/src/lib/api.ts imports server-only and uses only public HTTP endpoints",
"Checked API base URL defaults to localhost and accepts env config without embedding credentials",
"Checked no project/src backend internal imports from storefront source",
"Checked no client components or browser-side credential handling added",
"cd project/storefront && npm audit --audit-level=high --omit=dev: found 0 vulnerabilities",
"rg secret patterns over storefront config/source: no findings",
"Post-server-only lint/typecheck/build plus backend lint/typecheck/test and verify all passed in build evidence"
],
"timestamp": "2026-08-15T15:31:24Z"
}