- Expo + React Native app written in TypeScript.
strictTypeScript enabled intsconfig.json.- Entry is
index.ts; app config inapp.json. - Source lives in
src/with components, screens, services, context, storage, util. - Styling uses
react-native-size-mattersand shared@stylestheme helpers. - i18n uses
react-i18nextwith translations inassets/translations.
npm install
npm run start(Expo dev server)npm run android(run Android device/emulator)npm run ios(run iOS simulator)
npm run format(Prettier, repo-wide)
npx eas build --profile developmentnpx eas build --profile previewnpx eas build --profile production- Profiles are defined in
eas.json; requires EAS auth.
- No lint script configured in
package.json. - If adding lint, keep it opt-in and align with Prettier.
- No test runner configured in
package.json. - No single-test command available yet.
- If you introduce Jest later, use
npx jest path/to/test -t "name"(convention only).
src/components/reusable UI components and hooks.src/screens/screen-level components and flows.src/context/React context providers and hooks.src/services/app services (seed, NFC, exchange rates).src/storage/persistence and database helpers.src/styles/theme colors and globals.src/util/shared utilities.assets/images, lottie, translations.
- Prefer path aliases from
tsconfig.json(@src,@comps,@styles,@model, etc.). - Keep alias imports grouped together at the top.
- Follow with external packages, then relative imports.
- Use
import typefor type-only imports. - Avoid unused imports; rely on TypeScript to catch issues.
- Prettier settings: semicolons, double quotes,
printWidth: 100, trailing commas. - Indentation is 2 spaces; no tabs.
- Keep JSX props each on new line when long.
- Keep objects and arrays trailing commas for easier diffs.
- Prefer
constandfunctiondeclarations overlet. - Avoid inline comments unless requested.
- Use TypeScript everywhere; avoid
anyunless unavoidable. - Prefer
interfacefor props and object shapes; prefix withI(e.g.,IButtonProps). - Use
typefor unions/utility types; prefix withTfor nav props (e.g.,TDisplaySettingsPageProps). - Component names are
PascalCase; hooks areuseCamelCase. - Constants are
SCREAMING_SNAKE_CASEinconsts/. - File names are
PascalCasefor components,camelCasefor utilities.
- Components generally use
export default function ComponentName(...). - Use
useThemeContextfor theme colors and highlight selection. - Prefer
globals(...)and@styleshelpers over hard-coded values. - Size spacing with
s()/ScaledSheetfromreact-native-size-matters. - Use
TouchableOpacitywithaccessibilityRole="button"where appropriate. - Include
testIDattributes when there is an existing pattern.
- Context providers live in
src/context/and are exported as hooks. - Keep derived values memoized (
useMemo) when depending on theme or context. - Persist preferences via
@src/storagehelpers. - Avoid side effects in render; use
useEffect.
- Use
try/catchfor async boundaries; log errors vialfrom@log. - Return
null/fallback values when a feature can gracefully degrade. - Throw errors in services only for unrecoverable state (e.g., missing mnemonic).
- Avoid swallowing errors without logging.
- Use
useTranslationandNSnamespaces for UI strings. - Add translations to
assets/translations/*.jsonwhen new keys are introduced. - Keep user-visible strings out of services/utilities where possible.
- Sensitive data uses
expo-secure-storeabstractions insrc/storage. - Keep data models in
src/model/and re-export via@model. - Prefer typed storage accessors over raw
SecureStorecalls.
- Use
fetchwith typed responses where possible. - Validate input strings before network calls (e.g., LNURL parsing).
- Handle
.oniondomains viahttpwhen required.
- Navigation types live in
src/model/nav.tsandsrc/nav/navTypes.ts. - Screen components should accept typed nav props.
- There are currently no test files or test scripts.
- If you add tests, keep them colocated with features or in a
__tests__folder. - Prefer deterministic tests and avoid network calls; mock where needed.
- Run
npm run formatbefore submitting changes. - If format changes are large, scope to touched files when possible.
- No
.cursor/rules/,.cursorrules, or.github/copilot-instructions.mdfound. - If added later, follow them as higher priority.
- Keep commits focused and small.
- Avoid unrelated refactors during feature work.
- Note any missing tests in PR description.
- Don’t hard-code colors; use theme helpers.
- Don’t bypass
SecureStorefor secrets. - Ensure
awaitis used for async storage calls. - Avoid using
anyto silence type errors.
package.jsonfor scripts..prettierrcfor formatting.tsconfig.jsonfor path aliases and strict mode.app.jsonandeas.jsonfor Expo/EAS config.
- Respect existing patterns and naming.
- Keep changes minimal and localized.
- Ask before adding new dependencies.
- Avoid writing new docs unless requested.
- Use
edittool for modifications. - Re-run formatting after structural refactors.
- Update translation files for any new UI string.
- Ensure navigation types stay in sync.
- Keep sample data localized to dev builds.