THUMOS ADMIN
THUMOS ADMIN
Overview Members Squads Cycles Courses Manual
Quick Actions
Open Editor Stripe Dashboard
All Members
NameEmailPlanSquadStreakRankStatusActions
Squads
Cycles
#StartEndStatusWinnerActions
Manual
Overview
Telegram Bot
Scoring & Ranks
Infrastructure

System Manual

How It All Works

THUMOS runs on one Cloudflare Worker (thumos-api) + one D1 database (thumos-db). Every page, bot, and admin tool reads from and writes to the same database. There is one source of truth.

The Member Journey

  1. Discovery — they land on thumos.academy
  2. Payment — checkout sends them to Stripe ($1,997 or 3x$699). OR they use an invite link (free)
  3. Account Created — Stripe webhook fires → Worker creates user in D1 → welcome email sent with login credentials
  4. Login — they log in at thumos.academy/login with email + password from their welcome email
  5. Onboarding — 3 steps: sign the commitment, set milestones with an AI prompt (body/women/money), write first gratitude post
  6. Telegram Link — "Join Squad" button opens a bot DM that auto-links their Telegram to their account
  7. Join Groups — they join their squad group + THUMOS main group on Telegram
  8. Daily Life — every weekday they post Action: what I did + Grateful: one thing in their squad. Bot detects it, records it, shows their streak
  9. Courses — watch videos on thumos.academy/courses, mark lessons complete, progress tracked
  10. Cycle End — after 30 days, declare milestones hit/miss. Winning squad gets a private call with Sam

Post Detection

The Telegram bot watches for messages that have Action: AND Grateful: at the start of a line. Both required. One post per weekday — duplicates silently ignored. Weekend posts are recorded but don't count toward score.

Streak = consecutive weekdays posted. Weekends don't break it. Miss a weekday → streak resets to 0.

Scoring System

Personal score per cycle = (posts ÷ weekdays × 50) + (milestones hit ÷ 3 × 50) = max 100 per cycle

Squad score = same formula but aggregated across all squad members, percentage-based

Cumulative score persists across cycles and determines rank.

RankPointsTypical Timeline
Initiate0-1990-3 months
Journeyman200-4993-6 months
Adept500+8-12 months

Cycles

~30 days per cycle. Leaderboard resets each cycle. Rank persists forever.

Start a cycle → resets all squad scores, creates new cycle record. Old cycle marked "ended".

End a cycle → pick winning squad. They get a private debrief with Sam.

New members mid-cycle: excluded from squad score that cycle.

Milestones

3 per user per cycle: Body, Women, Money. Set during onboarding or cycle start.

Visible to squad immediately. Cannot be changed once submitted.

At cycle end: declare hit or miss. Early completion allows optional new milestone (no extra points).

Automated Systems

SystemWhenWhat
Stripe webhookOn paymentCreates user + sends welcome email
Post detectionEvery message in squadChecks format → records post → responds with 🔥
8pm reminderEvery hour (checks user timezone)If it's 8pm for a user and they haven't posted → bot messages squad
Score recalc5:00 UTC dailyRecalculates all squad scores
Bot auto-linkUser taps deep linkLinks Telegram ID to THUMOS account
Group welcomeUser joins squadBot sends welcome message with post format

Invite Codes

Free members use invite links: thumos.academy/invite?code=FORGEDAY1

CodeSquadFor
FORGEDAY1Squadron LambdaOG fight camp / BDE members
FORGETHETASquadron ThetaSecond group

To add new codes: edit INVITE_CODES in worker.js and redeploy.

Telegram Groups

GroupPurposeInvite
THUMOSAll members + Sam. Topics enabled.Link
Squadron Lambda (Λ)First squadLink
Squadron Theta (Θ)Second squadLink

Bot: @ThumosAI

Infrastructure

ComponentServiceURL
APICloudflare Workerthumos-api.q-2f4.workers.dev
DatabaseCloudflare D1thumos-db
Main siteCloudflare Pagesthumos.academy
EditorCloudflare Pageseditor.thumos.academy
AdminCloudflare Pagesadmin.thumos.academy
VideosCloudflare StreamStream IDs in D1
PaymentsStripeProduct: prod_UILptFYD8wxzKO
EmailResend[email protected]
BotTelegram@ThumosAI

