4 Commits
Author SHA1 Message Date
apuc 50468e2384 Show a fallback when Swagger UI and ReDoc cannot load
Both pages pull their JavaScript from cdn.jsdelivr.net, which is unreachable
behind an authenticating proxy — the page looked blank with no explanation.

- override drf_spectacular/swagger_ui.html and redoc.html in project
  templates
- if the library is missing or nothing rendered after 4 seconds, show a
  short message with a link to /api/docs/ (the offline reference)
- drop the Google Fonts request from the ReDoc page (also blocked)
- note the behaviour in docs/client-links.md
2026-11-22 23:37:17 +03:00
apuc a64d567cff Switch the demo catalog and copy to an electronics store
The shop sells tech, not clothing, so the demo data and page copy now
match that:

- seven categories: smartphones, laptops, tablets, audio, TVs, home
  appliances, accessories
- fifteen products with real-looking specs (screen, CPU, RAM, storage,
  energy class, warranty) instead of apparel attributes
- hero copy and meta description talk about tech and appliances
- banner updated in place by position/sort_order, so re-seeding does not
  leave a stale duplicate

Catalog polish:
- brand list and price range now follow the selected category instead of
  the whole catalog

Tests: storefront fixtures renamed to the tech domain; suite is 61
passing.
2026-11-22 22:46:56 +03:00
apuc 37d5d7b366 Add the customer storefront on Django templates
Pages are rendered server-side (SEO, no build step), the interactive
parts talk to the existing REST API from the browser:

- home: banners, categories, hits and new arrivals
- catalog: filters (category, brand, price, stock), search, sorting,
  pagination, filter chips with one-click removal
- product card: gallery, price with discount, stock, characteristics,
  related products
- cart: localStorage, quantity controls, live totals
- checkout: contacts, delivery, promo code, bonuses, order submission
  with Idempotency-Key, success screen
- login: OTP by phone (debug code shown in dev) and phone/password
- account: profile, orders, addresses, bonuses through the API with JWT
- static pages from the admin

Supporting pieces:
- apps/storefront app with views, urls, templates and static CSS/JS
- money/discount/attribute template filters
- seed_demo management command with demo catalog, banners and pages
- Cyrillic search fallback for SQLite: local DB does not fold case for
  non-ASCII, production PostgreSQL does

Tests: 16 storefront cases (pages, filters, search, ordering, 404s,
filters formatting); the suite is 61 passing.
2026-11-22 22:38:39 +03:00
apuc 756f40353b Add Django backend, 1C integration, deploy config and API docs
Backend (Django 4.2 + DRF):
- accounts: phone OTP login, JWT, profile, addresses
- catalog: categories, products, images, filters, search, hits/new/related
- orders: creation with Idempotency-Key, stock reservation, status history, cancel
- loyalty: bonus accounts, promo codes, gift certificates
- payments: payment records and YooKassa webhook handling
- content: static pages, banners, site settings
- integration: 1C exchange (catalog sync, order push via outbox, statuses, bonuses)
- common: error envelope, pagination, request-id, integration auth, admin dashboard

Infrastructure: Dockerfile, docker-compose (Postgres, Redis, Celery worker/beat, Nginx),
requirements split by environment, OpenAPI contracts for site and 1C, architecture doc.

Tests: 22 pytest cases covering catalog, orders, idempotency, OTP, integration.
2026-11-22 21:54:16 +03:00