@thorprovider/create-storefront 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/README.md +119 -0
  2. package/bin/install.js +116 -0
  3. package/commands/sf-add-view.md +21 -0
  4. package/commands/sf-init.md +16 -0
  5. package/commands/sf-theme.md +15 -0
  6. package/commands/sf-view.md +20 -0
  7. package/package.json +40 -0
  8. package/recipes/archetype.schema.json +39 -0
  9. package/recipes/archetypes.json +148 -0
  10. package/recipes/recipe.schema.json +59 -0
  11. package/recipes/recipes.json +90 -0
  12. package/recipes/sections.json +46 -0
  13. package/recipes/validate.mjs +190 -0
  14. package/skills/building-storefronts/SKILL.md +178 -0
  15. package/skills/building-storefronts/references/frontend-integration.md +229 -0
  16. package/skills/json-render-core/SKILL.md +291 -0
  17. package/skills/json-render-next/SKILL.md +194 -0
  18. package/skills/json-render-react/SKILL.md +298 -0
  19. package/skills/json-render-remotion/SKILL.md +111 -0
  20. package/skills/json-render-shadcn/SKILL.md +159 -0
  21. package/skills/json-render-solid/SKILL.md +204 -0
  22. package/skills/nextjs-shadcn/SKILL.md +303 -0
  23. package/skills/nextjs-shadcn/references/architecture.md +499 -0
  24. package/skills/nextjs-shadcn/references/project-setup.md +127 -0
  25. package/skills/nextjs-shadcn/references/shadcn-platform.md +258 -0
  26. package/skills/nextjs-shadcn/references/sidebar.md +274 -0
  27. package/skills/nextjs-shadcn/references/styling.md +555 -0
  28. package/skills/sf-scaffold/SKILL.md +118 -0
  29. package/skills/sf-theme-gen/SKILL.md +44 -0
  30. package/skills/sf-view-gen/SKILL.md +94 -0
  31. package/skills/shadcn-component-discovery/SKILL.md +273 -0
  32. package/skills/shadcn-component-discovery/references/registries.md +226 -0
  33. package/skills/shadcn-theming/SKILL.md +104 -0
  34. package/skills/shadcn-theming/references/templates/theme-setup.md +109 -0
  35. package/skills/shadcn-theming/references/theming-guide.md +90 -0
  36. package/skills/storefront-best-practices/SKILL.md +421 -0
  37. package/skills/storefront-best-practices/reference/components/breadcrumbs.md +123 -0
  38. package/skills/storefront-best-practices/reference/components/cart-popup.md +189 -0
  39. package/skills/storefront-best-practices/reference/components/country-selector.md +298 -0
  40. package/skills/storefront-best-practices/reference/components/footer.md +112 -0
  41. package/skills/storefront-best-practices/reference/components/hero.md +241 -0
  42. package/skills/storefront-best-practices/reference/components/megamenu.md +239 -0
  43. package/skills/storefront-best-practices/reference/components/navbar.md +397 -0
  44. package/skills/storefront-best-practices/reference/components/popups.md +221 -0
  45. package/skills/storefront-best-practices/reference/components/product-card.md +125 -0
  46. package/skills/storefront-best-practices/reference/components/product-reviews.md +217 -0
  47. package/skills/storefront-best-practices/reference/components/product-slider.md +174 -0
  48. package/skills/storefront-best-practices/reference/components/search.md +101 -0
  49. package/skills/storefront-best-practices/reference/connecting-to-backend.md +391 -0
  50. package/skills/storefront-best-practices/reference/design.md +388 -0
  51. package/skills/storefront-best-practices/reference/features/promotions.md +307 -0
  52. package/skills/storefront-best-practices/reference/features/wishlist.md +230 -0
  53. package/skills/storefront-best-practices/reference/layouts/account.md +380 -0
  54. package/skills/storefront-best-practices/reference/layouts/cart.md +316 -0
  55. package/skills/storefront-best-practices/reference/layouts/checkout.md +486 -0
  56. package/skills/storefront-best-practices/reference/layouts/home-page.md +264 -0
  57. package/skills/storefront-best-practices/reference/layouts/order-confirmation.md +231 -0
  58. package/skills/storefront-best-practices/reference/layouts/product-details.md +527 -0
  59. package/skills/storefront-best-practices/reference/layouts/product-listing.md +520 -0
  60. package/skills/storefront-best-practices/reference/layouts/static-pages.md +356 -0
  61. package/skills/storefront-best-practices/reference/medusa.md +307 -0
  62. package/skills/storefront-best-practices/reference/mobile-responsiveness.md +183 -0
  63. package/skills/storefront-best-practices/reference/seo.md +195 -0
  64. package/templates/app/app/[[...slug]]/page.tsx +17 -0
  65. package/templates/app/app/[[...slug]]/renderer.tsx +10 -0
  66. package/templates/app/app/globals.css +101 -0
  67. package/templates/app/app/layout.tsx +35 -0
  68. package/templates/app/lib/__STOREFRONT__/catalog.ts +132 -0
  69. package/templates/app/lib/__STOREFRONT__/handlers.ts +33 -0
  70. package/templates/app/lib/__STOREFRONT__/registry.tsx +134 -0
  71. package/templates/app/lib/__STOREFRONT__/runtime.ts +25 -0
  72. package/templates/app/lib/__STOREFRONT__/spec/home.ts +62 -0
  73. package/templates/app/lib/__STOREFRONT__/spec/index.ts +59 -0
  74. package/templates/app/lib/__STOREFRONT__/spec/types.ts +14 -0
  75. package/templates/app/lib/__STOREFRONT__/state.ts +35 -0
@@ -0,0 +1,230 @@
1
+ # Wishlist Feature
2
+
3
+ ## Contents
4
+
5
+ - [Overview](#overview)
6
+ - [Backend Support Check](#backend-support-check)
7
+ - [Wishlist Button](#wishlist-button)
8
+ - [Adding and Removing](#adding-and-removing)
9
+ - [Wishlist Page](#wishlist-page)
10
+ - [Guest vs Logged-In Users](#guest-vs-logged-in-users)
11
+ - [Navigation Icon](#navigation-icon)
12
+ - [Mobile Considerations](#mobile-considerations)
13
+ - [Checklist](#checklist)
14
+
15
+ ## Overview
16
+
17
+ A wishlist (also called favorites or save for later) allows customers to save products they're interested in for future purchase. This feature helps organize shopping, track desired items, and increases return visits and conversions.
18
+
19
+ ### Key Ecommerce Benefits
20
+
21
+ **Why wishlists matter:**
22
+ - Increase return visits (users come back to check wishlist)
23
+ - Reduce cart abandonment (save for later instead of abandoning)
24
+ - Gift planning (save items for gift lists, share with others)
25
+ - Price tracking (users monitor items for sales - remarketing opportunity)
26
+ - Engagement metric (shows product interest for analytics)
27
+
28
+ **Conversion impact:**
29
+ - Users with wishlists have 2-3x higher lifetime value
30
+ - Wishlist-to-purchase conversion: 20-30% on average
31
+ - Email reminders about wishlist items: 15-25% click-through rate
32
+
33
+ ## Backend Support Check
34
+
35
+ **CRITICAL: Only implement wishlist UI if your ecommerce backend supports wishlist functionality.**
36
+
37
+ Before implementing:
38
+ 1. **Check backend API** - Verify wishlist endpoints exist (or ask user)
39
+ 2. **Authentication** - Confirm if login required for wishlist storage
40
+ 3. **Test operations** - Verify add/remove/fetch functionality works
41
+
42
+ **Medusa users:**
43
+ Medusa core doesn't include wishlist by default. Install the Wishlist plugin from Medusa examples repository. Plugin provides full wishlist functionality with API endpoints.
44
+
45
+ **General backends:**
46
+ Wishlist typically requires user authentication. API endpoints needed:
47
+ - GET /wishlist (fetch user's wishlist)
48
+ - POST /wishlist (add item)
49
+ - DELETE /wishlist/{id} (remove item)
50
+
51
+ **If backend doesn't support wishlist:**
52
+ Don't implement the feature. localStorage-only wishlist creates poor UX (lost on device switch, no sync, no remarketing).
53
+
54
+ ## Wishlist Button
55
+
56
+ ### Design and States
57
+
58
+ **Heart icon** (universal symbol):
59
+ - Outline heart: Not in wishlist
60
+ - Filled heart: In wishlist
61
+ - 24-32px on product cards, 32-40px on product page
62
+
63
+ **Colors:**
64
+ - Outline: Gray or black
65
+ - Filled: Red, pink, or brand color
66
+ - High contrast against product image
67
+
68
+ ### Placement
69
+
70
+ **Product cards:**
71
+ Top-right corner of product image, always visible (not hover-only), 16px margin from edges.
72
+
73
+ **Product detail page:**
74
+ Near "Add to Cart" button, or above product image, or with sharing options. Optional text label: "Add to Wishlist" or icon-only.
75
+
76
+ ## Adding and Removing
77
+
78
+ ### Adding to Wishlist
79
+
80
+ **Flow:**
81
+ 1. User clicks heart icon
82
+ 2. Show loading state briefly
83
+ 3. Send API request to add item
84
+ 4. Update icon to filled state
85
+ 5. Show success feedback (toast: "Added to wishlist" or subtle animation)
86
+ 6. Update navigation wishlist badge (+1)
87
+
88
+ **Optimistic UI:**
89
+ Update icon immediately, revert if API fails. Provides instant feedback.
90
+
91
+ **Error handling:**
92
+ Show error toast ("Failed to add to wishlist"), revert icon to outline, allow retry.
93
+
94
+ **Variant handling:**
95
+ Save specific variant (size, color) if selected on product page. On product cards, save default variant.
96
+
97
+ ### Removing from Wishlist
98
+
99
+ **From product card/page:**
100
+ Click filled heart → changes to outline → toast: "Removed from wishlist" → update badge (-1).
101
+
102
+ **From wishlist page:**
103
+ X icon in corner of product card or "Remove" button → item fades out. Optional: Undo action in toast (5 seconds).
104
+
105
+ **Confirmation:**
106
+ Generally not needed (low stakes, easily reversible). Only confirm for bulk actions ("Clear all").
107
+
108
+ ## Wishlist Page
109
+
110
+ ### Layout
111
+
112
+ **Heading:**
113
+ "My Wishlist" or "Favorites" with item count ("12 items saved").
114
+
115
+ **Product grid:**
116
+ Similar to product listing page. Product cards with images, titles, current prices (may differ from when added), stock status.
117
+
118
+ **Empty state:**
119
+ "Your wishlist is empty" with "Start Shopping" CTA.
120
+
121
+ ### Product Card Information
122
+
123
+ Display per item:
124
+ - Product image (linked to product page)
125
+ - Product title (linked)
126
+ - Current price (may show sale price if on sale now)
127
+ - Original price if on sale (strikethrough)
128
+ - Variant details (size, color if saved)
129
+ - Stock status: In stock (green), Out of stock (red, "Notify me" option), Low stock ("Only 2 left")
130
+ - **"Add to Cart" button** (CRITICAL - conversion path)
131
+ - Remove button (X icon)
132
+
133
+ ### Actions and Conversion
134
+
135
+ **Add to Cart (CRITICAL):**
136
+ "Add to Cart" button on each item. Adds item to cart **without removing from wishlist** (user may want both). Success toast: "Added to cart". Don't navigate away (stay on wishlist page).
137
+
138
+ **Tradeoff:**
139
+ - **Keep in wishlist** (recommended): User tracks desired items, can reorder easily
140
+ - **Move to cart**: Removes from wishlist after adding - simpler but limits reordering
141
+
142
+ **Stock handling:**
143
+ If out of stock, disable "Add to Cart" and show "Notify me when back in stock" option (if backend supports).
144
+
145
+ ## Guest vs Logged-In Users
146
+
147
+ ### Decision: Require Login or Use localStorage?
148
+
149
+ **Require login (Recommended):**
150
+
151
+ **Why:**
152
+ - Wishlist requires persistent storage across devices
153
+ - Enables email reminders and price drop notifications
154
+ - Better user experience (never lost)
155
+ - Cleaner data for analytics and remarketing
156
+ - Avoids confusion of lost wishlist items
157
+
158
+ **Implementation:**
159
+ Click wishlist → Show login prompt modal: "Log in to save your wishlist". Include "Sign Up" button. Clear benefit: "Save items across all your devices".
160
+
161
+ **localStorage approach (Not Recommended):**
162
+ - Device-specific only (lost on device switch)
163
+ - Lost if user clears browser data
164
+ - No remarketing opportunities
165
+ - No email reminders
166
+ - Creates poor UX expectations
167
+
168
+ **Exception:**
169
+ If backend doesn't support authenticated wishlist, consider not implementing feature at all rather than localStorage-only.
170
+
171
+ ## Navigation Icon
172
+
173
+ ### Placement and Design
174
+
175
+ **Position:**
176
+ Top navigation bar, between search icon and cart icon. Or: In user account dropdown menu.
177
+
178
+ **Icon:**
179
+ Heart icon (outline or filled if items in wishlist). 24-32px size, consistent with cart icon.
180
+
181
+ **Badge count:**
182
+ Small circle with number showing total items in wishlist. Red or brand color, positioned top-right of heart icon.
183
+
184
+ **Link behavior:**
185
+ Navigates to wishlist page on click. Dropdown less common for wishlist (unlike cart popup).
186
+
187
+ ## Mobile Considerations
188
+
189
+ **Heart button:**
190
+ Larger touch target (44px minimum), positioned in corner of product image, clear tap feedback (scale or color change).
191
+
192
+ **Wishlist page:**
193
+ Single column product grid, stack cards vertically, full-width "Add to Cart" buttons, large remove buttons (44px touch target).
194
+
195
+ **Navigation icon:**
196
+ Heart icon in mobile navbar or hamburger menu, with badge count.
197
+
198
+ **Login prompt:**
199
+ If guest clicks wishlist, show bottom sheet (less disruptive than full modal) with "Log in to save your wishlist" message.
200
+
201
+ ## Checklist
202
+
203
+ **Essential features:**
204
+
205
+ - [ ] Backend API support verified before implementing
206
+ - [ ] Heart icon on product cards (top-right corner)
207
+ - [ ] Heart icon on product detail page
208
+ - [ ] Clear filled vs outline states
209
+ - [ ] Toast notification on add/remove
210
+ - [ ] Wishlist icon in navigation with badge count
211
+ - [ ] Wishlist page with product grid
212
+ - [ ] Product info: image, title, current price, stock status
213
+ - [ ] Variant details if saved (size, color)
214
+ - [ ] "Add to Cart" button on each wishlist item
215
+ - [ ] Add to cart without removing from wishlist
216
+ - [ ] Remove button (X icon) on each item
217
+ - [ ] Empty wishlist state ("Start Shopping" CTA)
218
+ - [ ] Login required for persistent wishlist
219
+ - [ ] Guest user login prompt on wishlist click
220
+ - [ ] Stock status indicators (in stock, out of stock, low stock)
221
+ - [ ] Out of stock: Disable add to cart, show "Notify me"
222
+ - [ ] Mobile: 44px touch targets
223
+ - [ ] Mobile: Single column layout
224
+ - [ ] Optimistic UI (instant feedback)
225
+ - [ ] Error handling for failed API requests
226
+ - [ ] Loading states during add/remove
227
+ - [ ] Button aria-label ("Add to wishlist" / "Remove from wishlist")
228
+ - [ ] aria-pressed attribute on heart button
229
+ - [ ] Keyboard accessible (Tab, Enter/Space)
230
+ - [ ] Screen reader announcements for add/remove
@@ -0,0 +1,380 @@
1
+ # Account Pages Layout
2
+
3
+ ## Contents
4
+
5
+ - [Overview](#overview)
6
+ - [Account Dashboard](#account-dashboard)
7
+ - [Order Management](#order-management)
8
+ - [Saved Addresses](#saved-addresses)
9
+ - [Payment Methods](#payment-methods)
10
+ - [Profile and Security](#profile-and-security)
11
+ - [Email Preferences](#email-preferences)
12
+ - [Navigation and Layout](#navigation-and-layout)
13
+ - [Mobile Considerations](#mobile-considerations)
14
+ - [Checklist](#checklist)
15
+
16
+ ## Overview
17
+
18
+ Account pages allow customers to manage orders, save addresses, update preferences, and view order history. Well-designed account pages improve repeat purchase rates and reduce support inquiries.
19
+
20
+ **Backend Integration (CRITICAL):**
21
+
22
+ All customer data (orders, addresses, profile, payment methods) must be fetched from the ecommerce backend. Change this based on backend integrated. Never hardcode or mock account data. Consult backend documentation for:
23
+ - Customer data endpoints (profile, preferences)
24
+ - Order history and details endpoints
25
+ - Address CRUD operations
26
+ - Payment method storage (if supported)
27
+ - Authentication requirements
28
+
29
+ ### Key Ecommerce Requirements
30
+
31
+ - Order history with status tracking (builds trust)
32
+ - Saved addresses (checkout optimization - reduces friction)
33
+ - Reorder functionality (increases repeat purchases)
34
+ - Order tracking integration
35
+ - Email preference controls (compliance and user control)
36
+ - Secure authentication and session management
37
+
38
+ ### Purpose
39
+
40
+ **Primary ecommerce functions:**
41
+ - Reduce checkout friction (saved addresses, payment methods)
42
+ - Increase repeat purchases (order history, reorder button)
43
+ - Reduce support load (order tracking, self-service returns)
44
+ - Build trust (order transparency, delivery updates)
45
+ - Retain customers (easy account management)
46
+
47
+ ## Account Dashboard
48
+
49
+ Landing page after login. Purpose: Quick access to recent activity and common actions.
50
+
51
+ **Display (prioritize recent orders):**
52
+ - Welcome message with customer name
53
+ - Recent orders (3-5 most recent with status)
54
+ - Quick actions: Track order, Reorder, Manage addresses
55
+ - Account summary (saved addresses count, loyalty points)
56
+
57
+ **Reorder functionality (CRITICAL for repeat purchases):**
58
+ - Check first that feature is available in the admin.
59
+ - "Reorder" button on each order card
60
+ - Adds same items to cart (check stock availability first)
61
+ - Success feedback (cart updated with X items)
62
+ - Don't navigate away (stay on dashboard)
63
+
64
+ **Example dashboard:**
65
+ ```
66
+ Welcome back, Sarah!
67
+
68
+ Recent Orders
69
+ - Order #12345 - Delivered (Jan 28) - $89.99 [Reorder]
70
+ - Order #12344 - In Transit (Jan 27) - $124.50 [Track Order]
71
+ - Order #12343 - Processing (Jan 26) - $45.00
72
+
73
+ [View All Orders →]
74
+
75
+ Quick Actions
76
+ [Track Order] [Manage Addresses] [Contact Support]
77
+ ```
78
+
79
+ ## Order Management
80
+
81
+ ### Order History
82
+
83
+ Display all past orders with filtering and search.
84
+
85
+ **Order card essentials:**
86
+ - Order number (clickable to details page)
87
+ - Order date and status badge (Processing, Shipped, Delivered)
88
+ - Total amount
89
+ - First 2-3 product thumbnails
90
+ - Quick actions: Track, View Details, Reorder, Invoice
91
+
92
+ **Status indicators (color-coded):**
93
+ - Processing: Yellow/Orange
94
+ - Shipped: Blue
95
+ - Delivered: Green
96
+ - Cancelled: Gray/Red
97
+
98
+ **Filtering and search:**
99
+ - Date range (Last 30 days, Last 6 months, All time)
100
+ - Status filter (All, Processing, Shipped, Delivered)
101
+ - Search by order number or product name
102
+
103
+ **Sorting:**
104
+ - Most recent first (default)
105
+ - Oldest first
106
+ - Highest/lowest price
107
+
108
+ **Pagination:**
109
+ Show 10-20 orders per page with pagination controls. Alternative: "Load More" button (better mobile UX).
110
+
111
+ ### Order Details View
112
+
113
+ Full order information page.
114
+
115
+ **Display:**
116
+ - Order number, date, status with progress timeline
117
+ - Tracking number with carrier link (if shipped)
118
+ - Estimated delivery date
119
+
120
+ **Status timeline (builds trust):**
121
+ ```
122
+ ✓ Order Placed (Jan 27, 9:45 AM)
123
+ ✓ Processing (Jan 27, 10:30 AM)
124
+ ✓ Shipped (Jan 28, 2:15 PM)
125
+ ○ Out for Delivery
126
+ ○ Delivered
127
+ ```
128
+
129
+ **Order information:**
130
+ - Items ordered (image, name, variant, quantity, price)
131
+ - Pricing breakdown (subtotal, shipping, tax, discounts, total)
132
+ - Shipping address and method
133
+ - Billing address
134
+ - Payment method (last 4 digits)
135
+
136
+ **Order actions:**
137
+ - Track shipment (link to carrier tracking page)
138
+ - Download invoice/receipt (PDF)
139
+ - Request return (if eligible and backend supports)
140
+ - Reorder items
141
+ - Contact support about order
142
+
143
+ ### Reorder Functionality (Ecommerce-Specific)
144
+
145
+ **Purpose**: Increase repeat purchases by making it easy to reorder past purchases.
146
+
147
+ **Implementation:**
148
+ - "Reorder" button on order cards and order details
149
+ - Check stock availability before adding to cart
150
+ - Handle discontinued products gracefully (skip or notify)
151
+ - Add all available items to cart
152
+ - Success message: "5 items added to cart" (or "3 of 5 items added - 2 unavailable")
153
+ - Stay on current page (don't navigate away)
154
+
155
+ **Tradeoff**: Auto-add to cart (friction-free) vs redirect to cart page (let user review first). Recommend auto-add with clear success feedback.
156
+
157
+ ## Saved Addresses
158
+
159
+ **Purpose (CRITICAL)**: Reduce checkout friction and increase conversion. Saved addresses make repeat purchases faster and easier.
160
+
161
+ ### Why Addresses Matter
162
+
163
+ **Conversion optimization:**
164
+ - Saved addresses reduce checkout time by 50%+ (no retyping)
165
+ - Default address selection streamlines checkout flow
166
+ - Reduces form abandonment (fewer fields to fill)
167
+ - Increases repeat purchase rate (easier checkout)
168
+
169
+ **Backend integration:**
170
+ Fetch, create, update, and delete addresses via backend API. Do this based on backend integrated.
171
+
172
+ ### Address Book Display
173
+
174
+ **Saved addresses list:**
175
+ - All saved addresses
176
+ - Default address indicator (badge: "Default Shipping" or star icon)
177
+ - Address preview: Name, street, city, state, zip
178
+ - Quick actions: Edit, Delete, Set as Default
179
+
180
+ **Default address behavior:**
181
+ - One default shipping address
182
+ - One default billing address (separate or same)
183
+ - Used automatically at checkout (user can change)
184
+ - Setting new default updates previous default
185
+
186
+ ### Add/Edit Address Form
187
+
188
+ Collect standard shipping information. Key considerations:
189
+
190
+ **Required fields:**
191
+ - Full name (or first + last)
192
+ - Address line 1
193
+ - City, State/Province, ZIP/Postal code
194
+ - Country
195
+ - Phone number (recommended for delivery coordination)
196
+
197
+ **Optional enhancements:**
198
+ - Address label (Home, Work) for easy identification
199
+ - Address autocomplete API (Google Places) for accuracy
200
+ - "Set as default" checkbox
201
+
202
+ **Validation:**
203
+ Real-time validation, especially for ZIP/postal code format based on country.
204
+
205
+ ## Payment Methods
206
+
207
+ **Note**: Payment method storage is optional. Only implement if:
208
+ - Backend securely handles tokenized payment data
209
+ - PCI DSS compliance requirements are met
210
+ - Payment gateway supports tokenization (Stripe, Braintree)
211
+
212
+ **Security (CRITICAL):**
213
+ - Never store full card numbers (tokenize with payment gateway)
214
+ - Display last 4 digits only
215
+ - Don't store CVV
216
+ - Use payment gateway hosted forms (Stripe Elements, etc.)
217
+ - Show "Securely stored" badge for trust
218
+
219
+ **Saved payment display:**
220
+ - Card type logo (Visa, Mastercard)
221
+ - Last 4 digits
222
+ - Expiration date
223
+ - Default indicator
224
+ - Actions: Edit (update expiration/billing address), Delete, Set as Default
225
+
226
+ **Tradeoff**: Saved payment methods increase convenience but require PCI compliance. If not implemented, users enter payment at checkout each time (more friction but simpler backend).
227
+
228
+ ## Profile and Security
229
+
230
+ ### Profile Information
231
+
232
+ Display and edit customer information.
233
+
234
+ **Standard fields:**
235
+ - Full name
236
+ - Email (with verification status)
237
+ - Phone number
238
+ - Optional: Date of birth, gender
239
+
240
+ **Edit functionality:**
241
+ Inline editing or separate form, real-time validation, success confirmation.
242
+
243
+ **Email verification:**
244
+ If unverified, show warning with "Resend verification email" button. If verified, show checkmark badge.
245
+
246
+ ### Security Settings
247
+
248
+ **Password change:**
249
+ - Require current password (optional)
250
+ - New password with strength indicator
251
+ - Confirm new password
252
+ - Password requirements display (8+ chars, uppercase, number)
253
+
254
+ **Two-factor authentication (optional):**
255
+ Enable/disable 2FA, setup instructions, backup codes. Only implement if backend supports.
256
+
257
+ ## Email Preferences
258
+
259
+ Ecommerce-specific email controls.
260
+
261
+ **Preference categories:**
262
+
263
+ 1. **Transactional emails** (order updates, shipping) - Recommended always enabled, may be legally required
264
+ 2. **Marketing emails** (sales, promotions, new products) - User choice
265
+ 3. **Newsletter** (weekly roundup, content) - User choice
266
+
267
+ **Display:**
268
+ Checkbox list or toggle switches with clear descriptions. Save button at bottom.
269
+
270
+ **Example:**
271
+ ```
272
+ Email Preferences
273
+
274
+ [✓] Order and shipping updates
275
+ Receive confirmations and tracking info
276
+
277
+ [ ] Marketing emails
278
+ Sales, promotions, and new products
279
+
280
+ [ ] Newsletter
281
+ Weekly roundup and articles
282
+
283
+ [Save Preferences]
284
+ ```
285
+
286
+ **Unsubscribe:**
287
+ Individual opt-outs per type, "Unsubscribe from all marketing" button. Keep transactional emails enabled (required for order fulfillment).
288
+
289
+ ## Navigation and Layout
290
+
291
+ ### Layout Pattern Decision
292
+
293
+ Choose based on account complexity:
294
+
295
+ **Sidebar Navigation (Recommended):**
296
+ - **Use when**: 6+ account sections, complex account features
297
+ - Desktop: Vertical sidebar (20-25% width) with section links
298
+ - Mobile: Collapse to hamburger menu or dropdown
299
+ - Benefits: Persistent navigation, professional, accommodates many sections
300
+
301
+ **Tab Navigation:**
302
+ - **Use when**: 4-6 account sections, simpler account structure
303
+ - Horizontal tabs at top, active tab highlighted
304
+ - Mobile: Horizontal scroll or dropdown
305
+ - Benefits: Modern, clean, quick switching
306
+
307
+ **Account Hub (Mobile-First):**
308
+ - **Use when**: Mobile-heavy traffic, simple account
309
+ - Landing page with section cards (2-column grid)
310
+ - Tap card to enter section, back button returns to hub
311
+ - Benefits: Touch-friendly, intuitive, minimal hierarchy
312
+
313
+ ### Section Organization
314
+
315
+ **Recommended order (most to least used):**
316
+ 1. Dashboard (landing page)
317
+ 2. Orders (most accessed)
318
+ 3. Addresses (important for checkout)
319
+ 4. Payment Methods (if implemented)
320
+ 5. Profile
321
+ 6. Security
322
+ 7. Email Preferences
323
+ 8. Logout
324
+
325
+ ## Mobile Considerations
326
+
327
+ **Mobile-specific patterns:**
328
+
329
+ **Navigation:**
330
+ Account hub with section cards (2 columns), or bottom navigation with 4-5 key sections (Orders, Addresses, Profile, More).
331
+
332
+ **Forms:**
333
+ One field per row, larger inputs (48px height), appropriate keyboard types (email, phone, numeric), autofill enabled.
334
+
335
+ **Order history:**
336
+ Simplified order cards, full-width buttons, "Load More" pagination (better than numbered pages on mobile).
337
+
338
+ **Saved addresses:**
339
+ Stacked address cards, full-width, 48px touch targets for edit/delete.
340
+
341
+ ## Checklist
342
+
343
+ **Essential features:**
344
+
345
+ - [ ] Account dashboard with recent orders (3-5)
346
+ - [ ] Reorder button (adds items to cart, stays on page)
347
+ - [ ] Order history with status indicators
348
+ - [ ] Filter orders by date range and status
349
+ - [ ] Search orders by number or product name
350
+ - [ ] Order details page with tracking info
351
+ - [ ] Status timeline (Order Placed → Processing → Shipped → Delivered)
352
+ - [ ] Track shipment button (links to carrier)
353
+ - [ ] Download invoice/receipt option
354
+ - [ ] Saved addresses list with default indicator
355
+ - [ ] Add/edit/delete addresses with validation
356
+ - [ ] Set default address option
357
+ - [ ] Profile information edit
358
+ - [ ] Email verification status display
359
+ - [ ] Password change with strength indicator
360
+ - [ ] Current password required to change password
361
+ - [ ] Email preferences (transactional vs marketing)
362
+ - [ ] Account deletion option
363
+ - [ ] Logout button clearly visible
364
+ - [ ] Clear navigation between sections
365
+ - [ ] Mobile-responsive (single column, 48px touch targets)
366
+ - [ ] Backend integration (all data fetched from API)
367
+ - [ ] Success confirmations after saves
368
+ - [ ] Error handling with clear messages
369
+ - [ ] Keyboard accessible
370
+ - [ ] ARIA labels on navigation sections
371
+ - [ ] Order status announcements for screen readers
372
+
373
+ **Optional features:**
374
+
375
+ - [ ] Saved payment methods (if PCI compliant backend)
376
+ - [ ] Two-factor authentication
377
+ - [ ] Wishlist integration
378
+ - [ ] Loyalty points/rewards display
379
+ - [ ] Returns management section
380
+ - [ ] Address autocomplete API