Commit Graph

140 Commits

Author SHA1 Message Date
c1ff0a00db fix: correct authentication dependency names in CMS API endpoints
Fix ImportError by using correct authentication dependency names:
- Use get_current_admin_api instead of get_current_admin_user
- Use get_current_vendor_api instead of get_current_vendor_user

These are the correct dependency names for API endpoints that require
Authorization header authentication (no cookie support).

Fixes: ImportError: cannot import name 'get_current_admin_user'

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 15:59:15 +01:00
30534b694a chore: add TODO to .gitignore
Ignore TODO file from version control as it's used for
temporary task tracking during development.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 15:57:02 +01:00
41a51af6b4 docs: update troubleshooting documentation
Update troubleshooting guide with latest fixes and solutions for
common development issues encountered during CMS implementation
and shop frontend development.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 15:55:56 +01:00
be07bbb3b1 docs: add comprehensive CMS documentation
Add complete documentation for the Content Management System:

Feature Documentation (docs/features/):
- content-management-system.md - Complete CMS overview
  * Two-tier architecture explanation
  * Database schema and relationships
  * API reference for all endpoints
  * Usage workflows for admin/vendor/customer
  * Best practices and examples

- cms-implementation-guide.md - Step-by-step implementation
  * Activation checklist
  * Code integration instructions
  * Testing procedures
  * Troubleshooting guide

Quick Start Guide (docs/getting-started/):
- cms-quick-start.md - Quick reference
  * Setup commands
  * Access URLs
  * Managing content (API, admin panel, vendor dashboard)
  * Two-tier system explained with examples
  * Common tasks and troubleshooting

Updated Seeder Docs:
- Add CMS to enhanced seeder coverage list
- Add dedicated CMS section with table of pages
- Document integration with db-setup workflow
- Update best practices

MkDocs Configuration:
- Add "Features" section with CMS documentation
- Add CMS Quick Start to "Getting Started"
- Add CDN Fallback Strategy to "Frontend Development"
- Complete navigation structure

All documentation builds cleanly with no warnings.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 15:55:42 +01:00
a555185619 feat: add script to create default CMS content pages
Add automated script to generate platform default content pages:

Script (create_default_content_pages.py):
- Creates 7 platform default pages (vendor_id=NULL)
- Content: About, Contact, FAQ, Shipping, Returns, Privacy, Terms
- Comprehensive, production-ready content for each page
- Idempotent - safe to run multiple times (skips existing)
- SEO metadata included for all pages
- Proper navigation flags (footer/header visibility)

Makefile Integration:
- Add 'create-cms-defaults' command
- Integrate into 'db-setup' workflow
- Update help documentation with CMS commands
- Update both 'help' and 'help-db' sections

Workflow:
make db-setup now runs:
  migrate-up → init-prod → create-cms-defaults → seed-demo

This ensures all new developers get:
- Database schema (migrations)
- Admin user (init-prod)
- Default content pages (create-cms-defaults)
- Demo data (seed-demo)

All in one command: make db-setup

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 15:55:23 +01:00
fef0418d27 feat: integrate CMS into shop frontend
Implement dynamic CMS content rendering in shop frontend:

Route Handler (shop_pages.py):
- Add generic /{slug} route for all CMS pages
- Load content from database with vendor override fallback
- Update get_shop_context() to load footer/header navigation
- Pass db session to all route handlers for navigation loading
- Return 404 if page not found

Template (content-page.html):
- Generic template for rendering CMS content
- Display page title, content, and metadata
- Show vendor override badge when applicable
- Support for HTML and Markdown content formats
- SEO meta tags from database

Footer Navigation (base.html):
- Dynamic footer links loaded from database
- Automatic two-column layout based on page count
- Fallback to static links if no CMS pages configured
- Filter pages by show_in_footer flag

This completes the CMS frontend integration, enabling:
- /about, /contact, /faq, etc. to load from database
- Vendors inherit platform defaults automatically
- Vendor-specific overrides take priority
- Dynamic footer navigation from CMS

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 15:55:06 +01:00
fb3aa89086 feat: add CMS service layer and API endpoints
Implement complete CMS business logic and REST API:

Service Layer (content_page_service.py):
- get_page_for_vendor() - Two-tier lookup with fallback
- list_pages_for_vendor() - Merge vendor + platform pages
- create_page(), update_page(), delete_page() - CRUD operations
- Support for published/draft workflow
- Footer/header navigation filtering

API Endpoints:

Admin API (/api/v1/admin/content-pages):
- POST /platform - Create platform defaults
- GET /platform - List platform defaults
- GET / - List all pages with vendor filtering
- PUT /{id} - Update any page
- DELETE /{id} - Delete any page

Vendor API (/api/v1/vendor/{code}/content-pages):
- GET / - List available pages (vendor + platform merged)
- GET /overrides - List only vendor overrides
- POST / - Create vendor override
- PUT /{id} - Update vendor page
- DELETE /{id} - Delete vendor page

Shop API (/api/v1/shop/content-pages):
- GET /navigation - Get footer/header navigation pages
- GET /{slug} - Get specific page (public, with fallback)

All endpoints include proper authentication, authorization,
and validation using Pydantic schemas.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 15:54:48 +01:00
c219f5b5f8 feat: add CMS database model and migrations
Implement Content Management System database layer:

Database Model:
- ContentPage model with two-tier architecture
- Platform defaults (vendor_id=NULL)
- Vendor-specific overrides (vendor_id=123)
- SEO fields (meta_description, meta_keywords)
- Publishing workflow (is_published, published_at)
- Navigation flags (show_in_footer, show_in_header)
- Display ordering and timestamps