7-Day Guarantee

Not a trial. Full access from day 1. If they do the work (daily posts, course engagement) and it's not for them after 7 days, full refund. Manual process — review and process through Stripe dashboard.

Deploy Commands

# Deploy API (Worker)
cd selene/markets/thumos/deploy_api && npx wrangler deploy

# Deploy main site
npx wrangler pages deploy "selene/markets/thumos/deploy_main" --project-name=thumos-academy --commit-dirty=true

# Deploy editor
npx wrangler pages deploy "selene/markets/thumos/deploy_editor" --project-name=thumos-editor --commit-dirty=true

# Deploy admin
npx wrangler pages deploy "selene/markets/thumos/deploy_admin" --project-name=thumos-admin --commit-dirty=true

# Or: git push (auto-deploys main site)

Telegram Bot

What It Is

@ThumosAI is a Cloudflare Worker-powered bot. It has no separate server — it runs on the same thumos-api Worker as everything else. Telegram sends messages to /telegram endpoint via webhook.

How Post Detection Works

  1. Member posts a message in their squad Telegram group
  2. Telegram sends the message to our Worker webhook
  3. Worker checks: does the message have Action: AND Grateful: at the start of a line?
  4. If yes → look up the user by their Telegram ID in D1
  5. Check if they already posted today (UTC date) → if yes, silently ignore
  6. Record the post in daily_posts table (who, when, which squad, weekday/weekend)
  7. Calculate their new streak (consecutive weekdays with posts)
  8. Bot responds in the group: 🔥 username — Day X

Important: The bot NEVER stores message content. Only records that a post happened and when.

Post Format Rules

RequirementDetail
Both fields requiredAction: AND Grateful: — both must be present
Start of lineMust be at the beginning of a line, not mid-sentence
Colon requiredAction: works. Action test does not.
Case insensitiveaction: and ACTION: both work
One per dayFirst valid post counts. Duplicates silently ignored.
WeekendsRecorded but not counted toward score. Don't break streaks.

Streak Rules

Streak = consecutive weekdays with a recorded post. Counted backwards from today.

  • Post Mon-Fri → streak goes up
  • Miss a weekday → streak resets to 0
  • Saturday/Sunday → ignored (don't help, don't hurt)
  • Post on weekend → recorded but streak doesn't increase

8pm Reminder

A cron job runs every hour. For each active member, it checks: "Is it 8pm in their timezone?" If yes and they haven't posted today, the bot messages their squad group: [name] hasn't posted today.

Timezone is stored per user in D1 (detected from browser on signup). Default: America/New_York.

Known issue: If the Worker is redeployed while messages are in-flight, Telegram may mark them as delivered but the Worker didn't process them. Posts are lost — Telegram won't retry.

Account Linking

Members need their Telegram account linked to their THUMOS account for posts to be tracked.

Automatic (onboarding): "Join Squad" button on the onboarding completion screen is a deep link: https://t.me/ThumosAI?start=LINK_{userId}. When they tap it, the bot auto-links their Telegram ID.

Manual: In a DM or group, send /link [email protected]. Bot looks up the email in D1 and links the Telegram ID.

Admin: Directly update D1: UPDATE users SET telegram_user_id='...' WHERE email='...'

Bot Commands

CommandWhereWhat
/startDMWelcome message with post format
/start LINK_XDMAuto-link Telegram to THUMOS account (X = user ID)
/link emailDM or groupManual link by email
/streakGroupShow your streak
/leaderboardGroupShow squad rankings
/chatidAnywhereShow chat ID (debug)

Group Welcome

When a new member joins a registered squad group, the bot automatically sends a welcome message with their name and the daily post format.

Groups

GroupChat IDPurpose
THUMOS-1003912158998Main group — all members + Sam. Topics enabled.
Squadron Lambda (Λ)-1003992128318First squad
Squadron Theta (Θ)-1003673790148Second squad

