# TASK-001 — Customer browsing MVP

**Status:** Completed
**Branch:** feature/TASK-001-browsing-mvp
**Started:** 2026-07-08
**Last updated:** 2026-07-08

## Goal
Ship a Flutter customer app that browses the live Dokploy catalogue (aisles, search, product detail with cross-store prices) and keeps a local basket — via a thin PHP API so MySQL credentials never ship in the mobile binary.

## Acceptance criteria
- [x] Read-only PHP API: aisles, products, product, deals, stats (API key + rate limit)
- [x] Flutter theme matches Baskit design tokens (olive / cream / wheat)
- [x] Splash → intro / welcome → home with live aisles + deals
- [x] Shop aisles, category grid, type-ahead search
- [x] Product detail with PnP / Checkers / Woolworths compare + Add to Baskit
- [x] Local basket grouped by retailer (checkout stubbed)
- [x] Group Buy / Profile tabs are Phase-2 placeholders

## Files touched
| File | Notes |
|------|-------|
| api/index.php | Catalogue JSON router |
| api/config.php | PDO factory |
| api/.env.php.example | Secret template |
| lib/main.dart | go_router + providers |
| lib/theme/baskit_theme.dart | Design tokens |
| lib/core/api_client.dart | HTTP client |
| lib/models/catalogue.dart | Models |
| lib/state/basket_model.dart | Local basket |
| lib/features/** | Screens |
| docs/* | README / CHANGELOG / scope |

## Decisions
- 2026-07-08 — Thin PHP API on WAMP instead of direct MySQL from Flutter — keeps secrets off-device; matches long-term CI4 API path.
- 2026-07-08 — Only PnP / Checkers / Woolworths in compare — Spar has no live rows.
- 2026-07-08 — Basket is in-memory ChangeNotifier — no orders table in Dokploy yet.

## Session log
### 2026-07-08 — Cursor
- Did: Built PHP API; scaffolded Flutter app; implemented onboarding, home, shop, search, product detail, basket; verified API against live DB (825 MVP products); analyzer clean; unit tests pass; `flutter build web` succeeded.
- Broke / deferred: Auth, checkout, Group Buy, real savings ledger.
- Commits: _(pending — user did not request commit)_

## Next steps
1. Optional: run `flutter run -d chrome` and walk aisle → product → basket.
2. Promote API into CodeIgniter 4 when the full backend lands.
3. Add accounts / orders schema before checkout.

## Open questions
- When does Spar (mockups) get price data?
- Lifetime savings on welcome screen — hardcoded until ledger exists.
