Skip to content

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 ​

RepositoryEvidence refCommit anchorPurpose
cbt-coreorigin/dev99afedaa5f74NestJS 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-webapporigin/main550a3bb64a00Employee-facing Remix and LINE LIFF application for onboarding, 9Q, CBT content, journals, activities, safety plans, urgent support, and settings.
cbt-cmsapporigin/devae02c19aaea8React 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:

RepositoryImported root commitRoot messageOriginal public source
cbt-core5dfda5fforked from studiotwist/cbt-corehttps://github.com/studiotwist/cbt-core
cbt-webappc1b52e3forked from studiotwist/cbt-webapphttps://github.com/studiotwist/cbt-webapp
cbt-cmsapp81ec526forked from studiotwist/cbt-cmsapphttps://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 pathRepository copyPurpose
emmind/rich messagesNo owning repository identifiedGreeting and rich-menu artwork for the LINE Official Account
emmind/question_export/question_202603061622.csvIdentical to cbt-core/src/migrations/question_202603061622.csvExported 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:

CollectionFormatsScope
AuthenticationBruno and PostmanCMS email login and LINE login/deauthorization.
App APIBruno and PostmanLINE user, 9Q, journal, activity, question, safety-plan, satisfaction, sentiment, storage, and progress routes.
Admin APIBruno and PostmanAdmin 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 ​

FlowRepositories
LINE authenticationcbt-webapp resource route -> cbt-core /line/auth -> LINE token verification API
Google account verificationcbt-webapp -> cbt-core /google/* -> Google OAuth token endpoint
Employee therapy activitycbt-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 authenticationcbt-cmsapp -> cbt-core /auth/login and /users/me
Admin data viewscbt-cmsapp -> cbt-core /admin/* -> PostgreSQL
RemindersActivity 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 ​

TopicPrimary source
9Q questions, result text, and CTA behaviorcbt-webapp/app/routes/liff.quiz._index.tsx
CBT paths and lesson ordercbt-webapp/app/components/data/EmotionsData.tsx and LIFF lesson routes
LINE conversation state and keyword repliescbt-core/src/line/services/line.service.ts
Progress completion rulescbt-core/src/bizs/services/path-skill.service.ts plus sentiment, survey-form, and plan-activity services
Reminder schedules and LINE notification textcbt-core/src/commands and src/notifications
Durable data modelcbt-core/src/**/entities and src/migrations
CMS navigation and API readscbt-cmsapp/app/routes.ts, app/components/configurations/MenuConfigs.tsx, and app/core
Employee visual assets and fontscbt-webapp/public/images, public/svg, and public/fonts
Employee product copy and taxonomiescbt-webapp/app/routes, app/components/data, and public/locales
CMS artwork and localized labelscbt-cmsapp/public/images, app/locales, and public/locales
LINE greeting and rich-menu exportsemmind/rich messages
Situation and emotion question exportcbt-core/src/migrations/question_202603061622.csv and the identical emmind/question_export/question_202603061622.csv copy
Build and deployment request behaviorEach repository's buildspec.yml and .github/workflows/deploy.yml