To add a new squad: create Telegram group → add @ThumosAI as admin → use /chatid to get the ID → add squad in Admin panel or D1.

Troubleshooting

ProblemCauseFix
Bot doesn't respond to postsWorker was redeployed while messages in-flightPost again — next message will work
Member posts but no 🔥Telegram ID not linkedDM bot: /link email
Already posted but shows 0dDuplicate check blocked (curl test or timezone mismatch)Check D1 for existing today post
Wrong timezone reminderUser timezone not setUpdate in D1: UPDATE users SET timezone='...'
Bot not receiving messages at allWebhook deregisteredVisit thumos-api.q-2f4.workers.dev/telegram/setup

Scoring & Ranks

Personal Score (per cycle)

(posts ÷ weekdays × 50) + (milestones_hit ÷ 3 × 50) = max 100

Example: 18 posts out of 22 weekdays = 40.9 pts. Hit 2 of 3 milestones = 33.3 pts. Total = 74.2 pts.

Squad Score (per cycle)

Same formula but aggregated across all squad members. Percentage-based so squad size doesn't matter.

Stored in squads.cycle_total_score. Recalculated nightly at midnight UTC.

Cumulative Score

Personal score carries over between cycles. Stored in users.cumulative_score. Determines rank.

Ranks

RankPointsTimeline
Initiate0-1990-3 months
Journeyman200-4993-6 months
Adept500+8-12 months

Rank persists forever. Leaderboard resets each cycle.

Cycles

  • ~30 days per cycle
  • Start: squad scores reset, new cycle record created
  • End: pick winning squad → private debrief with Sam
  • New members mid-cycle: excluded from squad score

Milestones

  • 3 per user per cycle: Body, Women, Money
  • Set during onboarding or cycle start
  • Visible to squad. Cannot be changed.
  • Declare hit/miss at cycle end

Infrastructure

Architecture

Everything runs on Cloudflare. One Worker (thumos-api) handles all API requests. One D1 database (thumos-db) stores all data. Three Pages projects serve the websites.

Services

ComponentServiceURL/ID
APICloudflare Workerthumos-api.q-2f4.workers.dev
DatabaseCloudflare D1thumos-db (c90051c3...)
Main siteCloudflare Pagesthumos.academy
EditorCloudflare Pageseditor.thumos.academy
AdminCloudflare Pagesadmin.thumos.academy
VideosCloudflare StreamStream IDs in D1 lessons table
PaymentsStripeprod_UILptFYD8wxzKO
EmailResend[email protected]
BotTelegram@ThumosAI

D1 Tables

TableWhatKey Fields
usersMembersemail, plan, squad_id, rank, telegram_user_id, timezone
sessionsAuth tokensuser_id, token, expires_at
squadsSquadronsname, telegram_group_id, cycle scores
daily_postsPost trackinguser_id, squad_id, posted_at, counted
milestonesUser goalsuser_id, cycle_id, realm, text, declared_hit
cycles30-day roundsstart_date, end_date, status, winning_squad_id
progressCourse completionuser_id, course_slug, lesson_id
courses10 coursestitle, realm, status, thumbnail
lessons287 lessonstitle, stream_id, description, transcript, flags
lesson_flagsAudit flagsflag_type, resolved, resolved_by

Deploy Commands

# API (Worker)
cd selene/markets/thumos/deploy_api && npx wrangler deploy

# Main site
npx wrangler pages deploy "selene/markets/thumos/deploy_main" --project-name=thumos-academy --commit-dirty=true

# Editor
npx wrangler pages deploy "selene/markets/thumos/deploy_editor" --project-name=thumos-editor --commit-dirty=true

# Admin
npx wrangler pages deploy "selene/markets/thumos/deploy_admin" --project-name=thumos-admin --commit-dirty=true

# Or: git push (auto-deploys main site)

Worker Secrets

Set via npx wrangler secret put NAME from deploy_api/:

  • STRIPE_SECRET_KEY
  • STRIPE_WEBHOOK_SECRET
  • RESEND_API_KEY
  • TELEGRAM_BOT_TOKEN
Course Health
CourseLessonsRed FlagsOrangeResolved