Commit Graph

82 Commits

Author SHA1 Message Date
martbost 2ac6549171 Wall ownership ladder: positions 2 and 3 become the member's own at 2 / 5 qualifying buyers
- accounts.wall_offers (JSON, up to 2 offers: label, https link, banner) set from
  Profile > Your wall; upload supported; locks show the buyer threshold.
- /api/wall assembles: position 1 = own line banner; positions 2-3 = own offer
  when unlocked and set, else upline banners (only uplines with a live banner),
  else house ads. Response carries unlocked + buyerCount; wall labels show
  "this wall" / "their line" / "InstantAdPay".
- Chatbot canned answer + facts, follow-up email 7 mention the ladder.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-09 15:31:45 -05:00
martbost 26b98c65c5 Invite links answer HEAD too
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-09 11:05:02 -05:00
martbost fe217b897a QA fixes: HEAD on page routes, Shorts signed-out 401, invite-page onboarding handoff, viewer check buttons clear of the overlay close button
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-09 11:03:26 -05:00
martbost 4846af535a Earn credits: ad view dwell defaults to 10 seconds (was 5)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-09 07:58:24 -05:00
martbost c7018f6258 My line: POL earned from each person; wallet picker features non-Trust wallets first
- /api/my/line sums TierPaid events per buyer for the signed-in member; the
  downline rows show "+X POL" (what that person has paid you so far).
- AppKit featuredWalletIds: MetaMask, Phantom, SafePal, Coinbase first; Trust
  Wallet stays available under All wallets.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-09 07:47:41 -05:00
martbost 15a29af104 Follow-up sequence: 7 emails over 14 days in Marty's voice, paid-aware branches
Drafted through the Branded Voice engine (gain, logic, PAS, logic, honest
fear of loss, AIDA, gain + newsletter hand-off), checked against the contract
facts. {{paid:a|b}} resolves per reader from on-chain credits. Defaults now
live in drip-defaults.json; admin overrides still in the volume.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-09 06:37:39 -05:00
martbost ce49dbbe4d Lead capture pages + follow-up email sequence
- /join/<token>[?v=angle] now serves a capture page (email first, wallet
  later) with angle-matched hook copy, sponsor line, worked-example ledger,
  how-it-works, live package ladder, and per-angle og tags (og:url keeps ?v=).
  The sponsor cookie is set exactly as before; ?v= is remembered and stored
  on the account as joined_via (shown in admin Members).
- drip.js: 4-step getting-started sequence (24h/48h/96h/168h) queued when a
  free account is created with the pre-checked opt-in; ticker every 10 min;
  signed /unsubscribe link in every email; MySQL + JSON storage.
- Admin > Settings: edit the sequence as JSON, reset to defaults, send any
  step to the admin inbox; Overview shows follow-ups in flight.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-09 06:21:01 -05:00
martbost f717acad97 Promo tools: drop the printable handouts section and /flyers page
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-09 06:12:00 -05:00
martbost f3f9662d99 Promo tools built out: posts, text-a-friend, swipes, banner kit, handouts, objections
- Social posts for X / Facebook / LinkedIn / Telegram-WhatsApp with post and
  share buttons; 5 SMS-sized Text-a-friend messages (Text it / WhatsApp /
  Telegram / Copy); email swipes short, standard, long, follow-up.
- Banner kit adds 1080x1080, 1080x1920 and 1280x720 (tools/gen-social-banners.cjs)
  with Download buttons.
- Printable half-sheet handouts at /flyers with the member's QR + invite link
  (qrlib.js, two per letter page, cut line, print-one).
- Objection handling bank: truth + ready-to-send reply per objection.
- Invite-link strip, Branded Voice CTA, pill menu covers every kit; chatbot
  canned answer + prompt facts updated. Angle links carry ?v= for the
  upcoming hook pages.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-09 05:54:18 -05:00
martbost dd2ee4b77e One way in: email sign-in only; wallet-only sessions finish setup by email
- Remove the "sign in with just your wallet" door from the sign-in card.
- A wallet-only session (no account) is walked to the email card with a
  finish-setup note; verifying the code links that wallet to the account
  and retires the wallet-only session, so member #, purchases and payouts
  stay attached and username/profile work.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-09 05:32:30 -05:00
