Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality.
12 KiB
12 KiB
Phase 10 - SEO Growth, Trust, and Production Readiness
Status: Implemented — Linux production validation pending
Phase 10 turns the Phase 7-9 platform into a measurable Persian-first publication for https://www.teknav.ir. All features are implemented and the frontend build is clean. Schema migration, seed, and smoke testing must be run on Linux before declaring production-ready.
Default target: a 90-day SEO growth roadmap, followed by reader retention and monetization only after crawlability, measurement, and editorial quality are reliable.
Implemented in this pass
- Topic authority hubs at
/topics/ai,/topics/security,/topics/software,/topics/hardware,/topics/startups, and/topics/data. - Topic hub metadata in
teknav-data.js: Persian SEO title/description, intro copy, keywords, and FAQ pairs. - Frontend
TopicHubPagewith featured articles, latest articles, related series, related authors, and visible FAQ content. - SEO manager support for topic hubs and series pages with
CollectionPage,FAQPage,ItemList, andBreadcrumbListJSON-LD. - Sitemap generation now includes topic hubs and public author profile URLs, and
robots.txtblocks/ACCOUNTS.md. - Production smoke script:
npm run smoke:prod. - Additive Prisma fields for editorial trust:
Article.factCheckedAtArticle.reviewedByIdArticle.sourceNotesArticle.contentFreshnessStatus
- Additive analytics model
AnalyticsEventwithtype,userId,articleId,topic,metadata, andcreatedAt. - First-party event writes for article views, newsletter subscriptions, article saves, writer follows, topic follows, and share clicks.
- Topic follows via
TopicFollowand/api/v1/topics/:slug/follow, with topic follow counts on authority hub pages. - Public newsletter archive routes and API:
/newsletter/newsletter/:slugGET /api/v1/newsletter/archiveGET /api/v1/newsletter/archive/:slug
- Newsletter archive SEO metadata and sitemap inclusion for
/newsletter. - Article saves now create/use the default reading list
بعداً بخوانم. - Role-aware panel metrics API
GET /api/v1/admin/panel-metricscovers admin, editor, writer, and reviewer dashboards with status, workflow, engagement, notification, SEO quality, and recent real event counts. - Writer workspace
/writerseparates personal stats, writing, article management, and comments from the full admin panel. It usesGET /api/v1/admin/writer/dashboardfor my views, followers, comments, and recent articles. - Writer-created articles are forced into draft or review states from the panel; they cannot bypass approval into public publication, and a linked public author profile is created on first submission when a writer account does not already have one.
- Article writing now exposes an automatic table of contents from
<h2>and<h3>headings before publish. - Review approval now runs Phase 10 quality gates, completes missing metadata, publishes the article, refreshes counts/cache, and notifies writer/topic followers.
- Public tag pages and backend tag filtering are available through
/tag/:tagandGET /api/v1/articles?tag=..., so approved content appears on category, topic, tag, author, article, sitemap, and feed surfaces. - Topic and author RSS files are generated under
/feeds/topic-*.xmland/feeds/author-*.xmlin addition to/feed.xml. - Weekly newsletter digest job
npm run newsletter:digestandteknav-weekly-digest.timersend the latest weekly articles through the existing SMTP/newsletter stack. - Glossary/dictionary term pages are available at
/glossary/:slugwith Persian metadata,DefinedTerm,FAQPage, and breadcrumb JSON-LD;scripts/generate-seo.mjsincludes them insitemap.xml. - The article editor includes a structured "X vs Y" comparison template with responsive comparison-table styling for published articles.
- Topic pages continue to expose visible FAQ content and
FAQPageschema for rich-result eligibility. - Google Discover readiness is improved with local 1200x630 article hero images,
fetchPriority="high"on the article hero image,max-image-preview:large, and OG image dimensions. - Persian article SEO has been normalized around the
ai-data-centric-2026success pattern:- Older article pages automatically get a semantic
.leadintroduction block at render time when their stored content does not already provide one. - Runtime article JSON-LD includes enriched
NewsArticle/TechArticlesignals:alternativeHeadline,abstract,articleBody,wordCount,timeRequired,about,mentions,teaches, authorknowsAbout, review metadata, and topic-hub linkage. - Static article pages generated under
dist/article/{slug}/index.htmlreceive the same enriched metadata before React hydration. - Future-dated articles are excluded from article sitemaps, feeds, and static article page generation until their
dateEnis current. - Article image sitemap entries now use explicit
ogImagevalues or generated/images/og/{slug}.jpgassets. npm run check:seoaudits current Persian indexable articles for canonical, meta, OG image, review date, heading structure, entity coverage, and body-depth warnings.
- Older article pages automatically get a semantic
- OAuth login remains production-wired for Google and GitHub through
/api/v1/auth/oauth/:providerandOAUTH_CALLBACK_BASE=https://www.teknav.ir. - SMS-based 2FA is implemented through Kavenegar OTP: users can enable it from profile settings, login returns a 2FA ticket, and
/api/v1/auth/2fa/verifycompletes session creation. - Verified expert badges are supported on author records and rendered on author lists, author profiles, public user profiles, and article bylines.
- Published article corrections/errata are supported through
ArticleCorrection, admin correction submission, public correction notices, and articledateModifiedupdates. - PWA support includes
public/manifest.json, service-worker registration inindex.html, offline cache handling for article pages/API responses, and an install prompt inteknav-ui.jsx. - Personalized home feed uses the public article API with
sort=personalized, followed topics, followed writers, and read history. - Community retention now includes comment upvoting with best-comment sorting, expanded article reactions, reading streaks, continue-reading data, and article Q&A endpoints.
- Monetization foundations are in place:
/jobswithJobListingstorage and company submission API./courseswith course API and public course page./membershippremium membership positioning page.User.membershipTier,Article.premiumOnly, premium article labels, and content locking for non-premium readers.Article.sponsoredand public "Promoted Content" labels.
- Operations foundations now include global Fastify rate limiting, selected bulk comment moderation, first-party client error capture at
/api/v1/errors, andbackend/tests/phase10-smoke.test.mjsfor auth/article/comment smoke coverage. - Living docs that describe the current surface now stay aligned:
DEPLOY.md,AGENTS.md,CLAUDE.md,SECURITY.md, and backend index docs. - Admin API foundations:
GET /api/v1/admin/seo/auditGET /api/v1/admin/analytics/contentGET /api/v1/admin/analytics/newsletterGET /api/v1/admin/analytics/engagement
Linux Validation Checklist
Run only on Linux/staging or production-like infrastructure:
cd /opt/teknav/SERVER
cd backend && npm run prisma:generate
cd backend && npm run prisma:apply
cd backend && npm run seed
cd ..
npm run seo:sitemap
npm run check:seo
npm run og:images
npm run build
cd backend && npm run build
cd backend && npm test
cd ..
npm run smoke:prod
Production smoke checks expect:
/api/v1/healthreturns 2xx with minimal{ ok };/api/v1/readyis the strict PostgreSQL/Redis readiness check./sitemap.xml,/robots.txt, and/feed.xmlreturn 2xx./ACCOUNTS.mdreturns 403 or 404 through nginx.- Selected article URLs return canonical URL evidence.
Override smoke targets when needed:
TEKNAV_SMOKE_URL=https://www.teknav.ir TEKNAV_SMOKE_ARTICLES=/article/agentic-ai-production,/article/ai-clean-data npm run smoke:prod
Writer Studio V5 — Close-out polish (implemented)
- HtmlEditor toolbar: grouped buttons (Formatting | Headings | Inline+Block | Lists | Media) with hover states, Bold/Italic label styling, and keyboard shortcuts Ctrl+B / Ctrl+I in the textarea and Ctrl+S globally to save draft.
- Live word count + character count footer on the editor textarea.
- WritingTipCard: manual prev/next navigation with
1/Ncounter; auto-advance timer resets on manual interaction. - ArtifactStudio diagram library: gradient placeholder thumbnails replaced with live scaled
DiagramRenderer compactmini-previews (CSS scale 0.33, overflow-hidden 56px container). - ArtifactStudio code mode: relabelled "code preview" with empty-state guidance; was falsely labelled "live preview".
- WeeklyChart data pipeline fixed: was reading the non-existent
weeklyViewsfield; now correctly readsviewsByDay.slice(-7).map(d => d.views)from the dashboard response. - Analytics sparklines upgraded: full-width filled-area SVG with
linearGradient, dot on latest point, "۳۰ روز پیش → امروز" axis labels. - Analytics table: sparklines prefetched for all articles on mount (parallel requests); inline 80×20 mini-sparkline visible per row; totals footer row; column header corrected from "روند (۳۰ روز)" to "روند اخیر".
- Overview tab: amber
needsRevisionalert banner when reviewer has flagged articles; dynamic time-of-day greeting (صبح / ظهر / عصر / شب بخیر) with matching tagline. - Article editor meta-panel: fields grouped into "اطلاعات پایه", "زمانبندی", and collapsible "سئو پیشرفته"; slug field added inside SEO section.
- Article editor preview mode: renders selected diagram via
DiagramRendererand subtitle above the article body. - Article editor: dirty-state indicator (● ذخیره نشده · Ctrl+S) shown when form differs from last-saved snapshot; cleared on successful save.
- Article editor: amber "بازخورد ویراستار" banner when opening a
نیازمند اصلاحarticle with a reviewer note. - Articles list: hard cap of 15 replaced with "نمایش X مورد دیگر" show-more/less button; reviewer note shown inline for revision-flagged rows.
- Overview recent-articles: reviewer note shown inline for
نیازمند اصلاحarticles. - Comments tab: article title chip added next to commenter name; cap note explains 8-recent limit and redirects to article for full thread.
- Backend:
articleIncludenow joinsreview { note, status };publicArticleexposesreviewNote; flows through writer dashboard, articles list, and editor.
Remaining Work
- Linux validation (blocking for production):
cd backend && npm run prisma:generatecd backend && npm run prisma:applycd backend && npm run seednpm run seo:sitemap && npm run og:images && npm run buildnpm run check:seocd backend && npm run buildnpm run smoke:prod
- Verify all flows after schema apply: auth, comments/likes/flags, history, notifications/SSE, reading lists, topic/writer follows, tag pages, series, topic hubs, newsletter archive/campaigns, review workflow, analytics endpoints, panel metrics, first-party events.
- Rotate all seed/admin passwords after first production login.
- Remove
resetPasswordOnSeedfrom writer-admin credentials after rotation. - Confirm SMTP and Kavenegar credentials.
- Nice-to-have (not blocking): article save list picker UI; topic-targeted new-article notifications; Search Console/Bing Webmaster local verification files.
Editorial Rules
- Every published article should have one topic/category, two or more internal links, a canonical path, local OG image, source notes, and fact-check date.
- Articles older than 90 days should be marked
needs_updateunless reviewed. - External analytics scripts remain out of scope for Phase 10 because of zero-CDN and privacy goals.