ViralAdBlitz v1 (viraladblitz.com rebuild, Marty approved 2026-11-14): the network's text-ad home, local build, not deployed

- Free text ad for network members (InstantAdPay / LinkSpin sign-in or wallet, membership through the hub), one per member
- Member pages viraladblitz.com/<username>: own ad + the first 5 people above in the hub line with a live ad (by place) + 2 Boosted places
- Front page: amber ticker (Boosted starred), Top ads this week by verified clicks, today's numbers, ledger, contract proof
- Verified visitors / views / clicks (ticket + dwell + per-visitor dedupe + per-connection cap + bot filter, owner excluded)
- Boost $5 = 500 guaranteed views through VABShop: keeper-signed EIP-712 line voucher from the hub line, watcher, delivery
  counted per verified view with an audit row each, Network Ad Space text-ad finishing after 30 days (vabnas.js)
- Trust pack: /ledger, /contract, toasts, Telegram card per Boost (once), Terms / Earnings Disclaimer / Privacy (TrustClickz),
  network footer from the hub with tracked links, promo kit (21 creatives) + /promote, LinkSpin zone placeholders, hub report
- Old YFW links via the oldrefs map (admin load route); docstore MySQL documents + row tables
- qa/smoke.mjs 162/162 (stand-in hub, chain, Telegram, NAS; Playwright desktop + phone), qa/chain.mjs 20/20 (real VABShop on anvil)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Marty Bostick
2026-11-14 13:52:03 -06:00
commit 001878bdae
79 changed files with 4813 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
# ViralAdBlitz app (viraladblitz.com rebuild)
The network's text-ad home (Marty approved the plan and mockup 2026-11-14; Boost = $5 for 500 guaranteed network views).
Plain Node http server, no framework, the VBB / Downline Banners pattern. Contract: `../contracts` (VABShop).
## What it does
- **Free text ad** (headline 60, two lines of 90, https link, no shorteners) for network members: sign in through InstantAdPay or LinkSpin (networksso.js, audience `viraladblitz`) or by wallet; membership is checked with the network hub (hubpeople.js), InstantAdPay's lookup only while the hub is unreachable. One ad per member, editable.
- **Member page** `viraladblitz.com/<network username>`: the member's ad, then the first 5 people above them in the hub sponsor line who have a live ad here (hubline.js walks up to 20 places; each row is labelled with the person's real place in the line), then 2 Boosted places, then "Join free under @owner" (JOIN_URL, default InstantAdPay `?ref=`).
- **Front page**: amber ticker of the newest ads (Boosted ones starred, on every page), "Top ads this week" by verified clicks, today's numbers, 3 steps, live ledger, contract proof, toasts.
- **Verified visitors** (wire.js, VBB rules): every page load gets a ticket listing the ads the server showed; after `VISIT_SECONDS` visible the browser redeems it. Bots, early sends and more than `VISITS_PER_IP_DAY` browsers per connection are refused. Each shown ad gets one view per visitor per 24 h, never the owner's own. Verified clicks: `/go/<ad>?v=<token>` once per visitor per ad per 24 h, never the owner's own; raw clicks are counted apart. `{clickid}` and `{placement}` in an ad link are filled on every click.
- **Boost** ($5, one-time, never a subscription): order built server side (`POST /api/my/order`), paid from the member's wallet through VABShop. If the buyer's line is not on chain yet, the keeper signs an EIP-712 line voucher with the hub line's wallets (nearest first, up to 20, people without a wallet left out). The watcher (shop.js) records each Purchase once per tx:logIndex.
- **Delivery** (wire.js + vabnas.js): every verified view of a Boosted ad counts toward its guarantee (oldest Boost first) and is kept as an audit row (`vab_bviews`, 120 days). Boosted ads are starred on the ticker and fill the member pages' Boosted places, furthest-behind first. A Boost not delivered on-site within 30 days is finished through **Network Ad Space as a text ad** (pid 1) for exactly the views still owed; NAS impressions count toward the same guarantee. NAS was chosen over LinkSpin zones because NAS serves text ads natively; LinkSpin zones are banner placements.
- **Trust pack** (proof.js): `/ledger` (each Boost with every level paid, its place in the line, who was passed over, delivery), `/contract` (live facts), toasts of real events, one Telegram photo card per Boost (never twice: in-process guard + `docstore.claim`, nothing older than 2 hours), Terms / Earnings Disclaimer / Privacy (TrustClickz, 615 Green Valley Drive, Moody, AL 35004), the network footer from the hub (netsites.js, tracked LinkSpin links, code `nwvab`).
- **Promo kit** (promokit.js): `GET /api/promo-kit?u=`, `/promote`, 21 creatives `public/art/kit/vab-{free,spread,boost}-{tile,strip,leader,box,tower,social,square}.png`.
- **Network ad zones**: placeholders in `public/assets/common.js` ZONES and `ZONE_404` in server.js, ids empty until the LinkSpin zones exist.
- **Hub report** (hubreport.js): each Boost as contract-bind / contract-spend, contract `viraladblitz`, off unless `HUB_ENABLED=1`.
- **Old links**: `/?<old>`, `/splashpg.php?pid=N&r=<old>`, `/lcp.php?pid=N&r=<old>` 301 to `/<network username>` from the oldrefs map (`POST /api/admin/oldrefs`), any other `*.php` to `/`.
- **Data**: docstore.js (MySQL via `DOCSTORE_URL`): document `vab.json` + row tables `vab_ads`, `vab_visits`, `vab_clicks`, `vab_bviews`; `hubreport.json`, `vab-nas.json`, `oldrefs.json` are documents too.
## Run and test
```
npm install
node server.js # prototype mode without DOCSTORE_URL (never launch this way)
node qa/smoke.mjs # 162 checks: stand-in hub, chain, Telegram, NAS; Playwright desktop + phone renders
SKIP_UI=1 node qa/smoke.mjs # HTTP checks only
node qa/chain.mjs # 20 checks against the real VABShop on a local anvil chain (needs ../contracts built)
node tools/pages.mjs # regenerate public/*.html (one source of copy + legal facts)
node tools/art.mjs # regenerate icon, OG image, proof cards, kit creatives (Playwright)
```
Admin: `/admin` with the `ADMIN_TOKEN` (status, Boost delivery, member lookup, ad status, old-link map). Env: `.env.example`.