Tutorial: ship your first change
By the end of this you’ll have run the broker app locally, made a real change to the leads UI, verified it in the browser, and opened a merge request — the whole loop, on a change that never touches the CRM. Budget ~45 minutes.
Your ticket: The column labels on the My-Deals cards (“Verification Date”, “Phone Number”,
“Destination”, “Deal Status”) are hardcoded English and don’t translate. Make them use t().
It’s real, it’s safe, and you can see it by loading one page.
Prerequisites
Section titled “Prerequisites”- Node
v20.19.2(the repo pins it in.nvmrc; CI builds on Node 22 — match.nvmrclocally). - Yarn 1 (classic).
- Read access to the
frontendrepo, and a broker test account for staging (ask your lead).
1 · Run the broker app
Section titled “1 · Run the broker app”-
Clone and install:
Terminal window git clone <frontend-repo-url> frontend && cd frontendnvm use # picks up .nvmrc → v20.19.2yarn install -
Point the broker app at the staging API. Nx loads the repo-root
.envinto the build — an app-level.envis not picked up here — so copy the root example:Terminal window cp .env.example .env # at the frontend repo rootThe broker vars are already in it; just make sure they point at staging:
Terminal window NX__BROKER_API_ENDPOINT=https://api.orascom.robustastudio.com/apiNX__BROKER_ENDPOINT_PREFIX=/broker -
Start it:
Terminal window yarn start:broker # http://localhost:4201 -
Log in. The broker portal uses email + password. Sign in with your broker test account. If a redirect gets in the way, the reliable shortcut is to log into staging in another tab, copy
localStorage['broker_access_token'], and set the same key onlocalhost:4201— then reload.
2 · Make the change
Section titled “2 · Make the change”Open apps/orascom-broker-app/src/components/deal-card/deal-card.tsx. Around lines 61–81 the labels
are hardcoded strings inside styled paragraphs:
// before<p className={styles['label']}>Verification Date</p><p className={styles['label']}>Phone Number</p><p className={styles['label']}>Destination</p><p className={styles['label']}>Deal Status</p>This component doesn’t import the translation hook yet — add it (copy the pattern from
new-deal.tsx):
import { useTranslation } from 'react-i18next';// …then, at the top of the component body:const { t } = useTranslation();Now wrap each label — keep className={styles['label']} or you’ll drop the styling:
// after<p className={styles['label']}>{t('verificationDate')}</p><p className={styles['label']}>{t('phoneNumber')}</p><p className={styles['label']}>{t('destination')}</p><p className={styles['label']}>{t('dealStatus')}</p>Then add the missing keys. phoneNumber already exists in both locales, and destination exists in
en only — so you add two keys to en and three to ar (Arabic is a partial stub; any key
you miss falls back to English, which is the exact bug you’re fixing):
// public/locales/en/translation.json — add these two"verificationDate": "Verification Date","dealStatus": "Deal Status"// public/locales/ar/translation.json — add these three (destination is missing here!)"verificationDate": "تاريخ التحقق","dealStatus": "حالة الصفقة","destination": "الوجهة"3 · Verify it
Section titled “3 · Verify it”- With
yarn start:brokerrunning, openhttp://localhost:4201/my-deals. The cards still read correctly in English — you didn’t break anything. - Flip the language to Arabic (the language switcher is gated by
NX_SHOW_LANGUAGES_OPTIONS; set ittruein your.envif hidden). The labels now render in Arabic instead of hardcoded English. That’s the fix, visible.
4 · Lint, type-check, test
Section titled “4 · Lint, type-check, test”yarn nx lint orascom-broker-apptsc -p apps/orascom-broker-app/tsconfig.app.json --noEmit # plain `tsc --noEmit` checks nothing in this Nx appBoth must pass — SonarQube is a blocking gate in the frontend pipeline, and the pre-commit hook
runs lint-staged (eslint + prettier). Fix anything they flag before committing.
5 · Open the merge request
Section titled “5 · Open the merge request”This repo is on GitLab — you open a merge request (MR), not a GitHub pull request.
- Branch and commit using Conventional Commits (a
commit-msghook enforces it):Heads-up: aTerminal window git checkout -b feat/broker-translate-deal-card-labelsgit add -Agit commit -m "feat(broker): translate My-Deals card labels"git push -u origin feat/broker-translate-deal-card-labelspre-pushhook builds all four apps (nx run-many --target=build --all), so the first push is slow and rejects the push if any app fails to build. - Open a merge request against
develop(the default branch;developauto-deploys to staging on merge). CI runssonarqube-check(blocking) → build. Get a review, merge. - After merge, verify on the staging broker portal that the Arabic labels render.
What you just learned
Section titled “What you just learned”- The frontend dev loop:
nvm use→yarn install→yarn start:broker→ change → lint/type-check → PR. - The i18n gotcha that recurs everywhere: the broker app ships
ar+en, andaris a partial stub — so any key you miss silently falls back to English. - The branch model:
develop→ staging, and the blocking SonarQube gate.
