A production-ready React Native boilerplate with TypeScript, Redux Toolkit, Navigation, and a complete development setup.
- TypeScript - Type-safe development
- Redux Toolkit - State management with modern Redux
- React Navigation - Stack, Tab, and Native Stack navigators
- i18n - Multi-language support (EN, TR)
- Theming - Light/Dark theme support with dynamic switching
- Authentication Flow - Sign In/Sign Up screens with navigation guards
- API Integration - RTK Query setup with base configuration
- MMKV Storage - Fast, encrypted key-value storage
- Atomic Design - Component organization (atoms, molecules, organisms, templates)
- Code Quality - ESLint, Prettier, Husky pre-commit hooks
- Performance - FlashList, React Native Reanimated
- Clone this repository as your boilerplate:
git clone https://github.com/your-username/base-app.git my-boilerplate
cd my-boilerplate- Create a new project from the boilerplate:
./.boilerplate/use-boilerplate.sh- Follow the interactive prompts to configure your project
- Clone the repository:
git clone https://github.com/your-username/base-app.git my-new-app
cd my-new-app- Run the initialization script:
node .boilerplate/init.js- Answer the configuration questions:
- Project name
- Display name
- iOS Bundle ID
- Android Bundle ID
src/
├── components/ # UI Components
│ ├── atoms/ # Basic components (Button, Text, etc.)
│ ├── molecules/ # Composite components
│ ├── organisms/ # Complex components
│ └── templates/ # Page templates
├── screens/ # Screen components
│ ├── auth/ # Authentication screens
│ └── main/ # Main app screens
├── navigation/ # Navigation configuration
├── store/ # Redux store
│ ├── api/ # RTK Query API
│ └── auth/ # Auth slice
├── theme/ # Theming system
│ ├── themes/ # Light/Dark themes
│ ├── tokens/ # Design tokens
│ └── utils/ # Theme utilities
├── i18n/ # Internationalization
├── utils/ # Helper functions
├── types/ # TypeScript types
├── constants/ # App constants
└── config/ # App configuration
After initialization, you may need to update:
-
iOS Bundle ID:
- Open
ios/YourApp.xcworkspacein Xcode - Select your project in the navigator
- Update Bundle Identifier in the General tab
- Open
-
Android Package Name:
- Update
applicationIdinandroid/app/build.gradle - Refactor package structure in
android/app/src/main/java/
- Update
-
App Icons:
- iOS: Replace images in
ios/YourApp/Images.xcassets/AppIcon.appiconset/ - Android: Replace images in
android/app/src/main/res/mipmap-*/
- iOS: Replace images in
-
Splash Screen:
- iOS: Configure in
ios/YourApp/LaunchScreen.storyboard - Android: Update
android/app/src/main/res/layout/launch_screen.xml
- iOS: Configure in
Create .env files for different environments:
# .env.development
API_URL=https://dev.api.example.com# .env.production
API_URL=https://api.example.comEdit theme files in src/theme/themes/:
// src/theme/themes/light.ts
export const lightTheme = {
colors: {
primary: '#007AFF',
// ... your colors
},
// ... other theme properties
};- New Screen:
# Create new screen file
src/screens/main/NewScreen.tsx
# Add to navigation
src/navigation/types.ts
src/navigation/stacks/MainStack.tsx- New Component:
# Follow atomic design principles
src/components/atoms/NewComponent/
├── NewComponent.tsx
├── NewComponent.types.ts
└── index.ts- New Redux Slice:
# Create slice
src/store/newFeature/newFeatureSlice.ts
# Add to store
src/store/configureStore.tscd ios && pod install
cd ..
npx react-native run-iosnpx react-native run-androidnpx react-native start# Run tests
npm test
# Run tests in watch mode
npm test -- --watchnpm run android- Run on Androidnpm run ios- Run on iOSnpm start- Start Metro bundlernpm test- Run testsnpm run lint- Run ESLintnpm run format- Format code with Prettiernpm run sort-imports- Sort imports
The .boilerplate/ directory contains:
config.json- Boilerplate configurationinit.js- Node.js initialization scriptuse-boilerplate.sh- Shell script for creating new projectstemplates/- Template files with placeholders
The following variables are replaced during initialization:
{{PROJECT_NAME}}- Project name (package.json name){{PROJECT_DISPLAY_NAME}}- Display name (shown on device){{BUNDLE_ID_IOS}}- iOS bundle identifier{{BUNDLE_ID_ANDROID}}- Android package name
To improve this boilerplate:
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request
MIT
Built with:
- React Native
- TypeScript
- Redux Toolkit
- React Navigation
- And many other amazing open-source libraries
Happy Coding! 🚀