Free early-access launch: LAUNCH_MODE policy, CRO, pipeline hardening, AI-SEO, ops

- launch.ts policy: LAUNCH_MODE=free_early_access default; effective access =
  published && (free || early); intended tier (access) never rewritten
- Billing off server-side: /api/subscribe 503 honest copy; subscribe CTAs
  render disabled 'قريباً' from first paint; /subscription early-access panel
  + /api/notify (LaunchNotifications) with honest 503 when mail transport off
- Signup trust: verification email at signup (Users afterChange), no
  confirm-password, 429 message fidelity, typo suggestion, live password hint
- Agent pipeline: pickFields strips access/readingMinutes, sourceId dedup,
  secret-scan 422 (pattern names only), string-content rejected (was silently
  replaced), publish stays explicit opt-in
- lexical.ts: root unwrap fix — lexicalToText/countLexicalWords returned 0
  for real serialized trees (secret scan + readingMinutes were inert)
- llms-full.txt: fetchIndexDocs(true) — bodies were never selected
- Content honesty: contentType/authorName/sourceId fields + migration,
  readingMinutes computed at write (160 wpm) + backfill script, byline,
  'حُدّث' freshness
- SEO/AI-SEO: metadata rewrite (published-only, og:image 1200x630), Article +
  BreadcrumbList + FAQPage + Organization JSON-LD, isAccessibleForFree honest,
  table renderer, robots AI-crawler policy (10 named bots), llms.txt +
  llms-full.txt, /topics/* hubs + sitemap, noindex auth pages, www 301
- Ops: backup-db.sh (restore rehearsed on VPS), docs copies (launch
  readiness + marketing audit + owner-inputs for L-03), GLOSSARY.md entries

Verified: tsc --noEmit 0, npm run build 0, local smoke (ghost VIP read,
subscribe/notify/agent APIs, signup token, 429 on 6th, llms/topics/sitemap,
og:image/JSON-LD)
This commit is contained in:
AHMED
2026-10-10 18:03:45 +03:00
parent 82414e8a93
commit 0161924088
57 changed files with 4042 additions and 402 deletions
-2
View File
@@ -14,7 +14,6 @@ export async function up({ db, payload, req }: MigrateUpArgs): Promise<void> {
"created_at" timestamp(3) with time zone DEFAULT now() NOT NULL
);
ALTER TABLE "users" ADD COLUMN "full_name" varchar;
ALTER TABLE "users" ADD COLUMN "interest" "enum_users_interest";
ALTER TABLE "users" ADD COLUMN "level" "enum_users_level";
ALTER TABLE "users" ADD COLUMN "goal" "enum_users_goal";
@@ -43,7 +42,6 @@ export async function down({ db, payload, req }: MigrateDownArgs): Promise<void>
ALTER TABLE "payload_locked_documents_rels" DROP CONSTRAINT "payload_locked_documents_rels_post_likes_fk";
DROP INDEX "payload_locked_documents_rels_post_likes_id_idx";
ALTER TABLE "users" DROP COLUMN "full_name";
ALTER TABLE "users" DROP COLUMN "interest";
ALTER TABLE "users" DROP COLUMN "level";
ALTER TABLE "users" DROP COLUMN "goal";
File diff suppressed because it is too large Load Diff
+41
View File
@@ -0,0 +1,41 @@
import { MigrateUpArgs, MigrateDownArgs, sql } from '@payloadcms/db-postgres'
export async function up({ db, payload, req }: MigrateUpArgs): Promise<void> {
await db.execute(sql`
CREATE TYPE "public"."enum_posts_content_type" AS ENUM('note', 'tutorial', 'case_study', 'comparison');
CREATE TYPE "public"."enum_launch_notifications_source" AS ENUM('subscription');
CREATE TABLE "launch_notifications" (
"id" serial PRIMARY KEY NOT NULL,
"email" varchar NOT NULL,
"source" "enum_launch_notifications_source" DEFAULT 'subscription',
"updated_at" timestamp(3) with time zone DEFAULT now() NOT NULL,
"created_at" timestamp(3) with time zone DEFAULT now() NOT NULL
);
ALTER TABLE "posts" ADD COLUMN "content_type" "enum_posts_content_type";
ALTER TABLE "posts" ADD COLUMN "author_name" varchar;
ALTER TABLE "posts" ADD COLUMN "source_id" varchar;
ALTER TABLE "payload_locked_documents_rels" ADD COLUMN "launch_notifications_id" integer;
CREATE UNIQUE INDEX "launch_notifications_email_idx" ON "launch_notifications" USING btree ("email");
CREATE INDEX "launch_notifications_updated_at_idx" ON "launch_notifications" USING btree ("updated_at");
CREATE INDEX "launch_notifications_created_at_idx" ON "launch_notifications" USING btree ("created_at");
ALTER TABLE "payload_locked_documents_rels" ADD CONSTRAINT "payload_locked_documents_rels_launch_notifications_fk" FOREIGN KEY ("launch_notifications_id") REFERENCES "public"."launch_notifications"("id") ON DELETE cascade ON UPDATE no action;
CREATE INDEX "posts_source_id_idx" ON "posts" USING btree ("source_id");
CREATE INDEX "payload_locked_documents_rels_launch_notifications_id_idx" ON "payload_locked_documents_rels" USING btree ("launch_notifications_id");`)
}
export async function down({ db, payload, req }: MigrateDownArgs): Promise<void> {
await db.execute(sql`
ALTER TABLE "launch_notifications" DISABLE ROW LEVEL SECURITY;
DROP TABLE "launch_notifications" CASCADE;
ALTER TABLE "payload_locked_documents_rels" DROP CONSTRAINT "payload_locked_documents_rels_launch_notifications_fk";
DROP INDEX "posts_source_id_idx";
DROP INDEX "payload_locked_documents_rels_launch_notifications_id_idx";
ALTER TABLE "posts" DROP COLUMN "content_type";
ALTER TABLE "posts" DROP COLUMN "author_name";
ALTER TABLE "posts" DROP COLUMN "source_id";
ALTER TABLE "payload_locked_documents_rels" DROP COLUMN "launch_notifications_id";
DROP TYPE "public"."enum_posts_content_type";
DROP TYPE "public"."enum_launch_notifications_source";`)
}
+7 -1
View File
@@ -4,6 +4,7 @@ import * as migration_20261003_111451 from './20261003_111451';
import * as migration_20261003_133758 from './20261003_133758';
import * as migration_20261003_201454 from './20261003_201454';
import * as migration_20261009_130817 from './20261009_130817';
import * as migration_20261010_142214 from './20261010_142214';
export const migrations = [
{
@@ -34,6 +35,11 @@ export const migrations = [
{
up: migration_20261009_130817.up,
down: migration_20261009_130817.down,
name: '20261009_130817'
name: '20261009_130817',
},
{
up: migration_20261010_142214.up,
down: migration_20261010_142214.down,
name: '20261010_142214'
},
];