martbost 438b1921e9 Admin portal (/admin) + free house ads; POL amounts show two decimals
- /admin: email magic-code sign-in allowlisted to ADMIN_EMAIL, 12h admin
  session (cookie iap.adm, persisted in the volume). Bearer ADMIN_PASSWORD
  API access still works. Member area shows an Admin link for that email.
- House ads: admin places banner/text/login/solo/video/featured/visits
  campaigns owned by house@instantadpay.com that cost nothing; budget is
  only a delivery cap, spend is never charged or burned.
- Admin APIs: overview, all campaigns (+pause/resume any), members
  (+re-point sponsor), reports (+resolve), pending burns, rates/site
  config get+patch, creative upload.
- fmtPol rounds to two decimals everywhere (dashboard, toasts, prices).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-09 05:15:19 -05:00
martbost b6a0729335 Name the referral in the new-referral email
The email fired at signup, before the member picked a username, so it always
said "A new member." Fire it instead when the username is first set (onboarding
/api/my/profile, empty->set transition only) so the sponsor's email names them
(@username). Removed the signup/verify triggers.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-08 16:46:59 -05:00
martbost e58de01209 Fallback unattributed joins under #1 instead of root
Members were activating with sponsorId 0 (their own root) whenever their sponsor
couldn't be resolved — dead pre-wipe links (dkain) or no link at all — so their
purchases rolled to admin instead of building the tree. Default an unresolvable
sponsor to the configured catch position (siteConfig.defaultSponsorId, default
1) in both the buy path (/api/sponsor) and the free-activation path (/api/me),
guarded so #1 itself is never self-sponsored.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-08 15:28:28 -05:00
martbost cb5c8db2c6 Never cache HTML (no-store) so wallet browsers can't serve stale pages
Trust's in-app browser was serving a cached pre-fix HTML page that pointed at
old JS, re-triggering the numeric-chainId crash even after the fix shipped.
Switch HTML from no-cache to no-store so every load fetches the current page and
its current asset versions. Versioned assets still cache for an hour.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-08 12:02:05 -05:00
martbost b7e2cf56b9 Use the account's stored sponsor at buy time, not just the cookie
/api/sponsor (which the buy flow reads to set sponsorIdIfNew) resolved ONLY the
iap.sponsor cookie. A member whose join cookie was absent at buy time (different
device, cleared cookies, return visit) resolved to 0 and activated on-chain as
their own root instead of under their real sponsor — irreversible. Prefer the
logged-in account's stored sponsorRef, cookie only as anonymous fallback,
matching /api/me.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-08 11:59:48 -05:00
martbost f53bb7db85 Sponsor notifications: new referral + referral purchase
- notifyNewReferral (was nudgeReferrer): email a member's sponsor on EVERY new
  referral, activated or not. Resolve the sponsor from the join token by member
  id, share code, or username (was code-only and skipped already-activated
  sponsors). Reworded from an activation nudge to a real "you have a new
  referral" note; keeps the payouts reminder only for un-activated sponsors.
- Purchase event now also emails the buyer's direct sponsor that their referral
  bought a package, noting whether it's a $20+ qualifying purchase.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-08 11:34:34 -05:00
martbost 873a9e5e4a Mainnet indexer fix + retire testnet copy
- chain.js: derive the chain tip as the MAX height across the RPC pool and scan
  getLogs against that same synced node. Load-balanced public RPCs (publicnode)
  intermittently answer eth_blockNumber from a replica lagging thousands of
  blocks behind, which stalled the mainnet scan (latest < lastBlock, 0 events)
  and could skip freshly-mined events. This unblocks the live ledger + the
  purchase-confirmation email (both driven by the event scan).
- disclaimer: replace the "rehearsal/testnet" section with a live-on-Polygon
  real-money notice (it's live now).
- Point the dead Amoy fallbacks (purchase email tx link, contract-page source
  link) at Polygon mainnet / the verified mainnet contract.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-08 11:20:47 -05:00
martbost 7b131dad28 Gas floor fix, chain guard, and dashboard footer
- wallet.js: fetch correct EIP-1559 fees from the network (Amoy/Polygon Bor
  enforce a ~25-30 gwei priority floor MetaMask's estimate misses) via new
  /api/gas; hard chain-guard before signing so a tx never lands on the wrong
  network; accept the wallet's usual networks in AppKit so its modal stops
  looping and drive add+switch ourselves.
- chain.js: suggestedFees() from eth_maxPriorityFeePerGas + base fee.
- Dashboard: move the Site links (Ad packages / Live ledger / The contract)
  out of the sidebar into a page footer; hide the sidebar scrollbar.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-08 10:49:34 -05:00
martbost 8958a9d145 Fix credits showing 0 + purchase confirmation email
- chain.rpc(): retry the RPC pool 3 rounds with backoff. Public Amoy nodes
  routinely return transient "Temporary internal error. Please retry" on
  eth_call; a single miss was silently surfacing as 0 credits / chainReadError
  on the dashboard even when the buy succeeded on-chain.
- emailOnEvent: send a purchase confirmation on the Purchase event — credits
  added, new ad-credit balance, POL paid, and a link to view the tx on the
  explorer. Fires server-side for every wallet and the Mini App.
- Added a third Amoy RPC (tenderly) to the volume config for read redundancy.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-08 10:26:53 -05:00
martbost 8eedfbe6e6 CSP: allow Coinbase Wallet endpoints (connect-src *.coinbase.com)
AppKit's Coinbase Wallet connector calls coinbase.com; allow it so Coinbase
Wallet works alongside the others.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-08 09:58:33 -05:00
martbost b172ef674d CSP: allow AppKit's inline bootstrap script by hash (keep no unsafe-inline)
AppKit injects one inline script; allow it via its sha256 hash rather than
opening script-src to unsafe-inline, preserving the strict policy.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-08 09:55:34 -05:00
martbost 0995293398 CSP: allow blob: images + reown font for AppKit modal
AppKit renders wallet icons from blob: URLs and uses its brand font from
fonts.reown.com; add blob: to img-src and fonts.reown.com to font-src so the
picker shows proper icons and type.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-08 09:52:19 -05:00
martbost bd4040ff4f Rebuild wallet connect on Reown AppKit (universal, all wallets, working icons)
Replaces the low-level ethereum-provider + deprecated modal (broken icons, jank)
with Reown AppKit loaded from the CDN — the standard connector every wallet
supports, with QR + mobile deep-links and a polished picker. Keeps the exact
SIWE sign-in and contract buy/activate logic, driving AppKit's EIP-1193 provider.
CSP widened for the AppKit SDK/RPC + a worker.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-08 09:48:38 -05:00
martbost 653a5e333a Amoy rehearsal: faucet points testers to the public Amoy faucet
anvil_setBalance doesn't exist on Amoy. The faucet now connects the wallet,
copies the address, and opens faucet.polygon.technology so testers fund their
own wallet with test POL (choose Polygon Amoy). Server endpoint returns the
faucet link + address instead of minting balance.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-08 08:33:46 -05:00
martbost f0e42e47bb Add WalletConnect: connect from any mobile browser (no dApp browser)
Mobile users in a normal browser hit "no wallet found" because EIP-6963 only
sees injected/extension wallets. WalletConnect fixes it: the connect picker now
offers WalletConnect (auto-selected when no injected wallet is present), which
shows a QR on desktop and opens the wallet app directly on mobile — no in-app
dApp browser, no second login. Lazy-loads the @walletconnect/ethereum-provider
UMD from jsdelivr; the result is a plain EIP-1193 provider so sign/switch/buy are
unchanged. CSP widened for the SDK + WC relay. Project id lives in site config
(public value); gated so nothing changes until it's set.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-08 07:36:07 -05:00
martbost 8d9f56f68a Newsletter opt-in: silent Sendy subscribe on join
Pre-checked "InstantAdPay newsletter" opt-in on the join screen (read by both the
email-code and password signup paths). On new-account creation only, the server
silently subscribes them to the Sendy "InstantAdPay Newsletter" list
(boolean=true, opt-out always wins). New sendy.js helper reads the API key from
SENDY_API_KEY env or DATA_DIR/sendy.key on the volume (same pattern as
sendgrid.key); subscribe is fire-and-forget and never blocks signup.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-08 07:13:50 -05:00
martbost 8ec6286ff7 Add MoonPay card on-ramp (same underpinning as RM Circle)
Signed /api/moonpay-url endpoint: public key from MOONPAY_PUBLIC_KEY env or site
config, SECRET from MOONPAY_SECRET_KEY env ONLY (never site config, since
/api/config exposes siteConfig). Wallet-prefilled signed MoonPay URL when keys
are set, else a generic buy page. "Buy POL with a card" button under the Buy
packages tiles. Zero custody: MoonPay is merchant of record; crypto goes
straight to the buyer's wallet.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-08 06:26:15 -05:00
martbost 0c803c07cb Legal pages (Terms, Privacy, Disclaimer) + always-present footer
- New /terms, /privacy, /disclaimer pages in the site style with real content
  tailored to an on-chain ad+referral platform (no income guarantee, crypto
  risk, rehearsal note, privacy of email/wallet/profile, acceptable use).
- renderNav now appends a persistent footer with legal + site links on every
  public page; member-area sidebar gets a Legal link group.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-07 09:38:08 -05:00
martbost 8e089070dc Recolor achievement badges: Surge purple, Circuit red starburst, Nexus navy
New kie.ai art per Marty's palette — Surge dark neon purple, Circuit bright red
starburst, Nexus navy-blue gradient (Spark stays mint). Full-bleed dark, ornate,
blank ribbon; ribbonY re-tuned per badge; ?v=2 cache-bust on the badge images.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-07 09:03:45 -05:00
martbost ae580b966c 125x125 sidebar banner (sized ad serving) + shorts report link
- New 125x125 "square button" banner size; ad serve now filters by width/height,
  and the sidebar slot serves a 125x125 banner (empty until such inventory exists).
- Shorts reel gets a "report this short" link (posts to /api/report-ad).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-07 08:47:17 -05:00
martbost 31a6560e9e Training center: new members-area pane for videos + materials
New "Training" nav pane lists curated lessons (inline video for mp4/webm, links
for external videos and docs) from /api/training (admin-curated via
data/training.json, with a sensible default).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-07 08:41:26 -05:00
martbost 0dbd99f69e Wall page: mint QR, achievement badge, admin-ad backfill, join gated on views
- QR is mint-green (still high-contrast for reliable scanning).
- The wall shows the owner's achievement badge next to their avatar.
- Positions 2 & 3 fill with upline line-banners, then ADMIN ADS when there's no
  upline (configurable via data/admin-wall-ads.json; sensible default) so the
  wall is never sparse.
- "Join free through this wall" is disabled until the visitor has viewed every
  ad on the wall, with a "X/Y viewed" prompt.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-07 08:35:44 -05:00
martbost a4119d652d Sponsor shown on sign-in + new-member onboarding (username, optional profile)
- Sign-in page shows "You're joining the line of @X" when arriving via a sponsor
  link (/api/sponsor now returns the sponsor name + avatar).
- After a new account verifies (or signs up) with no username yet, an onboarding
  modal prompts for a username and an optional bio (both skippable), before the
  welcome tour.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-07 08:29:12 -05:00
martbost 4a9e4c789e Daily login bonus (streak) + solo-ad budget default
- Daily login bonus: once/day, base 5 credits + gentle streak (+1/day, cap +5)
  for consecutive days; granted after sign-in, toast + cha-ching. New
  login_day/login_streak on earned_credits; /api/my/login-bonus.
- Solo ad: selecting Solo now defaults Budget to 50 credits (5cr x 10 min
  deliveries) so entering 10 isn't rejected after submit.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-07 08:19:40 -05:00
martbost a8968041dc Email notifications (welcome + payout + passed-up) and net->network label
- Welcome email on new account: onboarding steps + who their sponsor is.
- On-chain event emails: a payout received (TierPaid/AwardPaid) and a payout
  that passed you by unqualified (PassedUp), wired into the chain event stream.
- Campaign stats: "+N net" relabeled to "+N network" (clearer than "net").

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-07 08:15:28 -05:00
martbost 19b7770a4d Video once-per-day dedup + featured gold border & spacing
- Video watch-to-earn: a member can no longer re-earn from the same video the
  same day. New video_seen table (dual-mode); serveVideo excludes today's
  already-watched videos; videowatch double-checks before crediting.
- Featured card: equal top/bottom margin (no longer touches the stat cards) and
  a gold border on the card + the rotating link.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-07 08:13:09 -05:00
martbost 3a6d9d037c Ad-report admin recipient via ADMIN_EMAIL env only (siteConfig is public)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-07 07:59:26 -05:00
martbost 4991fe96e8 Ad reporting + featured rotates one link + clear campaign form on submit
- Ad reporting (auto-approved ads need a safety valve): new reports.js store
  (dual-mode) + ad_reports table + POST /api/report-ad; a "⚠ report" control on
  served ad slots opens a reason prompt and notifies the admin by email
  (siteConfig.adminEmail / ADMIN_EMAIL).
- Featured links now show ONE link at a time and cycle (true rotation), instead
  of listing all links at once.
- Campaign form now clears EVERY field on submit (target/creative/title/etc.).
  A leftover target URL was carrying into the next campaign — the same reason a
  video short was saved with the wrong (massifly) CTA target.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-07 07:57:12 -05:00
martbost 958bd5ac20 Live members-area updates: SSE toasts + cha-ching/pop sounds, no refresh needed
- The members area subscribes to the chain event stream (/api/feed/live) and
  reacts to anything relevant to the member: a payout received (cha-ching + toast
  + auto-refresh), a referral qualifying, a passed-up payout (missed), a settled
  purchase, a new activation in the line. No page refresh required.
- New chat message -> "pop" sound + toast + badge; ping heartbeat (20s) now
  returns chatUnread and pops on an increase.
- Sounds are synthesized via Web Audio (no asset files, CSP-safe).
- Surge badge: nudge the name down (ribbonY .779 -> .805) to center on its ribbon.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-07 07:36:47 -05:00
martbost 1363bd7b0b Fix: buy links wallet first; achievement milestones use live buyerCount
- Buying now ensures the wallet is LINKED to the account before the purchase
  (one signature if not linked). Without it, a wallet only connected for the
  faucet bought successfully but credits resolved against member id 0 and never
  showed until a manual link. Matches the "buying links your wallet" promise.
- Dashboard computed achievement milestones from buyerCount BEFORE reading it
  from chain (always 0), so Surge/Circuit/Nexus never unlocked even when
  qualification advanced. Moved the milestone block after the chain read.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-07 07:24:26 -05:00
martbost 204aa6a723 Rehearsal faucet: self-serve test-POL so members can actually buy
Fresh wallets hold 0 POL on the rehearsal chain, so nobody could complete a buy.
- Oracle: the mock POL/USD feed had gone ~49h stale (quoteWei reverted "Stale
  oracle" -> catalog costWei null -> packages showed "paused"). Refreshed it and
  installed a 15-min heartbeat cron so it stays fresh; quotes now return.
- New /api/my/faucet (rehearsal-only, rate-limited) tops a connected wallet up to
  10 test-POL via anvil_setBalance (no key). "Get test POL" card in the Wallet
  pane wires it. Members can now fund, buy, and see payouts move on the ledger.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-07 07:02:48 -05:00
martbost 41d3293486 Fix referral attribution (username joins) + broadcast rate-limit regression
- Dashboard "Your line" roster now matches referrals joined under the member's
  USERNAME link (invite link is /join/<username>), not just code + member id —
  username joins were invisible.
- lastBroadcastAt now counts only kind='broadcast'. Chat rides the same table,
  so chatting had been tripping the once-a-day broadcast limit ("try again in
  24h" on the first broadcast).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-07 06:38:27 -05:00
martbost 5b1a60f653 Fix profile persistence + badge ribbon alignment; 24h sessions
- BUG: /api/me never returned avatarUrl/bio/socials/lineBanner fields, so the
  Profile pane repopulated empty on reload — data WAS saved, just not surfaced.
  Now returned so avatar, bio, and social links persist visibly.
- Achievement badge: member name drops the "@" and sits on a per-badge ribbonY
  (spark .728 / surge .779 / circuit .713 / nexus .709), gold with dark outline.
- Sessions now expire in 24h (was 30d) so members re-login daily and see the
  login ad each day.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-07 06:13:19 -05:00
martbost a634f83a8e Shorts = portrait-only reel; Watch videos = landscape; badge name in gold
- Videos now carry client-detected pixel dimensions (videoW/videoH) captured at
  campaign create (upload or direct link). serveVideo takes an orientation filter:
  Shorts reel (/shorts) serves portrait (height>width); the Watch videos tab
  serves landscape, including legacy/unknown-dimension videos so nothing is orphaned.
- shorts.js requests the portrait feed and has a client guard that skips any
  landscape video that slips through. Create form shows the detected orientation.
- Achievement badge share image: member name now renders in gold with a dark
  outline (was low-contrast dark ink) and sits centered on the ribbon.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-07 05:41:17 -05:00
martbost ade0a13064 Sponsor Chat: two-way member<->sponsor messaging (presence, availability, mute)
Evolves the one-way broadcast into real support threads, keeping broadcast alongside.
- messages.js: kind='chat' rides sponsor_messages; sendChat/thread/threadList/
  markChatRead/chatUnread; broadcast inbox + login modal scoped to kind='broadcast'
- accounts.js: presence (last_seen), chat availability toggle, per-member mutes;
  sponsorOf() + isDownlineOf() resolvers
- server.js: /api/my/chat/{send,thread,threads,available,mute} + /api/my/ping
  heartbeat; dashboard emits chatUnread/chatAvailable/sponsor; auth = direct
  sponsor up, any downline down, or an existing thread; email only when offline
  and not mid-chat
- my.html/my.js/site.css: slide-in chat drawer (threads list + live thread,
  4s poll), presence dot, Message buttons on direct rows, Message-my-sponsor
  quick action, availability switch in Profile
- db.js: additive migrations (kind, pair index, chat_available, chat_mutes)
- chatbot.js: canned answer + AI fact for Sponsor Chat

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-07 05:24:23 -05:00
martbost 3c0e94f20f Badge emblems, profile social links, and SEO/OG social previews
- Achievement badge share-image now draws a milestone emblem (⚡🎯⭐🏆) in the medal
- Profile: Facebook/X/YouTube/Instagram/TikTok/Telegram/LinkedIn/Website links, shown on the public bio page
- OG + Twitter Card tags on homepage/ledger/contract (hero banner as share image)
- Per-member OG tags server-injected into /wall/<username> so shared bio links preview with name/bio/avatar
- robots.txt + sitemap.xml; .txt/.xml MIME types

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-09-06 12:21:53 -05:00
martbost 2f27038297 DO Spaces enabled: namespace IAP video uploads under iap-uploads/ in the shared media bucket
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-09-06 09:51:43 -05:00
martbost 537e7352d4 DO Spaces adapter (feature-flagged): route video uploads to object storage off the volume
- spaces.js: zero-dep SigV4 PUT to DO Spaces, public-read; inert unless DO_SPACES_* env is set
- /api/my/upload sends video to Spaces when configured, falls back to volume otherwise
- Images stay local; Spaces URLs are https so they pass the video/media validators + CSP

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-09-06 09:24:48 -05:00
martbost cb2542fca5 Verified visits (7th ad format): guaranteed unique human-visit packs
- Buy N verified visits flat up-front; each is a distinct member, dwell + captcha verified
- Verified visits earn sub-tab: open site (new tab), dwell, human-check, earn
- Per-viewer dedup (visit_seen unique), daily cap, completes at N; single-use tokens

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-09-06 09:21:59 -05:00
martbost f30a462ca8 Featured rotation -> day-slot booking: 10 slots/day, pick your start day, live occupancy
- Per-day occupancy shown in composer (Today 1/10, Tomorrow 2/10, …), full days unpickable
- Book a specific start day + duration; every covered day must have an open slot
- Slot cap turns dilution disclosure into a hard ceiling; featured skips frame-check (new-tab)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-09-06 09:16:24 -05:00