# Phase 11 - Production Launch + Platform Completeness ## Status: Implemented (Linux production validation pending) ## Goal Ship `https://www.teknav.ir` by completing Linux production validation (Track 0), then close the 13 confirmed platform gaps across admin completeness, reader UX, monetization activation, and reliability without introducing new dependencies or architectural shifts. --- ## Track 0 — Production Gate `[BLOCKING]` All items in this track must be completed before any Phase 11 feature work begins. ### 0.1 Linux Validation Sequence Run in order on the production or staging Linux host: | Step | Command | |------|---------| | Generate Prisma client | `cd backend && npm run prisma:generate` | | Apply schema | `cd backend && npm run prisma:apply` | | Seed database | `cd backend && npm run seed` | | Install frontend deps (if needed) | `npm install` | | Generate SEO artifacts | `npm run seo:sitemap` | | Generate OG images | `npm run og:images` | | Build frontend | `npm run build` | | Build backend | `cd backend && npm run build` | | Run smoke tests | `npm run smoke:prod` | ### 0.2 Functional Verification Checklist After schema apply, manually verify each flow: - [ ] Login by email and by `@username` - [ ] Signup with display name, username, password, email/phone - [ ] SMS 2FA enable from profile → login returns `tek_2fa` ticket → `/api/v1/auth/2fa/verify` completes session - [ ] Google/GitHub OAuth callback and session creation - [ ] Password reset via SMTP - [ ] Email verification via SMTP - [ ] Profile edit for reader, writer, editor, reviewer, admin roles - [ ] Password change with current-password confirmation - [ ] Avatar upload and WebP conversion - [ ] Article create → review workflow → publish (writer → reviewer → editor/admin) - [ ] Scheduled publish fires via `teknav-publish-due.timer` - [ ] Comments, replies, likes, flags, upvotes - [ ] Reading history tracked on article view - [ ] Reading lists — save to default list, list management - [ ] Notifications and SSE stream at `/api/v1/auth/notifications/stream` - [ ] Admin SSE at `/api/v1/admin/stream` (visitor counter, activity) - [ ] Writer/topic follows and follow counts - [ ] Tag pages at `/tag/:tag` - [ ] Topic hub pages at `/topics/ai` etc. - [ ] Newsletter archive at `/newsletter` and `/newsletter/:slug` - [ ] Series pages at `/series/:slug` - [ ] Glossary pages at `/glossary/:slug` - [ ] Reactions (heart/fire/thinking) on articles - [ ] Reading streak increments on daily visits - [ ] Continue-reading progress saved in `ReadHistory.progress` - [ ] Q&A endpoints at `/api/v1/articles/:slug/qa` - [ ] `/jobs`, `/courses`, `/membership` pages render - [ ] Premium article content locking for non-premium readers - [ ] Sponsored label visible on promoted articles - [ ] Errata notices on corrected articles - [ ] Admin analytics at `/api/v1/admin/analytics/*` - [ ] Panel metrics at `/api/v1/admin/panel-metrics` - [ ] SEO audit at `/api/v1/admin/seo/audit` - [ ] First-party error capture at `/api/v1/errors` - [ ] `/ACCOUNTS.md` returns 403/404 through nginx - [ ] `/sitemap.xml`, `/robots.txt`, `/feed.xml` return 2xx ### 0.3 Credential Rotation and Hardening - [ ] Rotate all seed/admin passwords after first production login - [ ] Remove `resetPasswordOnSeed` flag from writer-admin credentials in `backend/prisma/credentials.json` - [ ] Confirm SMTP credentials in `/etc/teknav/backend.env` - [ ] Confirm Kavenegar API key in `/etc/teknav/backend.env` - [ ] Confirm `OAUTH_CALLBACK_BASE=https://www.teknav.ir` in env - [ ] Verify `ACCOUNTS.md` is gitignored and HTTP-blocked --- ## Track 1 — Admin + Editor Completeness `[Quick wins — backend fully built]` All 5 items in this track have complete backend support. Only frontend wiring is missing. ### 1.1 Sponsored / premiumOnly / featured Toggles in ArticleEditor `[S]` ✓ DONE **Gap:** `Article.sponsored`, `Article.premiumOnly`, and `Article.featured` exist in the Prisma schema and are returned by the admin articles API, but the `ArticleEditor` form in `teknav-admin.jsx` has no UI controls for them. A field helper (`fieldRow`) exists and is used for other boolean fields; these three are simply not called. **Fix:** Add three toggle rows in the ArticleEditor meta-panel under a new "نشانه‌گذاری" (Flags) collapsible group: - `premiumOnly` — "فقط اعضای ویژه" with lock icon - `sponsored` — "محتوای حمایت‌شده" with badge icon - `featured` — "مقاله ویژه" with star icon **Files:** `teknav-admin.jsx` → `ArticleEditor` meta-panel --- ### 1.2 Content Freshness Filter in ArticlesManagement `[S]` ✓ DONE **Gap:** `Article.contentFreshnessStatus` (values: `up_to_date`, `needs_update`, `outdated`) was added in Phase 10 but the `ArticlesManagement` filter bar only filters by `status` (draft/review/published etc.), not by freshness. **Fix:** Add a `