Migrations:
- Create content_pages table with all columns
- Add indexes for performance (vendor_id, slug, published status)
- Add unique constraint on (vendor_id, slug)
- Add foreign key relationships with cascade delete

Model Registration:
- Add ContentPage to Vendor relationship
- Import model in alembic/env.py for migration detection

This provides the foundation for managing static content pages
(About, FAQ, Contact, etc.) with platform defaults and vendor overrides.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 15:54:29 +01:00
2dfda3e312 docs: update frontend architecture documentation
Update frontend architecture documentation across all three frontends
(admin, vendor, shop) to reflect current implementation:

- Document template inheritance patterns
- Update Alpine.js component usage
- Add CDN fallback strategy references
- Clarify context variable usage
- Update template structure diagrams

Also update base templates with improved comments and organization.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 15:54:12 +01:00
03a487eba9 fix: implement correct base_url routing for shop frontend
Fix shop frontend links to work correctly across all three access methods:
- Custom domain (wizamart.shop)
- Subdomain (wizamart.localhost)
- Path-based (/vendor/wizamart/)

Changes:
- Update get_shop_context() to calculate base_url based on access method
- Update all shop templates to use {{ base_url }} for links
- Add base_url to shop-layout.js Alpine.js component
- Document multi-access routing in shop architecture docs

This ensures links work correctly regardless of how the shop is accessed,
solving broken navigation issues with path-based access.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 15:54:00 +01:00
cadf771138 feat: add shared templates and static assets infrastructure
Add shared template infrastructure and static assets:
- Shared Jinja2 templates for reusable components
- Favicon for branding
- Local Tailwind CSS fallback
- Shop CSS styles directory

This provides the foundation for consistent UI components across
admin, vendor, and shop frontends with CDN fallback support.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 15:53:23 +01:00
7879e2f70a docs: add CDN fallback strategy documentation
Add comprehensive documentation for CDN fallback strategy used across
the platform's frontend. Documents the pattern for loading external
libraries (Alpine.js, Tailwind CSS, etc.) with automatic fallback to
local copies when CDN is unavailable.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 15:52:46 +01:00
e5f5a2ebf8 Updated vendor documentation 2025-11-22 07:43:26 +01:00
608fa8b95c Fixed login redirecting issues 2025-11-21 23:38:03 +01:00
2532a977c1 Adding vendor api tests 2025-11-21 23:16:21 +01:00
6ad308e250 Fixing vendor dashboard area 2025-11-21 23:15:59 +01:00
86f1e16ef2 Fixing vendor dashboard area 2025-11-21 23:15:25 +01:00
5aff76a27e adding test documentation 2025-11-20 22:06:49 +01:00
96803c2708 adding integration tests for the middleware layer 2025-11-19 22:52:43 +01:00
23cf568c82 reaching 100% test coverage for the middleware unit tests 2025-11-19 22:26:45 +01:00
a18ad48721 updating middleware doc 2025-11-19 21:55:34 +01:00
92a2610b70 renaming properly all middleware test cases and fixing bugs 2025-11-19 21:21:29 +01:00
21bd390685 unit test bug fixes 2025-11-19 20:21:11 +01:00
c38da2780a fixed connection closing issues in fixtures 2025-11-18 23:57:18 +01:00
7d2eb96553 fixed coverage issues when running pytest 2025-11-18 23:53:34 +01:00
c10bdfdf42 fixing vendor context detection bug 2025-11-18 23:41:51 +01:00
d947fa5ca0 removing legacy code on path_rewrite_middleware 2025-11-18 23:32:07 +01:00
f14686c131 Fixed url pattern in the doc for path-based shops 2025-11-18 23:18:13 +01:00
b3009e3795 Fixed middleware authentication issues 2025-11-18 22:50:55 +01:00
3a65a800bc gitignore improvement 2025-11-17 23:05:37 +01:00
807033be16 revamping documentation 2025-11-17 22:59:42 +01:00
bbd64a6f21 RBAC alembic 2025-11-15 20:59:51 +01:00
424450b802 RBAC documentation 2025-11-15 20:59:22 +01:00
e3ed4a3295 data seed feature for demo and prod 2025-11-15 20:57:39 +01:00
41439eed09 Vendor team member management features 2025-11-14 21:08:57 +01:00
af23f5b88f replacing letzshop by wizamart 2025-11-13 15:23:47 +01:00
5fa911df00 adding docstring to classes 2025-11-10 19:42:41 +01:00
a685fe202a adding docstring to classes 2025-11-10 19:42:07 +01:00
971631f575 adding docstring to classes 2025-11-10 19:41:52 +01:00
ede80f41ea adding docstring to classes 2025-11-10 19:41:40 +01:00
6794a1bbb9 middleware fix for path-based vendor url 2025-11-09 18:48:11 +01:00
adbcee4ce3 middleware fix for path-based vendor url 2025-11-09 18:47:53 +01:00
79dfcab09f frontend error management enhancement 2025-11-05 21:52:22 +01:00
e4bc438069 revamped authentication system 2025-11-02 18:40:03 +01:00
9cc92e5fc4 created specific route files for frontends 2025-11-02 15:26:55 +01:00
9611c03a36 migrating vendor frontend to new architecture 2025-10-31 20:51:30 +01:00
9420483ae6 migrating vendor frontend to new architecture 2025-10-30 19:11:51 +01:00
cd5097fc04 migrating vendor frontend to new architecture 2025-10-28 22:58:55 +01:00
b0cc0385f8 revamping frontend logging system and reorganising documentation 2025-10-28 21:07:26 +01:00
5c80ba17c5 Main exception renamed to WizamartException 2025-10-27 21:55:05 +01:00