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 pull 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 22 (the repo pins it in
.nvmrconuat;nvm usepicks it up, and CI and Amplify both build on 22). Notemainstill pinsv20.19.2— if you are working from amaincheckout you will get the old pin. - Yarn 1 (classic).
- Read access to the
frontendrepo, and a broker test account for UAT (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 → 22 (on uat)yarn install -
Point the broker app at the UAT 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; make sure they point at UAT:
Terminal window NX__BROKER_API_ENDPOINT=https://api-orascom-uat.my.orascomdh.com/apiNX__BROKER_ENDPOINT_PREFIX=/brokerTwo variables you may see referenced elsewhere but should not add:
NX_CLIENT_SECRETandNX_FIREBASE_API_KEYare unset in every environment and unread by app code. -
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 UAT at
https://odh-uat.my.orascomdh.com/partnersin another tab, copylocalStorage['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. On the pull request, the frontend’s required check is checks — within it
lint and build block a merge; the test target does not (it runs with continue-on-error). The
pre-commit hook also runs lint-staged (eslint + prettier). Fix anything they flag before committing.
5 · Open the pull request
Section titled “5 · Open the pull request”The frontend now lives on GitHub (OrascomDevelopment/Orascom-Portals-Frontend) — you open a
pull request (PR), not a GitLab merge 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 pull request against
uat— that is the base branch and the GitHub default. Your PR needs the requiredchecksjob to pass and one approval before it can merge. The frontend deploys on AWS Amplify with branch-level autoBuild, so on merge touatAmplify builds and deploys automatically — no manual deploy step. Expect 4–6 minutes. - After merge, verify on the UAT broker portal —
https://odh-uat.my.orascomdh.com/partners— 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:
uatis the base branch,mainis production, and the frontend ships via Amplify autoBuild on merge (no manual deploy).developstill exists but is retired and frozen — pushing to it is blocked outright, because the branch is locked read-only. Your commits stay safe locally; git simply refuses the push. The environments and their URLs are on Environments; the whole rail is on How deployment works.
