A React Native 0.87 CLI starter template with TypeScript, React Navigation 7, NPM (>= 9.0.0) workspaces, custom fonts (Montserrat), and Android product flavors pre-configured.
- Node.js
^22.13.0 || ^24.3.0 || >= 26.0.0(required by React Native 0.87) - NPM >= 9.0.0 (workspaces enabled)
- Ruby (for CocoaPods on iOS)
- Xcode (iOS)
- Android Studio + JDK (Android)
- Android SDK: platform 37, build-tools 37.0.0, NDK 28.2.13676358
# Install dependencies (also links the workspace aliases)
npm install
# iOS — install native pods
cd ios && bundle install && bundle exec pod install && cd ..
# Start Metro bundler
npm startThe
android:*run scripts pass--no-packager, so Metro must already be running in another terminal.
App.tsx # Root providers: SafeAreaProvider → ThemeProvider
src/
├── Main.tsx # NavigationContainer + HomeStack
├── assets/fonts/ # Montserrat family (linked via react-native.config.js)
├── app/
│ ├── screens/ # Screen components (@app/screens/*)
│ ├── navigation/ # Routes: HomeStack + RootStackParamList (@app/navigation/*)
│ └── modules/ # Placeholder for feature modules (@app/modules/*)
└── packages/
├── react-navigation/ # Navigator primitives + NavigationHeader — no routes
├── react-native-ui/ # Atoms / molecules / organisms + theme
└── i18n/ # i18next init and useTranslation
Routes live in @app/navigation; @packages/react-navigation deliberately holds only the navigator
primitive so the UI layer stays route-agnostic.
There is no babel module-resolver. @app/* and @packages/* resolve at runtime through npm
workspace symlinks — each aliased directory is a workspace whose package.json declares the scoped
name. tsconfig.json paths only mirrors that for the TypeScript compiler.
Adding a new alias needs all four:
src/<path>/package.jsonwith the scopedname(plusmain/typesif it has a barrelindex.ts),- an entry in the root package.json
workspacesarray, - matching
pathsin tsconfig.json, npm installto create the symlink.
A new top-level scope must also be whitelisted in transformIgnorePatterns in
jest.config.js, since these workspaces ship untranspiled TS/TSX.
Replace every occurrence of ReactNativeBoilerplate / reactnativeboilerplate with your app name.
{
"name": "MyApp",
"displayName": "My App"
}android/settings.gradle — root project name:
rootProject.name = 'MyApp'android/app/build.gradle — namespace and application ID:
android {
namespace "com.myapp"
defaultConfig {
applicationId "com.myapp"
...
}
}android/app/src/main/res/values/strings.xml — default app name (used as fallback when no flavor is active):
<string name="app_name">My App</string>The per-flavor display names are set via
resValuein eachproductFlavorsblock insideandroid/app/build.gradle. See Android Product Flavors.
android/app/src/main/java/ — rename the package directory from com/reactnativeboilerplate/ to com/myapp/ and update the package declaration at the top of MainActivity.kt and MainApplication.kt.
ios/ReactNativeBoilerplate/Info.plist — display name:
<key>CFBundleDisplayName</key>
<string>My App</string>Xcode — open ios/ReactNativeBoilerplate.xcodeproj, select the target, and update:
- Target name
- Bundle Identifier (e.g.
com.myapp) MARKETING_VERSIONandCURRENT_PROJECT_VERSIONin Build Settings
ios/Podfile — target name must match the Xcode target:
target 'MyApp' do
...
endAfter renaming the iOS target/folder, re-run:
cd ios && pod installThe boilerplate ships with the full Montserrat family. Font files live in src/assets/fonts/.
-
Add font files to
src/assets/fonts/(e.g.Inter-Regular.ttf). That directory is registered as an asset folder in react-native.config.js. -
Link them — this copies to
android/app/src/main/assets/fonts/, adds the Xcode file references, and regeneratesios/link-assets-manifest.json+android/link-assets-manifest.json:npx react-native-asset
-
iOS — register each face in
Info.plist. Linking puts the.ttfin the bundle but iOS only loads fonts listed underUIAppFonts, so add every new face toios/ReactNativeBoilerplate/Info.plist:<key>UIAppFonts</key> <array> <string>Inter-Regular.ttf</string> <!-- add every variant you shipped --> </array>
This is also why the three
FontAwesome6_*.ttfentries are in that array —@react-native-vector-iconsships its faces via its podspec, but without theInfo.plistentries the icons silently render as missing-glyph boxes on iOS while still working on Android. Any additional icon set needs the same treatment. -
Rebuild the app (
cd ios && bundle exec pod installfirst if pods changed). -
Use the font in JS — use the PostScript name (usually
FontFamily-Weight), and prefer adding it totheme/tokens/typography.tsover hardcoding:<Text style={{ fontFamily: 'Inter-Regular' }}>Hello</Text>
Tip: check the PostScript name in Font Book (macOS) if unsure of the exact name.
To remove the default Montserrat fonts:
- Delete the
.ttffiles fromsrc/assets/fonts/ - Remove their entries from
ios/ReactNativeBoilerplate/Info.plist(UIAppFontsarray) - Remove them from the Xcode project (select files → Delete → Move to Trash)
- Delete them from
android/app/src/main/assets/fonts/ - Drop their entries from
ios/link-assets-manifest.jsonandandroid/link-assets-manifest.json - Remove any references from
src/packages/react-native-ui/theme/tokens/typography.ts
Three flavors are configured in android/app/build.gradle:
| Flavor | Suffix | App Name | Version Name |
|---|---|---|---|
development |
.sit |
Boilerplate (SIT) | 1.0.0-SIT |
staging |
.uat |
Boilerplate (UAT) | 1.0.0-UAT |
production |
(none) | Boilerplate | 1.0.0 |
Each flavor produces a unique applicationId, so all three can be installed on the same device simultaneously.
Edit the productFlavors block in android/app/build.gradle:
productFlavors {
development {
dimension "default"
applicationIdSuffix ".sit"
resValue "string", "app_name", "My App (SIT)"
versionCode 1
versionName "1.0.0-SIT"
}
staging {
dimension "default"
applicationIdSuffix ".uat"
resValue "string", "app_name", "My App (UAT)"
versionCode 1
versionName "1.0.0-UAT"
}
production {
dimension "default"
resValue "string", "app_name", "My App"
versionCode 1
versionName "1.0.0"
}
}- Add a new entry in
productFlavors. - Add it to
debuggableVariantsin thereact { }block so Metro bundler works correctly in debug:debuggableVariants = ["developmentDebug", "developmentDebugOptimized", "stagingDebug", "stagingDebugOptimized", "productionDebug", "productionDebugOptimized", "newFlavorDebug", "newFlavorDebugOptimized"]
- Run with the new flavor (see Running the App).
npm run iosnpm run android# Development (SIT)
npm run android
# Staging (UAT)
npm run android:staging
# Production
npm run android:prodOr invoke the CLI directly (note the = and that Metro must be running):
npx react-native run-android --mode=stagingDebug --appIdSuffix uat --no-packagerOr use Android Studio: Build > Select Build Variant → choose the desired flavor + build type.
| Command | Description |
|---|---|
npm start |
Start Metro bundler |
npm run ios |
Build and run on iOS simulator |
npm run android |
Build and run on Android emulator (development flavor) |
npm run android:staging |
Run the staging (UAT) flavor |
npm run android:prod |
Run the production flavor |
npm run android:clean |
./gradlew clean |
npm run android:apk:sit / :uat / npm run android:apk |
Release APK per flavor |
npm run android:aab:sit / :uat / npm run android:aab |
Release AAB per flavor |
npm test |
Run Jest tests |
npm run lint |
Run ESLint |
npx tsc --noEmit |
Type check (there is no tsc script) |
npm run lint has 6 pre-existing react-native/no-inline-styles warnings (0 errors). They are the
runtime-theming convention colliding with that rule — that is the expected baseline.