Everything built so far for the EM trainers programme: what each piece does, where it runs, which screens work for EM, and the full 54-day lesson course. Checked read-only against the live server today.
EP's Trainer Command Center rebuilt for English Mithra, with its own lesson-sending engine instead of n8n. This is the current system.
emtcc.srv1544679.hstgr.cloud/root/EMTrainerCommandCenter (2 commits)Planned: chats, WhatsApp numbers and the automation builder, with the lessons sent by automations. TCC stays as the dashboard beside it.
/root/EMTrainersGrowth, unchangedThe first EM Trainers build: a full ForgeChat/ForgeCRM clone with a Lessons tab. It has no students, chats or WhatsApp number.
emtrainers.srv1544679.hstgr.cloud/root/EMTrainersForgeCRMNothing has been sent to any student yet. The engine is switched on, but its only run (6 Oct) stopped with "no bot number registered".
A student who never taps moves to follow_up_sent. Every step is written to the student's day log (waiting_start, follow_up_sent, waiting_completed); manual sends from the dashboard log completed. After Day 54 the student gets the completion message.
About 1,400 lines that replace EP's n8n workflows. EM runs with no n8n, NocoBase or NocoDB.
| Part | File | What it does |
|---|---|---|
| Daily send | cron.js | Checks every minute and runs once per date at or after the send time. It only claims the day when a bot number and template exist, so finishing setup later the same day still sends. It sends follow-ups first, then today's templates. A student with no weekday trainer is skipped. |
| WhatsApp receiver | webhook.js | Meta webhook at /api/engine/meta-webhook. Saves every incoming and outgoing message, delivery status and trainer-phone echo, downloads incoming voice notes and images, and starts the lesson on a Start tap. |
| Lesson delivery | lesson.js | Sends a day's lesson parts in order, reuses a WhatsApp media upload for 29 days and re-uploads from storage when it expires, then sends the trainer footer and, on the last day, the completion message. |
| Dashboard buttons | hooks.js | Stands in for every n8n webhook TCC used to call: reply, audio-reply, media, send-class (Send Today's Class), send-days (Bulk Classes), lessons-send (Lessons button), bulk-text, bulk-template, lesson-media-sync. EP-only actions answer "This action is not available on EM". Protected by a secret key in the address. |
| Setup API | admin.js | Admin-only: status, settings, WhatsApp numbers, trainers, enrolment, "run today's send now". |
| Settings & numbers | store.js | Saves settings, and stores WhatsApp tokens encrypted (AES-256-GCM). Keeps the "Lessons Bot" chat section pointed at the registered bot number. |
| WhatsApp client · chat log | wa.js · chat.js | Sends text, templates and media, uploads and downloads files. Bot chats and trainer chats are kept in separate tables, as in EP. |
| Setting | Value now |
|---|---|
| Engine | On |
| Daily send time | 08:00 IST |
| No classes on | Sunday |
| Day template | em_day_test in language ml. This looks like a test name; Meta approval not checked. |
| Any reply starts the lesson | On |
| Trainer footer | Default text with Morning (9 AM–4 PM), Evening (4 PM–11 PM) and Night (11 PM–9 AM) lines |
| Completion message | "You have completed the course. Congratulations! 🎉" |
Tested: a 26-check end-to-end test (tests/em-engine-e2e.js) runs against a fake WhatsApp and cleans up after itself. It passed 26/26 on 6 Oct: daily send, Start tap delivering Day 1 (22 messages plus footer), order and statuses, second tap ignored, next-day move, the reminder ladder, trainer chats and every dashboard button.
Template name and language, daily send time, days with no classes, trainer footer text, completion message, engine on/off, "any reply starts the lesson", Save, and Run today's send now.
Add the bot number (sends classes) and trainer numbers (WhatsApp Business app with coexistence). Shows the Meta webhook address and verify token to copy into Meta.
Name, WhatsApp number, shift (Morning/Evening/Night), working days (Sunday puts them in the Sunday pool), status. Shows each trainer's weekday and Sunday student counts.
Paste "Name, Mobile, Class mobile" one per line and choose a start day. Each student gets the least-busy active trainer per shift plus Sunday trainers. Duplicates are refused.
Other EM changes: English Mithra logo and name, EP staff logins removed (one admin is created from server settings), trainers log in with their WhatsApp number plus one shared password, lesson audio plays with seeking, EP's Tamil/Telugu/Kannada and "Both GS" items hidden.
| Item | What it does | On EM |
|---|---|---|
| Trainer Chats | Chats on the trainers' own WhatsApp numbers: trainer list, then students, then messages | After trainer numbers are connected |
| Lessons Bot | Chats with the bot number: lessons sent, Start taps, replies | After the bot number is added |
| Bulk Message | Filter students, send a template or free text | Yes |
| Inside a chat | Reply, voice note, play media, and the buttons Lessons, Send Today's Class, Bulk Classes, Custom | Yes |
| Student profile | Details, assigned trainers, lesson day and state (edit, stop, resume), engagement, training time | Yes; EP's Speaking and 999 parts stay empty |
| Page | What it shows | On EM |
|---|---|---|
| Performance | Trainer ranking: students attended, reply time in and outside shift, chat time, rating; daily heatmaps; click through to a student's chat | Yes, once trainers chat with students |
| Ratings | Student ratings of trainers | Stays empty: EP's rating form is not part of EM |
| Progress | How many students are on each day, dropout points | Yes |
| Directory | Searchable student list with state, day, replies; send class, pause | Yes |
| Finished Students | Completions, time to finish, top trainers; CSV export | Yes (profession breakdown needs sales data EM doesn't have) |
| Silent Students | Students who tap Start but never talk to their trainer | Yes |
| Stopped Students | Paused or stopped students | Partly: payment and team columns come from EP's sales system |
| Start Times | When students tap Start, delay after the template, no-shows | Yes |
| Activity | Trainer shift screenshots and call logs | Only with EP's trainer mobile app |
| Bulk Message | Same as in Chat | Yes |
| Tab | What it does | On EM |
|---|---|---|
| EM Setup | See above | Yes, the main EM page |
| Lesson Resources | Browse and edit the 736 lesson parts, replace a file, pre-upload to WhatsApp | Yes |
| Holidays | Dates with no lessons | Yes |
| Trainer Support | Temporary or permanent swap of the name/number shown in the footer | Yes |
| Users · Trainer Logins | Dashboard logins and roles; the shared trainer password | Yes |
| Rejoin Students | Bulk re-enrolment | No: only accepts EP's course IDs |
| Class Note · Speaking Intimation · Revision Meet · Revision Report | EP's Tamil/Telugu message texts | No effect on EM |
| Requests Report | Messages per bot number | Uses EP's fixed bot list |
| App Usage · MCP Tools · AI | Mobile-app usage, a data connector for Claude, OpenAI analysis settings | Work technically; not set up for EM |
| Role | How | Can do |
|---|---|---|
| Admin | One login, admin, created from the server settings | Everything |
| Viewer / Content (read-only) | Created in Admin → Users | Chat and Dashboard; read-only hides every send button |
| Trainer | WhatsApp number plus the shared trainer password, through the trainer mobile app's API | Only their own students: send class, next day, stop, resume, reply, follow-ups. The mobile app itself is a separate EP product and is not part of this code. |
| Container | Serves | Limits | Memory used |
|---|---|---|---|
emtcc-backend | TCC API + engine | 1.5 CPU · 512 MB | 60 MB |
emtcc-frontend | TCC web app | 0.5 CPU · 128 MB | 8 MB |
emtrainers-minio | Lesson files (shared by old and new) | 1 CPU · no memory cap | 201 MB |
emtrainers-backend / -frontend / -redis | Old ForgeCRM copy | no memory cap | 68 · 8 · 4 MB |
emtccOn the shared supabase-db server, 12 MB, 61 tables in EP's table layout. Only the lessons (736 rows), course, settings and the admin login hold data. ForgeGrowth's tables are not there yet.
MinIO bucket emtrainers-media: 338 files named em_DAY_ORDER_TYPE (328 Ogg voice notes, 120.5 MB, and 10 JPEG images). An older copy with the original recordings sits under lessons/ (about 914 MB).
Kept in /docker/.env under the EMTCC_* names (admin and trainer passwords, keys). WhatsApp tokens will be stored encrypted in the database. None are in git or on this page.
English taught in Malayalam, with English examples. A typical day opens with a "Day N" heading and a quote for the day, alternates explanation text with the trainer's voice notes, and ends with an activity or homework to send to the personal trainer plus a Word of the day.
| Day | Topic and content | Msgs | Text·Audio·Img | Order | Audio min |
|---|---|---|---|---|---|
| 1 | Self-introduction: greetings by time of day (good morning/afternoon/evening/night), saying your name ("Myself X" and "My good name" marked wrong), where you come from, your job, family, hobbies ("I am fond of…"), education, then a demo introduction. Activities: tell your trainer what you find hard about speaking English, and send your own self-introduction. WotD Minute | 22 | 12·10·0 | 22.0 | |
| 2 | Daily-use words: personal pronouns and possessives (I/my/mine, you/your, we/our, he/his, she/her, they/their, this/that). Activity: one sentence per word. WotD Evident | 21 | 11·10·0 | 22.9 | |
| 3 | Sentence formation: Subject + Verb + Object (what a subject, verb and object are). Homework: rearrange jumbled sentences. WotD Forsake | 18 | 10·8·0 | 25.7 | |
| 4 | Daily-use sentences: "Can you please repeat that?", "I'm busy, please call me later", "I hope that…", "How much does it cost?", "I feel…", "Let's…". Activity: a 1-minute voice note on "My best friend". WotD Wrap | 16 | 9·7·0 | 10.5 | |
| 5 | Is / Am / Are (the present form of "to be", which means "ആണ്"). WotD Boon | 17 | 8·9·0 | 21.2 | |
| 6 | Was / Were (past "to be"), including "If I were…" for wishes. WotD Impart | 15 | 8·7·0 | 10.9 | |
| 7 | Has / Have / Had: owning things, events, and use in place of eat/drink ("We have lunch"). WotD Borrow | 17 | 11·6·0 | 16.4 | |
| 8 | Do / Does / Don't / Doesn't: habits ("ചെയ്യാറുണ്ട്", "does it usually"), negatives and questions. Reading story "Farmer and his wife". WotD Insist | 21 | 11·10·0 | 28.1 | |
| 9 | Did / Didn't: past action, negatives and questions ("Did you read the paper?"). WotD Concern | 15 | 8·7·0 | 15.8 | |
| 10 | Everyday Malayalam-to-English patterns: "Do/Does + like" (do you like?), "could" (was able to), "Why did…", "Don't you…?", "have to/has to". WotD Grief | 19 | 10·9·0 | 23.8 | |
| 11 | Polite requests: can, could, may, will, would (formal versus casual). Homework: real-life role-play situations, such as asking for a seat on a bus. WotD Cautious | 19 | 10·9·0 | 18.8 | |
| 12 | Simple present tense: format, habits, universal truths, likes and dislikes, fixed future events. WotD Abide | 19 | 10·9·0 | 29.4 | |
| 13 | Simple past tense (Subject + V2 + Object), plus 5 English Mithra verb charts (Malayalam word, then V1 / V2 / V3 / V+ing). WotD Issue | 18 | 7·6·5 | 13.1 | |
| 14 | Simple future tense (will/shall + V1). WotD Aide | 11 | 6·5·0 | 16.6 | |
| 15 | Prepositions of time: in / on / at. WotD Crave | 16 | 8·8·0 | 17.8 | |
| 16 | Exam 1 (revision): sentences in present/past/future, do/does/did questions and negatives, can/will/may/could/would, is/am/are/was/were/has/have/had | 4 | 2·2·0 | 1.5 | |
| 17 | Prepositions of place: in (inside, country/town, vehicle) / on (surface, floor) / at (a specific point). WotD Describe | 21 | 11·10·0 | 16.5 | |
| 18 | To and For (purpose, duration, direction, receiver). WotD Worst. A second quote comes at the end. | 18 | 10·8·0 | 13.5 | |
| 19 | Present continuous (is/am/are + verb-ing; happening now or longer action in progress). WotD Collide | 14 | 7·7·0 | 19.0 | |
| 20 | Past continuous (was/were + verb-ing). WotD Reputation | 14 | 8·6·0 | 15.9 | |
| 21 | Future continuous (will be + verb-ing). WotD Devout | 12 | 7·5·0 | 10.6 | |
| 22 | Can vs Will (ability versus determination, and as questions). No WotD | 14 | 8·6·0 | 10.6 | |
| 23 | May and Might (permission, uncertainty, small or past possibility). WotD Taint. A second quote comes at the end. | 18 | 10·8·0 | 16.9 | |
| 24 | Email drafting: subject, salutation, body and closing, with a sample annual-leave application. Homework: write a leave email. WotD Salutation | 14 | 7·7·0 | 23.1 | |
| 25 | "No more VERY": replace "very + word" with one stronger word (very simple → basic, very short → brief…). WotD Nap | 12 | 7·5·0 | 11.7 | |
| 26 | "If" sentences (facts, things that might happen). WotD Exaggerate | 12 | 7·5·0 | 13.5 | |
| 27 | Active and passive voice: simple present (am/is/are + V3). WotD Obstacles | 11 | 6·5·0 | 13.1 | |
| 28 | Passive voice: simple past (was/were + V3). WotD Persuade | 8 | 5·3·0 | 9.9 | |
| 29 | Passive voice: simple future (will be + V3). Only sentences with an object can become passive. WotD Frail | 10 | 6·4·0 | 7.5 | |
| 30 | Relative pronouns: who, which, when, where, that. WotD Mystery | 19 | 11·8·0 | 28.2 | |
| 31 | During vs While. WotD Progress | 11 | 6·5·0 | 10.1 | |
| 32 | Exam 2 (text only, no audio): to/for, the 3 continuous tenses, may/might, one-word replacements for "very…", if, during/while, passive conversion | 2 | 2·0·0 | 0.0 | |
| 33 | Phrasal verbs (depend on, do over, …). WotD Yield | 10 | 6·4·0 | 11.4 | |
| 34 | "Find the mistakes" error-spotting exercise ("made a world record", "preferable than", "a good news"…). WotD Impression | 7 | 4·3·0 | 2.7 | |
| 35 | Answers to Day 34's mistakes ("set a world record"…). WotD Abstain | 9 | 4·5·0 | 8.5 | |
| 36 | Countable vs uncountable nouns, plus 5 images listing uncountable nouns (gold, grammar, happiness, information, knowledge…). WotD Infuriate | 17 | 7·5·5 | 13.3 | |
| 37 | For vs Since (a period of time versus a point in time). WotD Dispute | 9 | 6·3·0 | 10.5 | |
| 38 | Commonly confused words: many/much, few/little, farther/further, high/tall. WotD Courtesy | 19 | 10·9·0 | 19.5 | |
| 39 | Common mistakes ("listen to me", "there are seven girls", "at 5 pm", "speak English well", "taller", "made this salad"). WotD Argue | 13 | 7·6·0 | 17.1 | |
| 40 | Ways to say thank you (Thanks a lot, I can't thank you enough, I'm truly grateful, I appreciate it). Reading story "The ant and the dove". WotD Perhaps | 21 | 11·10·0 | 19.0 | |
| 41 | Phrasal verbs (believe in, break down, bring up…). WotD Employ | 15 | 8·7·0 | 15.8 | |
| 42 | Phrasal verbs with "put" (put on, put by, put across…). WotD Accessory | 9 | 5·4·0 | 12.1 | |
| 43 | Have to / Must / Need to / Ought to, and their negatives (don't have to, don't need to). WotD Consistently | 21 | 11·10·0 | 21.3 | |
| 44 | Common mistakes in English ("time by your watch"…). WotD Delight | 9 | 5·4·0 | 11.8 | |
| 45 | "Find the mistakes" in self-introduction sentences ("My good name is…", "I am 30 year old"…). Reading story "Father–Son conversation". WotD Haggle | 11 | 6·5·0 | 11.3 | |
| 46 | Answers to Day 45's mistakes. WotD Attitude | 9 | 4·5·0 | 14.8 | |
| 47 | Adverbs of frequency: always, usually, often, sometimes, seldom… No WotD | 13 | 7·6·0 | 11.6 | |
| 48 | "Used to" (past habits; "didn't use to"; "Did … use to?"; not for the present). No quote, no WotD | 15 | 8·7·0 | 17.0 | |
| 49 | Preposition "from" (origin, source…). WotD Criticize | 11 | 6·5·0 | 10.9 | |
| 50 | JAM (Just A Minute) speaking activity: choose a topic such as "Your mother" or "Your life five years ago". WotD Tribute | 7 | 5·2·0 | 1.5 | |
| 51 | Reported (indirect) speech, introduction: simple present. No quote, no WotD | 7 | 4·3·0 | 10.0 | |
| 52 | Reported speech: simple past (had + V3; time-word changes such as today → that day, yesterday → the day before). No WotD | 13 | 7·6·0 | 25.0 | |
| 53 | Reported speech: simple future (will → would). WotD Coincidence | 11 | 6·5·0 | 9.3 | |
| 54 | Final exam (text only, no audio): have to/ought to/need to/must, "used to", frequency adverbs, convert 5 sentences to reported speech, prepositional phrases with on/at | 2 | 2·0·0 | 0.0 |
| Day | Issue |
|---|---|
| 1 · 35 | Spelling: "painiting", "choclates" |
| 54 | "propositional phrases" should be "prepositional phrases" |
| 49 | Homework says "two sentences" in English but "3 sentences" in Malayalam |
| 37 | The "For" explanation is sent before its own title "Preposition: for and since" |
| 18 · 23 | End with a second "Quote for the day", probably the next day's quote |
| 32 · 54 | No voice notes (text-only exams); Day 16 ends with two voice notes in a row |
| 16, 22, 32, 47, 48, 51, 52, 54 | No Word of the day. Header style also varies ("Day 01", "Day19"). |
Each issue can be fixed in Admin → Lesson Resources. None of the 338 files has been uploaded to WhatsApp yet; that happens on the first real send.
emtcc was blocked twice by the safety check. Run the commands yourself or allow it.emtcc. The old copy stays until you decide.