EMmind MTL repository map
This evidence snapshot was rechecked on 2026-08-25 against the committed remote refs below. The local worktrees contain additional changes and trail these refs by one, four, and three commits respectively. Re-check the intended branch and release tag before changing or deploying code.
Application repositories
| Repository | Evidence ref | Commit anchor | Purpose |
|---|---|---|---|
cbt-core | origin/dev | 99afedaa5f74 | NestJS API, PostgreSQL entities and migrations, LINE webhook and messaging logic, Google OAuth account linking and verification-expiry checks, Redis state, S3 upload URLs, scheduled reminders, and admin APIs. |
cbt-webapp | origin/main | 550a3bb64a00 | Employee-facing Remix and LINE LIFF application for onboarding, 9Q, CBT content, journals, activities, safety plans, urgent support, and settings. |
cbt-cmsapp | origin/dev | ae02c19aaea8 | React Router admin application for user and therapy-data views. |
The repository names use cbt, while the buildspec image names use emmind. Preserve both names when tracing the source deployment contracts.
Fork provenance and edition boundary
The three Aimet repositories were imported from the Studio Twist public EMmind repositories on 2026-02-25:
| Repository | Imported root commit | Root message | Original public source |
|---|---|---|---|
cbt-core | 5dfda5f | forked from studiotwist/cbt-core | https://github.com/studiotwist/cbt-core |
cbt-webapp | c1b52e3 | forked from studiotwist/cbt-webapp | https://github.com/studiotwist/cbt-webapp |
cbt-cmsapp | 81ec526 | forked from studiotwist/cbt-cmsapp | https://github.com/studiotwist/cbt-cmsapp |
These are snapshot imports, not GitHub-native forks. Each imported commit is a root commit with no parent, so Aimet Git history does not retain the exact Studio Twist commit used to create the snapshot. The public CodeBuild projects still name the Studio Twist repositories as their source. Public core and CMS builds continued after the import, which means the imported roots are a shared baseline rather than a copy of the current public edition.
Use the imported root commits for public-versus-MTL source comparison. Use the current Aimet evidence refs above for MTL behavior. Do not treat later MTL changes as public behavior unless the public source or runtime supplies separate evidence.
Supporting product artifacts
The checked-out emmind workspace also contains product assets outside the three application repositories:
| Workspace path | Repository copy | Purpose |
|---|---|---|
emmind/rich messages | No owning repository identified | Greeting and rich-menu artwork for the LINE Official Account |
emmind/question_export/question_202603061622.csv | Identical to cbt-core/src/migrations/question_202603061622.csv | Exported situation and emotion question content with optional image references to the public cbtapp-usercontent-dev bucket |
These folders are important handover inputs. Repository ownership was identified for the question export but not for the standalone LINE artwork. See the design and content directory for the full asset map.
API specifications
cbt-core/docs/api contains request collections:
| Collection | Formats | Scope |
|---|---|---|
| Authentication | Bruno and Postman | CMS email login and LINE login/deauthorization. |
| App API | Bruno and Postman | LINE user, 9Q, journal, activity, question, safety-plan, satisfaction, sentiment, storage, and progress routes. |
| Admin API | Bruno and Postman | Admin user, journal, activity, question, safety-plan, satisfaction, sentiment, survey, quiz, and progress routes. |
Open the directories ending in API as Bruno collections. Treat the TypeScript controllers as the final source of truth when a collection and implementation differ.
Cross-repository calls
| Flow | Repositories |
|---|---|
| LINE authentication | cbt-webapp resource route -> cbt-core /line/auth -> LINE token verification API |
| Google account verification | cbt-webapp -> cbt-core /google/* -> Google OAuth token endpoint |
| Employee therapy activity | cbt-webapp loaders and actions -> cbt-core /line/*; core stores durable therapy data in PostgreSQL and uses Redis, S3, or LINE Messaging in the flows that require them |
| Admin authentication | cbt-cmsapp -> cbt-core /auth/login and /users/me |
| Admin data views | cbt-cmsapp -> cbt-core /admin/* -> PostgreSQL |
| Reminders | Activity and 9Q jobs read PostgreSQL notification records before LINE push; sentiment jobs query user reminder state directly; messages include LIFF links when an in-app action is available |
Source ownership by topic
| Topic | Primary source |
|---|---|
| 9Q questions, result text, and CTA behavior | cbt-webapp/app/routes/liff.quiz._index.tsx |
| CBT paths and lesson order | cbt-webapp/app/components/data/EmotionsData.tsx and LIFF lesson routes |
| LINE conversation state and keyword replies | cbt-core/src/line/services/line.service.ts |
| Progress completion rules | cbt-core/src/bizs/services/path-skill.service.ts plus sentiment, survey-form, and plan-activity services |
| Reminder schedules and LINE notification text | cbt-core/src/commands and src/notifications |
| Durable data model | cbt-core/src/**/entities and src/migrations |
| CMS navigation and API reads | cbt-cmsapp/app/routes.ts, app/components/configurations/MenuConfigs.tsx, and app/core |
| Employee visual assets and fonts | cbt-webapp/public/images, public/svg, and public/fonts |
| Employee product copy and taxonomies | cbt-webapp/app/routes, app/components/data, and public/locales |
| CMS artwork and localized labels | cbt-cmsapp/public/images, app/locales, and public/locales |
| LINE greeting and rich-menu exports | emmind/rich messages |
| Situation and emotion question export | cbt-core/src/migrations/question_202603061622.csv and the identical emmind/question_export/question_202603061622.csv copy |
| Build and deployment request behavior | Each repository's buildspec.yml and .github/workflows/deploy.yml |