Files
viraladblitz/README.md
T
martbost 117bb47273 Remove street mailing address from public pages (Marty 2026-11-16)
Pages, footers and the site assistant now name only TrustClickz; the footer
reads "(c) 2026 TrustClickz". Contact stays the network support link.
QA checks updated to assert no street address is shown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 10:46:20 -06:00

54 lines
8.2 KiB
Markdown

# 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; rows are labelled LEVEL 1 to LEVEL 5 in the order shown, the real place in the line is kept as `depth`), then 2 Boosted places, then "Join free under @owner" (JOIN_URL, default InstantAdPay's join page `https://instantadpay.com/join/{ref}`).
- **Front page**: royal 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), 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`.
- **LinkSpin tracked links** (lstrack.js, 2026-11-15): when a member saves their text ad, LinkSpin makes or updates a tracked link for it on the member's own LinkSpin account (signed `POST LS_URL/api/partner/vab/links`, net.v1 HMAC with NETWORK_SSO_SECRET, by network username, source "ViralAdBlitz", ad id as s1/placement). `/go/<ad>` then sends through that link while it points at the ad's current link; otherwise straight to the member's link. "Track with LinkSpin" toggle on the ad form (default on); links with {clickid}/{placement} are not tracked. Fails soft: LinkSpin down or not shipped = plain link, a sweep retries every 2 minutes (failures back off 10 minutes, no account a day). My page shows the LinkSpin clicks; admin status has the counters. Env: `LS_TRACK=0` turns it off, `LS_TRACK_URL` overrides LS_URL (tests).
- **Network ad zones**: 6 LinkSpin zones on Marty's account for viraladblitz.com (made 2026-11-15): `public/assets/common.js` ZONES (footer 728x90 ls-766b4a, phone 320x50 ls-66e157, ledger 468x60 ls-a5c68c, Boost 300x250 ls-754307, My page 468x60 ls-f880d2) and `ZONE_404` ls-c6c515 in server.js. They count as paid views only on viraladblitz.com (not on the staging host).
- **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.
- **Look** (approved 2026-11-14): "daylight cyberpunk" in Marty's colors, one stylesheet `public/assets/vab.css` with CSS variables: light blue-white ground, white clipped-corner cards, royal bands and ticker, red pill CTA, gold for Boost and boosted, Barlow Condensed / Chakra Petch / Inter / JetBrains Mono. My page is the member dashboard (side menu, stat cards, my-ad card, line bars, Boost ring, recent activity), every figure from `/api/my`. Telegram proof cards: `public/art/proof/vab-proof-{royal,daylight,navy}.png`.
## 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
UI_FONTS=1 node qa/smoke.mjs # same, but lets Google Fonts load so the qa/out screenshots show the real type
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`.
## Staging (2026-11-15)
Coolify app `p5abaw5evbtf9qpk0wbv0mfd` (compose, Crypto Projects/production, volume vab-data, connect_to_docker_network on) on https://vab.saasy.top, MySQL `6dgur7sbgbwcawlxen6du1jr` (viraladblitz-mysql, binlog expiry 3 h, in /root/db-hourly-dump.sh). Repo git.saasy.top/marty/viraladblitz (contracts: marty/viraladblitz-contracts, private). SITE_HOST=vab.saasy.top, TG_* empty (no sale cards), HUB_ENABLED=1, KEEPER_KEY from /root/.vab-keeper-key, ADMIN_TOKEN /root/.vab-admin-token, HUB_SECRET /root/.vab-hub-secret (root-only on core).
Domain switch DONE 2026-11-15 ~8 AM CT: Coolify domains viraladblitz.com + www + vab.saasy.top, SITE_HOST=viraladblitz.com, TG_* from VBB (payments topic 632242), IAP VAB_URL, hub LOOKUP_SITES vab url (NETWORK_SITES with the hub deploy), Reown allowlist, rhi zone apex A 140.99.254.14 + MX mail.viraladblitz.com A 89.116.149.103, old crons off, old members reconciled on the hub (108 sponsors filled, 330 quiet joins, 6 bots blocked), oldrefs 2,351.
## Site assistant (2026-11-15)
Chat widget on every page (`public/assets/chat.js` + `chat.css` in this site's look). `chatbot.js` holds what it knows (CANNED
instant answers + FACTS, written from this repo's code); `chatcore.js` (engine), `kb.js` (BM25 knowledge base, `kb.json` = a MySQL
document) and `netkb.js` (the shared network knowledge on the hub: publishes this site's entries, reads the other sites') are the same
files on every rebuilt site. OpenRouter key: `/app/data/openrouter.key` on the volume (copied from InstantAdPay). Account problems hand
off to network support (`https://instantadpay.com/support?from=viraladblitz`). Admin API (x-admin-token): `/api/admin/kb`,
`/api/admin/kb/<id>`, `/api/admin/kb/test`, `/api/admin/kb/network?refresh=1&publish=1`. Test: `node qa/chatbot.test.mjs`
(Q&A in `qa/chat-qa.json`). House rule: a feature change updates CANNED + FACTS and KNOWLEDGE_DATE in the same commit.