diff --git a/backend/prisma/schema.prisma b/backend/prisma/schema.prisma
index 207988c8..3b3d2804 100644
--- a/backend/prisma/schema.prisma
+++ b/backend/prisma/schema.prisma
@@ -178,7 +178,7 @@ model Blog {
slug String @unique @db.VarChar(200)
content String @db.Text
excerpt String? @db.Text
- authorId String? @map("author_id") @db.Uuid
+ authorId String @map("author_id") @db.Uuid
categoryId String? @map("category_id") @db.Uuid
imageUrl String? @map("image_url") @db.Text
imageAlt String? @map("image_alt") @db.VarChar(255)
@@ -209,7 +209,7 @@ model Blog {
createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz()
updatedAt DateTime @default(now()) @updatedAt @map("updated_at") @db.Timestamptz()
- author User? @relation(fields: [authorId], references: [id])
+ author User @relation(fields: [authorId], references: [id])
category BlogCategory? @relation(fields: [categoryId], references: [id], onDelete: SetNull)
tags BlogTag[]
comments BlogComment[]
diff --git a/backend/src/blogs/blogs.service.spec.ts b/backend/src/blogs/blogs.service.spec.ts
index df3628a8..d617785e 100644
--- a/backend/src/blogs/blogs.service.spec.ts
+++ b/backend/src/blogs/blogs.service.spec.ts
@@ -40,7 +40,7 @@ describe("BlogsService", () => {
describe("findAll", () => {
it("should query published blogs with pagination", async () => {
const blogs = [
- { id: "1", title: "Blog 1", isPublished: true, status: "PUBLISHED", author: null },
+ { id: "1", title: "Blog 1", isPublished: true, status: "PUBLISHED" },
];
mockPrisma.blog.findMany.mockResolvedValue(blogs);
mockPrisma.blog.count.mockResolvedValue(1);
@@ -49,8 +49,6 @@ describe("BlogsService", () => {
expect(mockPrisma.blog.findMany).toHaveBeenCalled();
expect(result.data).toEqual(blogs);
expect(result.meta.total).toBe(1);
- const query = mockPrisma.blog.findMany.mock.calls[0][0];
- expect(query.include.author).toBeUndefined();
});
it("should filter by categorySlug and search term", async () => {
diff --git a/backend/src/blogs/blogs.service.ts b/backend/src/blogs/blogs.service.ts
index edcbf302..370c9758 100644
--- a/backend/src/blogs/blogs.service.ts
+++ b/backend/src/blogs/blogs.service.ts
@@ -68,6 +68,9 @@ export class BlogsService {
[sortBy === "createdAt" ? "createdAt" : "publishedAt"]: sortOrder,
},
include: {
+ author: {
+ select: { firstName: true, lastName: true },
+ },
category: {
select: { id: true, name: true, slug: true },
},
@@ -107,6 +110,7 @@ export class BlogsService {
take: 4,
orderBy: { publishedAt: "desc" },
include: {
+ author: { select: { firstName: true, lastName: true } },
category: { select: { id: true, name: true, slug: true } },
tags: { select: { id: true, name: true, slug: true } },
_count: { select: { comments: { where: { status: "APPROVED" } } } },
@@ -123,6 +127,7 @@ export class BlogsService {
take: 4,
orderBy: { publishedAt: "desc" },
include: {
+ author: { select: { firstName: true, lastName: true } },
category: { select: { id: true, name: true, slug: true } },
tags: { select: { id: true, name: true, slug: true } },
_count: { select: { comments: { where: { status: "APPROVED" } } } },
@@ -158,6 +163,9 @@ export class BlogsService {
],
},
include: {
+ author: {
+ select: { firstName: true, lastName: true },
+ },
category: {
select: { id: true, name: true, slug: true },
},
diff --git a/docker-compose.yml b/docker-compose.yml
index bf5dbfb8..6e5d2c82 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -1,5 +1,3 @@
-version: '3.8'
-
services:
db_stage:
image: postgres:16-alpine
@@ -25,22 +23,36 @@ services:
build:
context: ./backend
dockerfile: Dockerfile
+ args:
+ NPM_REGISTRY: ${NPM_REGISTRY:-}
container_name: canino_backend_stage
restart: always
+ env_file:
+ - path: .support-chat.env
+ required: false
+ - path: .revalidation.env
+ required: false
+ dns:
+ - 217.218.127.127
+ - 217.218.155.155
environment:
- DATABASE_URL=postgresql://canino_stage:caninopassword_stage@db_stage:5432/caninodb_stage?schema=public
+ - SUPPORT_CHAT_URL=http://canina-bot:8643/support/ask
- REDIS_HOST=redis_stage
- REDIS_PORT=6379
- PORT=3000
- - ADMIN_PASSWORD=Z6nYnJRG_sg3pnz2J9wZ7dLsPj61cd5k
+ - FRONTEND_URL=https://stage.canina.ir
+ - ENABLE_SWAGGER=false
+ # Code-only stage startup: schema/seed changes require separate authorization.
+ command: ["node", "dist/main.js"]
volumes:
- canina_stage_uploads:/app/uploads
+ - /opt/services/proxy/certs/canina:/app/ssl_certs
labels:
- "traefik.enable=true"
- "traefik.http.routers.canina-api-stage.rule=Host(`stageapi.canina.ir`)"
- "traefik.http.routers.canina-api-stage.entrypoints=websecure"
- "traefik.http.routers.canina-api-stage.tls=true"
- - "traefik.http.routers.canina-api-stage.tls.certresolver=arvan"
- "traefik.http.services.canina-api-stage.loadbalancer.server.port=3000"
depends_on:
- db_stage
@@ -53,16 +65,22 @@ services:
context: .
dockerfile: Dockerfile
args:
+ NPM_REGISTRY: ${NPM_REGISTRY:-}
NEXT_PUBLIC_API_URL: "https://stageapi.canina.ir/api"
VITE_API_URL: "https://stageapi.canina.ir"
container_name: canino_frontend_stage
restart: always
+ env_file:
+ - path: .revalidation.env
+ required: false
+ dns:
+ - 217.218.127.127
+ - 217.218.155.155
labels:
- "traefik.enable=true"
- "traefik.http.routers.canina-stage.rule=Host(`stage.canina.ir`) || Host(`stageadmin.canina.ir`)"
- "traefik.http.routers.canina-stage.entrypoints=websecure"
- "traefik.http.routers.canina-stage.tls=true"
- - "traefik.http.routers.canina-stage.tls.certresolver=arvan"
- "traefik.http.routers.canina-stage.middlewares=staging-robots-headers"
- "traefik.http.middlewares.staging-robots-headers.headers.customresponseheaders.X-Robots-Tag=noindex, nofollow, nosnippet, noarchive"
- "traefik.http.services.canina-stage.loadbalancer.server.port=8080"
diff --git a/docs/audit/UX-MODERNIZATION-TASK-REGISTER.md b/docs/audit/UX-MODERNIZATION-TASK-REGISTER.md
deleted file mode 100644
index 529e0931..00000000
--- a/docs/audit/UX-MODERNIZATION-TASK-REGISTER.md
+++ /dev/null
@@ -1,44 +0,0 @@
-# Canina UX Modernization — Task Register
-
-Source: live Chromium audits, source audit at `bec76393b`, and QA/SEO/content reviews.
-Status model: TODO -> IN_PROGRESS -> TEST -> DONE. Estimates are engineering hours, not elapsed calendar time.
-
-| ID | Owner departments | Pri | Estimate | Dependencies | Acceptance summary | Status |
-|---|---|---:|---:|---|---|---|
-| UX-PMO-001 | PMO | P0 | 4h | audits | Register, owners, dependencies, release gates and evidence contract are versioned | DONE |
-| UX-DEV-001 | Dev + QA | P0 | 12h | none | `/login` and `/cart` are real routes, no 404, mobile/desktop smoke tests pass | IN_PROGRESS |
-| UX-CAT-001 | Dev + UX + QA | P0 | 24h | UX-DEV-001 | Shop has deterministic SSR/client data states: success/loading/empty/error/retry | TODO |
-| UX-CAT-002 | Dev + Product + QA | P0 | 24h | UX-CAT-001 | Catalog uses typed pagination/query URL state; no limit-999 hydration | TODO |
-| UX-DATA-001 | Dev + DevOps | P0 | 20h | UX-CAT-001 | API errors are typed/actionable; cache tags and invalidation are verified | TODO |
-| UX-A11Y-001 | UX + Dev + QA | P0 | 16h | UX-DEV-001 | Forms/buttons/overlays have names, labels, focus return and keyboard operation | TODO |
-| UX-RESP-001 | UX + Dev + QA | P1 | 20h | UX-CAT-001 | 360/390/768/1024/1440 layouts have no unintended overflow and 44px targets | TODO |
-| UX-PDP-001 | Product + UX + Dev + QA | P1 | 20h | UX-CAT-001 | PDP has one H1 and above-fold image/name/price/stock/CTA at all viewports | TODO |
-| UX-CHECKOUT-001 | Payments + Dev + QA | P1 | 20h | UX-A11Y-001 | Checkout fields have labels/autocomplete/inputmode and announced errors | TODO |
-| UX-NAV-001 | UX + Product + Dev | P1 | 16h | UX-RESP-001 | Mobile/desktop navigation is canonical, active state and cart state are consistent | TODO |
-| UX-SEARCH-001 | Product + UX + SEO + Dev | P1 | 16h | UX-CAT-002 | Search landmark, Persian normalization, result count and actionable no-results state | TODO |
-| UX-CONTENT-001 | Content + UX | P1 | 12h | UX-NAV-001 | Persian CTA/glossary unified across shop, wiki, auth, cart and footer | TODO |
-| UX-CONTACT-001 | Support + Dev + Product | P1 | 4h | settings readback | No empty `tel:`/`mailto:` targets; official values verified live | TODO |
-| UX-SEO-001 | SEO + Dev + QA | P1 | 16h | UX-CAT-002 | Category URLs, canonical/H1/meta and sitemap parity are tested | TODO |
-| UX-SEO-002 | SEO + Dev + Content | P1 | 12h | UX-SEO-001 | Product 404 is real 404; Product/Offer/Breadcrumb JSON-LD matches facts | TODO |
-| UX-MEDIA-001 | Content + SEO + Dev | P2 | 12h | UX-PDP-001 | Product/blog/feed images are valid, same-item, HTTPS and have useful alt text | TODO |
-| UX-PERF-001 | Dev + DevOps + QA | P0 | 24h | UX-CAT-002, UX-RESP-001 | Mobile LCP/CLS/INP budgets, reduced-motion and image dimensions are verified | TODO |
-| UX-ARCH-001 | Dev + UX | P1 | 24h | UX-CAT-001 | ArchivePage/global shell split into typed, independently testable feature modules | TODO |
-| UX-STATE-001 | Dev + Commerce + QA | P0 | 24h | UX-DATA-001 | Cart price/stock/order state is backend-authoritative and persisted safely | TODO |
-| UX-TEST-001 | Dev + QA | P0 | 16h | UX-DEV-001 | npm test/typecheck/lint scripts and coverage gates execute in clean checkout | TODO |
-| UX-E2E-001 | QA + DevOps | P1 | 20h | UX-TEST-001, UX-RESP-001 | Chromium desktop/mobile smoke covers shop/PDP/cart/login/checkout/errors | TODO |
-| UX-CI-001 | DevOps + Dev + QA | P0 | 20h | UX-TEST-001, UX-E2E-001 | CI gates lint/type/unit/build/E2E/perf and publishes evidence | TODO |
-| UX-DEPLOY-001 | DevOps + QA | P1 | 24h | UX-CI-001 | Immutable SHA deployment, health checks, smoke gate and rollback are documented/tested | TODO |
-| UX-CLAIMS-001 | R&D + Content + Compliance + human vet review | P1 | 32h | legal/vet access | 35 product/media medical claims have evidence/status and no unsupported claims publish | BLOCKED_EXTERNAL_REVIEW |
-| UX-VERIFY-001 | PMO + QA + Analytics | P2 | 16h | all release tasks | Live release checklist, CWV/error/catalog/checkout telemetry and go/no-go evidence | TODO |
-
-**Current program estimate:** 396 engineering/review hours; critical path is lower with parallel teams. External legal/human-veterinarian review, recruited user panel, GSC/GA4 access and payment sandbox are explicit blockers where applicable.
-
-## Immediate execution order
-
-1. UX-DEV-001 — restore login/cart routes (current)
-2. UX-TEST-001 — make frontend test/typecheck gates executable
-3. UX-A11Y-001 + UX-RESP-001 — fix shared interaction and responsive foundations
-4. UX-CAT-001/002 + UX-DATA-001 — reliable catalog flow
-5. UX-PDP-001 + UX-CHECKOUT-001 + UX-STATE-001 — conversion journey
-6. SEO/content/media/performance/CI/deployment gates
-7. Live verification and release decision
diff --git a/frontend/admin-panel/src/routes/adminRoutes.tsx b/frontend/admin-panel/src/routes/adminRoutes.tsx
index ad49413e..adbf5bc0 100644
--- a/frontend/admin-panel/src/routes/adminRoutes.tsx
+++ b/frontend/admin-panel/src/routes/adminRoutes.tsx
@@ -81,7 +81,7 @@ export const router = createBrowserRouter([
{ path: 'zibal-portal/*', element: