Commit Graph

32 Commits

Author SHA1 Message Date
martbost e3f6b00f95 Make event pop-up admin-toggleable; drop it from join pages
The Weekly Huddle overlay now reads its content from /api/announce (config-
driven) instead of a baked-in block, and Admin -> Settings -> Event pop-up
exposes a toggle plus editable fields (eyebrow, flyer, join URL, date, times,
auto-hide, event id). Defaults are seeded into config on boot so the panel
reflects real state. Removed the include from join.html so it never interrupts
the join flow.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-08 05:28:03 -05:00
martbost 7e390aa48e Join: let chosen positions default to direct placement
The moving link is team-first by design: it routes a new join to whoever needs
directs next, so the position whose link was actually clicked earns no entry
reward. Measured on #21 that came to 80 joins in seven days and zero entry
rewards, while the traffic paying for those joins was the owner's.

For a position being deliberately built out, that default is backwards. Any ID
listed in the new directDefaultIds config now behaves as ?direct=1 on its own
/join/<id> link - including every promo tool, flyer QR and downline-builder
entry that resolves through it - without needing the parameter appended.

?direct=0 still forces rotation for a single share, so the team-first behaviour
stays available rather than being replaced.

Config rather than hard-coded, and editable from the admin settings form, so
which positions get this can change without a deploy.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-31 10:29:55 -05:00
martbost 439c5885de Admin: give the wide tables the full width
The Sponsor Queue table carries min-width:850px but the 1.6fr side of the
split only handed it about 800px, so the Actions column was clipped — the
Reset button cut in half and the delete button off-screen entirely.

Sponsor Queue and Member ID Submissions now run the full width. Add Sponsor
moves below the queue as a single collapsible row of fields instead of a
narrow two-column form in a sidebar, which is both less tall and no longer
squeezing the table next to it.

The rule this follows: a card holding a .table gets the whole width; only
compact forms share a row. Settings keeps its split — those are all short
forms.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-30 06:23:50 -05:00
martbost 7452490a78 Admin: group the fourteen panels into tabs
The page was a fixed 1.5fr/.75fr split — ten tall panels on the left, four
short config forms on the right. The right column ran out about a quarter of
the way down, so the rest of the page scrolled past an empty gutter, and
finding anything meant scrolling through everything.

Five tabs now, each using the full width: Team (queue, add sponsor, coaching
radar, award capacity, messages), Traffic (conversions, org vs network),
Members (submissions, lookup, matrix), My Money (positions income), Settings
(AI chat, SendGrid, public page).

The panels themselves are untouched — same markup, same ids, same JS. Only
their grouping changed. Panes are moved in the HTML rather than by script, so
the layout does not depend on JS running; the tab file only toggles which
pane is visible and remembers the last one.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-30 06:16:05 -05:00
martbost ee87408dec Admin: move the bonus panel inside the admin view and collapse it
It was sitting between the login panel and #adminView — outside the admin
view entirely, so it rendered above the page header and showed on the login
screen to anyone who loaded /admin.

Now it sits after the Coaching Radar, which is the panel that tells you who
needs a nudge; this is the lever for nudging them. Collapsed by default and
the log is capped at a scrollable 240px, because awarding is occasional and
the log grows every month.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-30 06:11:41 -05:00
martbost 77dcda6a1a Admin: move the bonus panel script out of the page (CSP)
The site sends script-src 'self'. The panel's logic was an inline <script>
block, so the browser refused to run it: window.agBoot was never defined,
admin.js's guarded call did nothing, and the "What" select stayed empty with
no console-visible cause beyond the CSP report.

admin.html had no inline scripts before this panel — the extraction restores
that, so the next person adding a panel copies a pattern that works.

Fourth thing this CSP has silently broken. Inline scripts are not an option
on this site; new panels ship as files.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-30 06:00:37 -05:00
martbost e4b7d64605 Admin: load the bonus panel after login, not before
The panel fetched its tool list on DOMContentLoaded — which fires while the
admin page is still showing the login form. The request 401'd, the handler
returned silently, and the "What" select was left permanently empty with no
path back.

Loads from the same post-login block as the coaching radar and messages
panels now, plus a refetch if the select is opened while still empty.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-30 05:51:26 -05:00
martbost 05afe5c5f6 Admin: award Suite capacity to any member as a team bonus
Marty asked for a way to grant impressions to anybody, labelled as an admin
bonus. Team Grants already did this for leaders, but only within their own
organisation and only out of a level pool.

adminGrant() is deliberately a different thing: it comes from no pool (the
team is not a position and has no allowance), it can reach ANY registered
position rather than only someone downline, and it carries a reason that
survives in the ledger. Recorded with by:0 so nothing downstream mistakes it
for a leader's grant — the member's own page renders those as "the team"
rather than "#0".

The route verifies the position exists on-chain before crediting it; a typo
would otherwise sit in the ledger crediting nobody, and it would be invisible
until someone went looking.

Awards land on top of whatever the level already allows and expire with the
month like every other allowance. The admin page lists what has been awarded
this month, so bonuses stay auditable rather than vanishing once given.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-30 05:40:00 -05:00
martbost 52d678fd23 Official RM Circle logo rollout: header brand mark on all 13 pages (public + private), favicon, circular crop via existing brand-mark styling
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-20 09:34:56 -05:00
martbost 9a1833f2b0 Wallet-verified member messaging (matrix-lines permissions, admin visibility)
- messages.js: challenge/personal_sign/recover auth (vendored pinned
  js-sha3 0.9.3 + noble-secp256k1 1.7.1, server-side only; self-tested
  positive + tamper cases), 30d HttpOnly sessions, message store on the
  volume, matrix-line permissions (your downline direct or broadcast, your
  upline chain - nothing else, so spam is impossible by construction),
  daily rate limits (30 direct / 3 broadcasts), 1500-char plain text
- chain.js: memberIdByAccount (wallet -> position for sign-in)
- API: msg-challenge/-verify/-me/-inbox/-send/-read public + msg-unread
  (count only, no auth) + admin/messages (full visibility, disclosed to
  members in the UI)
- Dashboard: Messages card with unread bell, one-tap wallet sign-in,
  inbox with auto-read, compose with to-ID or whole-team broadcast
- Admin: Member Messages review table
- Chatbot canned answer + AI system prompt updated

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-19 13:31:31 -05:00
martbost a835291eab Coaching Radar: live downline triage in admin + member dashboards
- chain.js getCoachingScan(rootId): classifies everyone below a root into
  atRisk (POL forming they can't catch - corrected bought-level rule),
  rollForward (qualified-at-Scintilla with entry rewards covering Ascensus),
  and oneAway (1/2 directs)
- Admin: GET /api/admin/coaching?root= (name-decorated) + "Coaching Radar"
  panel with tiered who/what-to-say/POL-at-stake rows, auto-loaded
- Member dashboards: memberPublic now returns .coach scoped to the member's
  own leg; new "Coach your team" card shows the same triage so every member
  coaches their own team - computed live, no snapshots or cron needed
- Chatbot canned answer + AI system prompt updated to describe the panel

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-19 05:15:45 -05:00
martbost 9dbe7eddcb Track the join funnel end-to-end through the self-enroll page
- Self-enroll pageviews now tracked as the "joinnow" event (track.js loaded
  on the page; server whitelist + admin tiles/columns extended)
- A confirmed on-chain registration in the wallet-connect flow now auto-posts
  to the submit-id API, so every self-enroll join records a submission with
  source + clickid attribution and fires the purchase event and BeMob postback
  with no manual ID entry
- Optional name/handle field on the join page feeds the submission and the
  team Telegram alert
- Admin Traffic panel: Join-now views tile, Join-now -> Confirmed conversion,
  and a per-source Confirmed column for campaign-level ROI reading

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-18 16:37:09 -05:00
martbost 3a80a50648 Rebrand public site to RM Circle Team Build (remove Crypto Team Build Network)
Public promo is now RM-Circle-only; the Crypto Team Build Network is learned
after joining, not surfaced to prospects.
- nav brand "Crypto Team Build" -> "RM Circle" (subtitle "Premium Team Build")
- all <title>, og:site_name, twitter meta, footers, disclaimers, 404, chatbot
  system prompt + canned answers, config siteName/supportLabel swept
- removed "a project of the Crypto Team Build Network" framing from prose
- banners regenerated: eyebrow now "The RM Circle · Polygon" (was Crypto Team Build)
- og-card.jpg regenerated (was "CRYPTO TEAM BUILD NETWORK PRESENTS")
- roadmap.webp already RM-Circle branded (no change needed)
- social posts/swipes: #CryptoTeamBuild -> #RMCircle, "crypto team build" -> "RM Circle team build"

Videos still reference old branding (VO + embedded site screenshot) — rebuilt next.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-16 06:43:23 -05:00
martbost 9717ddbd85 Admin: payment-routing / leak map for the org
New chain.getOrgRouting(rootId, ownerIds) simulates the contract's
_payUpline routing for every member below the org root on their NEXT
upgrade, classifying where the POL lands: your positions, a teammate
in-org (healthy), an outsider above the org (true LEAK), or fees.
Surfaced on /api/admin/income and rendered as a panel in "My Positions
— Income": 4-stat summary + expandable list of payments escaping the
org. Distinguishes real leaks (money leaving the team) from teammates
earning — which the old upgrade-needs alert conflated.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-15 18:35:48 -05:00
martbost 7b6f629780 Add "Your Organization vs. the Network" live stat to admin
New chain.getOrgShare(rootId) + /api/admin/org-share endpoint compute an
org's share of the whole contract by both member count and total POL
paid, from in-memory state. Admin card (default root 21, saved to
config.orgRootId, auto-loads) shows the two headline percentages, a bar,
and the member/POL breakdown. Verified: #21 org = 51.1% of members,
49.5% of POL.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-15 07:07:27 -05:00
martbost 8b3e82d960 Alert when an owned position needs upgrading to catch incoming pay
New owner upgrade watcher: every 5 min it checks config.ownerIds against
the chain state and, when a leg member is ONE upgrade from paying a
position that isn't eligible yet (below the required level, or not
qualified), emails config.ownerAlertEmail + pings Telegram — "upgrade
#24 to Fabrica, #61 is one upgrade from paying you 2,486 POL." Deduped
per (position, level) in owner-alerts.json, re-fires if the situation
recurs. Same warning renders inline in the admin "My Positions" panel
(upgradeNeeds in the income endpoint). New ownerAlertEmail settings
field. Detection logic unit-tested.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-14 14:27:50 -05:00
martbost 81d90fbe8e Add admin "My Positions — Income" panel
Aggregates every on-chain payment received by a set of owned IDs
(defaults to 21,24,25, saved to config.ownerIds and prefilled/auto-loaded
next time). Shows grand total + per-position totals and a merged,
newest-first ledger (to / from / entry-or-upgrade level / amount) via a
focused chain.getIncome read and an admin-gated /api/admin/income
endpoint. Verified: 5,064.43 POL across 21/24/25, 11 payments.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-14 14:08:21 -05:00
martbost 29e0d6e791 Personal invite pages (/join/<id>) + auto-count queue directs from the chain
Prospects who clicked a member's shared /my link landed on a bare stats
dashboard with no explanation of the program. New /join/<id> page carries the
full bridge-page story (video, strategy, matrix, live on-chain payout proof)
personalized to one sponsor: their live position stats as proof, their ID
pinned on the dApp join button, and the submit-your-ID form locked to them
(source invite-<id>). Dashboard share buttons + QR codes now hand out the
invite page; /my stays the member dashboard. Invalid/unregistered invite ids
fall back to the /start rotation. Tracked as new 'join' event with an admin
traffic column.

Also: the chain indexer now auto-increments a rotation sponsor's directs when
a registration names them as referrer (same op as the admin ⊕), announcing it
on Telegram. At 2/2 it alerts to Qualify instead of auto-rotating — moving
the team focus stays a human decision.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-14 08:18:30 -05:00
martbost 0f5f821b39 Email the admin a copy of every team-build alert
New config teamAlertEmail: the same team-gated on-chain events that post
to Telegram (registration, upgrade, payout at/below teamRootId) also go
to this address via SendGrid, so deep-leg activity surfaces even away
from Telegram.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 13:12:33 -05:00
martbost accd869c12 Default payment-email sender to marketingwithmarty.com
Both marketingwithmarty.com and mybrandedvoice.com are SendGrid
DKIM-authenticated; Marty's sending identity is marketingwithmarty.com,
so the default from and the admin label now reflect that.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 13:10:41 -05:00
martbost e3f07057d9 Send automatic "you've been paid" emails via SendGrid
When the chain tail sees a payout to a member whose sponsor record has a
contact email, the site emails them the amount, source, and Polygonscan
link (plain text — deliverability). SendGrid key is pasted in a new
admin panel (stored in the data volume, like the OpenRouter key) or set
via SENDGRID_API_KEY. From address defaults to no-reply@mybrandedvoice.com
— the domain SendGrid is DKIM-authenticated for — and is editable in the
same panel. Not gated on teamRootId; any member with an email on file.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 13:03:26 -05:00
martbost 6b17419646 Add sponsor contact emails and Telegram team-build activity alerts
Sponsors can carry an optional contact email (Add Sponsor form, ✉ inline
edit in the queue, shown under the name). New config teamRootId: any NEW
on-chain event at or below that member ID — registration, upgrade, or
payout seen by the live tail — posts to the Telegram group topic, with
the tx link and the sponsor's contact email when one is on file.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 12:57:51 -05:00
martbost 1e2b03c795 Render admin matrix as a drill-down pyramid with open slots
Matrix View now defaults to a generation-by-generation pyramid (root + 3
generations of position cards, empty placements shown as dashed open
slots). Clicking a position re-roots the pyramid there; a breadcrumb
navigates back up. The collapsible list stays behind a toggle. Tree
payload now carries explicit left/right children so an only-child lands
on the correct side.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 10:36:36 -05:00
martbost 7c41499312 Add on-chain payment proof: live payout feed, ID verification, admin lineage tools
New chain.js reads the RM Circle contract (0x33Bd…2DAF, Polygon) via free
public RPCs — no API keys. Daily snapshot rebuilds complete payout history
from getIncomeHistory (log providers prune old history), and a 60s
eth_getLogs tail catches new payouts with tx hashes, upgrade context, and
passed-over upline IDs.

- Bridge page: "Live payment proof" feed + timed toast pop-ups for payouts
  seen in the last 15 min, every row linking to Polygonscan.
- /start: same toasts; ID submissions are now verified against the contract
  (result shown to the member, in Telegram notify, and in admin).
- Admin: on-chain member lookup (lineage to root, directs, matrix children,
  full income history) and a collapsible full matrix tree view.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 10:25:07 -05:00
martbost e5eefdfc61 Require name or Telegram handle on member ID submission
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-12 13:57:34 -05:00
martbost 2b40dc70c8 Support posting member submissions to a Telegram forum topic
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-12 13:46:25 -05:00
martbost 89f27b89a2 Close the conversion loop: member ID submission with Hermes Telegram notify
- Start page step 6 is now a bold gold-highlighted "Submit your NEW RM
  Circle ID" form with larger step numbers throughout; captures the
  sponsor the visitor was shown at join time.
- POST /api/public/submit-id: validates numeric ID, dedupes, stores on
  the volume, records a per-source "purchase" analytics event, fires a
  BeMob postback (txid=purchase-<clickid>) to close paid campaigns, and
  posts the new ID + sponsor + source to the configured Telegram chat
  (MB Hermes pattern). Rate-limited.
- Admin: Member ID Submissions table, "Confirmed joins" tile, and
  Telegram bot token / chat ID settings.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-12 13:30:53 -05:00
martbost 63e8b4cdd0 Add paid-traffic tracking: clickid capture and BeMob conversion postback
- track.js stores ?clickid= (or ?cid=) for the session; rides through
  bridge -> start navigation alongside the existing source attribution.
- Join click (the conversion) sends the clickid; server fires a
  fire-and-forget S2S postback to the admin-configured BeMob postback
  URL (cid + txid=join-<clickid>, payout 0) and counts successes per
  source in analytics.
- New admin setting: BeMob postback URL (server-side only, not exposed
  in public config).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-12 11:26:34 -05:00
martbost c1ec687768 Let admins enable AI chat by pasting an OpenRouter key in the admin panel
Key is stored on the persistent volume (0600, never in git), read
dynamically per request, maskable status only in admin state, and
clearable to fall back to built-in answers. OPENROUTER_API_KEY env var
still takes precedence if ever set.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-12 09:17:39 -05:00
martbost ec2091631e Add /training page with four self-hosted walkthrough videos
- Videos loudness-normalized to -16 LUFS (originals were ~-33 LUFS).
- Static file serving rewritten to stream with HTTP Range support so
  video seeking works; .mp4/.webm MIME types added.
- Training nav links on homepage and /start, plus a first-time callout
  on /start; training page views tracked per source in admin analytics.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-12 07:32:59 -05:00
martbost 4115d3a920 Add simple traffic analytics with source attribution and conversion funnel
- track.js captures first-touch source per session (utm_source/src param
  or external referrer domain) and logs bridge/start page views.
- Join clicks now carry the source; all events aggregate per-source in
  data/analytics.json on the persistent volume.
- Admin: new Traffic & Conversions card with funnel totals (bridge ->
  start -> join click rates) and a per-source breakdown table.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-11 08:07:41 -05:00
martbost 76bd288bf6 Initial commit: RM Circle team sponsor router (bridge page, /start, /admin, Docker)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-11 07:04:08 -05:00