refactor: rename shop to storefront for consistency

Rename all "shop" directories and references to "storefront" to match
the API and route naming convention already in use.

Renamed directories:
- app/templates/shop/ → app/templates/storefront/
- static/shop/ → static/storefront/
- app/templates/shared/macros/shop/ → .../macros/storefront/
- docs/frontend/shop/ → docs/frontend/storefront/

Renamed files:
- shop.css → storefront.css
- shop-layout.js → storefront-layout.js

Updated references in:
- app/routes/storefront_pages.py (21 template references)
- app/modules/cms/routes/pages/vendor.py
- app/templates/storefront/base.html (static paths)
- All storefront templates (extends/includes)
- docs/architecture/frontend-structure.md

This aligns the template/static naming with:
- Route file: storefront_pages.py
- API directory: app/api/v1/storefront/
- Module routes: */routes/api/storefront.py
- URL paths: /storefront/*

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-30 22:58:28 +01:00
parent 9decb9c29e
commit 7245f79f7b
62 changed files with 94 additions and 94 deletions

View File

@@ -7,7 +7,7 @@ This application has **4 distinct frontends**, each with its own templates and s
1. **Platform** - Public platform pages (homepage, about, contact)
2. **Admin** - Administrative control panel
3. **Vendor** - Vendor management portal
4. **Shop** - Customer-facing e-commerce store
4. **Storefront** - Customer-facing e-commerce store
## Directory Structure
@@ -17,7 +17,7 @@ app/
│ ├── platform/ # Platform public pages
│ ├── admin/ # Admin portal pages
│ ├── vendor/ # Vendor portal pages
│ ├── shop/ # Shop customer pages
│ ├── storefront/ # Storefront customer pages
│ └── shared/ # Shared components (emails, errors)
└── static/
@@ -33,7 +33,7 @@ app/
│ ├── js/
│ ├── css/
│ └── img/
├── shop/ # Shop static assets
├── storefront/ # Storefront static assets
│ ├── js/
│ ├── css/
│ └── img/
@@ -130,13 +130,13 @@ app/
---
### 4. Shop Frontend
### 4. Storefront Frontend
**Purpose:** Customer-facing e-commerce store
**Location:**
- Templates: `app/templates/shop/`
- Static: `static/shop/`
- Templates: `app/templates/storefront/`
- Static: `static/storefront/`
**Pages:**
- Product catalog
@@ -153,7 +153,7 @@ app/
- Payment integration
- Shopping cart management
**Routes:** `/shop/*`
**Routes:** `/storefront/*`
**Authentication:** Optional (required for checkout)
@@ -230,23 +230,23 @@ Each frontend has its own static directory for frontend-specific assets. Use the
---
### Shop Static Assets (`static/shop/`)
### Storefront Static Assets (`static/storefront/`)
**JavaScript Files:**
```html
<!-- In shop templates -->
<script src="{{ url_for('static', path='shop/js/cart.js') }}"></script>
<script src="{{ url_for('static', path='shop/js/checkout.js') }}"></script>
<!-- In storefront templates -->
<script src="{{ url_for('static', path='storefront/js/cart.js') }}"></script>
<script src="{{ url_for('static', path='storefront/js/checkout.js') }}"></script>
```
**CSS Files:**
```html
<link href="{{ url_for('static', path='shop/css/product-gallery.css') }}" rel="stylesheet">
<link href="{{ url_for('static', path='storefront/css/product-gallery.css') }}" rel="stylesheet">
```
**Images:**
```html
<img src="{{ url_for('static', path='shop/img/placeholder-product.jpg') }}" alt="Product">
<img src="{{ url_for('static', path='storefront/img/placeholder-product.jpg') }}" alt="Product">
```
---
@@ -271,7 +271,7 @@ Icon system (used by all 4 frontends) → static/shared/js/icons.js
Admin dashboard chart → static/admin/js/charts.js
Vendor product form → static/vendor/js/product-form.js
Platform hero image → static/platform/img/hero.jpg
Shop product carousel → static/shop/js/carousel.js
Storefront product carousel → static/storefront/js/carousel.js
```
---
@@ -287,7 +287,7 @@ app/modules/{module}/static/
├── admin/js/ # Admin pages for this module
├── vendor/js/ # Vendor pages for this module
├── shared/js/ # Shared across admin/vendor for this module
└── shop/js/ # Shop pages for this module (if applicable)
└── storefront/js/ # Storefront pages for this module (if applicable)
```
### How Module Static Files Are Served
@@ -385,7 +385,7 @@ The codebase distinguishes between three types of users:
This distinction is important:
- `admin-users.js` and `users.js` manage **internal platform users** → Stay in `static/admin/js/`
- `customers.js` manages **shop customers** → Lives in the customers module
- `customers.js` manages **storefront customers** → Lives in the customers module
---
@@ -453,7 +453,7 @@ Each frontend has a base template:
- `platform/base.html`
- `admin/base.html`
- `vendor/base.html`
- `shop/base.html`
- `storefront/base.html`
**Benefits:**
- Consistent layout within frontend
@@ -465,7 +465,7 @@ Each frontend has a base template:
All frontends communicate with backend via APIs:
- `/api/v1/admin/*` - Admin APIs
- `/api/v1/vendor/*` - Vendor APIs
- `/api/v1/shop/*` - Shop APIs
- `/api/v1/storefront/*` - Storefront APIs
- `/api/v1/platform/*` - Platform APIs
**Benefits:**
@@ -483,7 +483,7 @@ All frontends communicate with backend via APIs:
| Platform | Alpine.js | Tailwind | Heroicons | No | `/` |
| Admin | Alpine.js | Tailwind | Heroicons | Yes (Admin) | `/admin` |
| Vendor | Alpine.js | Tailwind | Heroicons | Yes (Vendor) | `/vendor/{code}` |
| Shop | Alpine.js | Tailwind | Heroicons | Optional | `/shop` |
| Storefront | Alpine.js | Tailwind | Heroicons | Optional | `/storefront` |
---