From 86d67b5cfbfd67ac7f41747ae235383650fa6124 Mon Sep 17 00:00:00 2001 From: Samir Boulahtit Date: Tue, 25 Nov 2025 21:09:27 +0100 Subject: [PATCH] feat: add customer authentication pages and documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add complete customer authentication UI with login, registration, forgot password, and dashboard pages. Templates Added: - app/templates/shop/account/login.html - Two-column layout with vendor branding - Email/password login with validation - Password visibility toggle - "Remember me" functionality - Error/success alerts - Loading states with spinner - app/templates/shop/account/register.html - Customer registration form - Client-side validation (password strength, email format) - Marketing consent checkbox - Confirm password matching - app/templates/shop/account/forgot-password.html - Password reset request page - Email validation - Success confirmation - app/templates/shop/account/dashboard.html - Customer account dashboard - Overview of orders, profile, addresses Styles Added: - static/shared/css/auth.css - Authentication page styling - Two-column layout system - Form components and validation states - Theme-aware with CSS variables - Dark mode support - Mobile responsive - static/shared/css/base.css updates - Enhanced utility classes - Additional form styles - Improved button states Documentation Added: - docs/frontend/shop/authentication-pages.md - Comprehensive guide to auth page implementation - Component architecture - API integration patterns - Theme customization - docs/development/CUSTOMER_AUTHENTICATION_IMPLEMENTATION.md - Implementation details and technical decisions - Security considerations - Testing procedures - docs/development/CUSTOMER_AUTH_SUMMARY.md - Quick reference guide - Endpoints and flows - Updated docs/frontend/shop/architecture.md - Added authentication section - Documented all auth pages - Updated docs/frontend/shop/page-templates.md - Added auth template documentation - Updated mkdocs.yml - Added new documentation pages to navigation Features: - Full theme integration with vendor branding - Alpine.js reactive components - Tailwind CSS utility-first styling - Client and server-side validation - JWT token management - Multi-access routing support (domain/subdomain/path) - Error handling with user-friendly messages - Loading states and animations - Mobile responsive design - Dark mode support 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- app/templates/shop/account/dashboard.html | 228 ++++++ .../shop/account/forgot-password.html | 254 +++++++ app/templates/shop/account/login.html | 364 +++++----- app/templates/shop/account/register.html | 649 ++++++++--------- .../CUSTOMER_AUTHENTICATION_IMPLEMENTATION.md | 650 ++++++++++++++++++ docs/development/CUSTOMER_AUTH_SUMMARY.md | 82 +++ docs/frontend/shop/architecture.md | 215 +++++- docs/frontend/shop/authentication-pages.md | 476 +++++++++++++ docs/frontend/shop/page-templates.md | 22 + mkdocs.yml | 4 + static/shared/css/auth.css | 452 ++++++++++++ static/shared/css/base.css | 195 ++++++ 12 files changed, 3118 insertions(+), 473 deletions(-) create mode 100644 app/templates/shop/account/dashboard.html create mode 100644 app/templates/shop/account/forgot-password.html create mode 100644 docs/development/CUSTOMER_AUTHENTICATION_IMPLEMENTATION.md create mode 100644 docs/development/CUSTOMER_AUTH_SUMMARY.md create mode 100644 docs/frontend/shop/authentication-pages.md create mode 100644 static/shared/css/auth.css diff --git a/app/templates/shop/account/dashboard.html b/app/templates/shop/account/dashboard.html new file mode 100644 index 00000000..3cd760ae --- /dev/null +++ b/app/templates/shop/account/dashboard.html @@ -0,0 +1,228 @@ +{# app/templates/shop/account/dashboard.html #} +{% extends "shop/base.html" %} + +{% block title %}My Account - {{ vendor.name }}{% endblock %} + +{% block alpine_data %}accountDashboard(){% endblock %} + +{% block content %} +
+ +
+

My Account

+

Welcome back, {{ user.first_name }}!

+
+ + + + + +
+

Account Summary

+
+
+

Customer Since

+

{{ user.created_at.strftime('%B %Y') }}

+
+
+

Total Orders

+

{{ user.total_orders }}

+
+
+

Customer Number

+

{{ user.customer_number }}

+
+
+
+ + +
+ +
+
+ + + +{% endblock %} + +{% block extra_scripts %} + +{% endblock %} diff --git a/app/templates/shop/account/forgot-password.html b/app/templates/shop/account/forgot-password.html new file mode 100644 index 00000000..a866599e --- /dev/null +++ b/app/templates/shop/account/forgot-password.html @@ -0,0 +1,254 @@ +{# app/templates/shop/account/forgot-password.html #} + + + + + + Forgot Password - {{ vendor.name }} + + + {# CRITICAL: Inject theme CSS variables #} + + + {# Tailwind CSS with local fallback #} + + + +
+
+
+ +
+
+ {% if theme.branding.logo %} + {{ vendor.name }} + {% else %} +
🔐
+ {% endif %} +

{{ vendor.name }}

+

Reset your password

+
+
+ + +
+
+ + + + + + +
+ +

+ Remember your password? + + Sign in + +

+

+ + ← Continue shopping + +

+
+
+
+
+
+ + + + + + + + diff --git a/app/templates/shop/account/login.html b/app/templates/shop/account/login.html index 2b050525..98b6c97b 100644 --- a/app/templates/shop/account/login.html +++ b/app/templates/shop/account/login.html @@ -1,127 +1,177 @@ +{# app/templates/shop/account/login.html #} - + - - <!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="UTF-8"> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <title>Login - {{ vendor.name }} - - - + + + Customer Login - {{ vendor.name }} + + + {# CRITICAL: Inject theme CSS variables #} + + + {# Tailwind CSS with local fallback #} + - -