๐ React Native Boilerplate Template


A modern, comprehensive React Native template with best practices, modern tools, and a clean architecture. This template provides everything you need to kickstart your React Native project with TypeScript, navigation, state management, and more.
๐ Complete Documentation
๐ Visit our comprehensive documentation website for detailed guides, examples, and best practices.
The documentation includes:
- ๐ Setup Guides - Step-by-step installation and configuration
- ๐๏ธ Architecture Guide - Understanding the project structure
- ๐จ Theming System - Customizing colors, typography, and styles
- ๐ง Configuration - API setup, environment variables, and more
- ๐ฑ Component Library - Pre-built components and usage examples
- ๐งช Testing Guide - Unit testing and best practices
- ๐ Deployment - Build and release your app
โจ Features
๐๏ธ Architecture & Structure
- TypeScript - Full type safety with latest TypeScript
- Modular Architecture - Well-organized folder structure
- Atomic Design - Component structure following atomic design principles
- Barrel Exports - Clean and organized imports
๐ฑ Navigation & UI
- React Navigation v7 - Stack navigation with type safety
- React Native Screens - Native screen optimization
- React Native Safe Area Context - Safe area handling
- React Native Gesture Handler - Smooth gesture handling
- React Native Reanimated v3 - Performant animations
๐ State Management & Data
- Zustand - Lightweight state management
- TanStack Query (React Query) - Server state management
- MMKV Storage - Fast key-value storage
- Axios - HTTP client with interceptors
๐จ Styling & Theme
- Custom Theme System - Centralized theming
- Responsive Design - Screen size adaptation
- Dark/Light Mode - Theme switching support
- Custom Components - Pre-built UI components
๐ Internationalization
- i18next - Multi-language support
- React i18next - React Native integration
- Fallback Languages - Graceful language fallbacks
๐งช Developer Experience
- ESLint - Code linting with React Native rules
- Prettier - Code formatting
- Husky - Git hooks for code quality
- Jest - Unit testing framework
- React Native Testing Library - Component testing
๐ฆ Additional Libraries
- React Native SVG - SVG support
- React Native Fast Image - Optimized image loading
- React Native WebView - Web content embedding
- React Native Device Info - Device information
- FlashList - Performant lists
- Zod - Runtime type validation
- React Error Boundary - Error handling
๐ Quick Start
Create a new project
npx @react-native-community/cli@latest init MyAwesomeApp --template @sohantalukder/react-native-boilerplate
Navigate to your project
The post-init script will automatically:
- Install all dependencies
- Set up iOS CocoaPods (if on macOS)
- Configure Git hooks
- Verify Android SDK setup
Run your app
# iOS
npm run ios
# or
yarn ios
# Android
npm run android
# or
yarn android
๐ Project Structure
src/
โโโ assets/ # Images, fonts, and other static assets
โโโ config/ # App configuration (API, storage, etc.)
โโโ modules/ # Feature modules
โโโ navigation/ # Navigation configuration
โโโ services/ # API services and external integrations
โโโ shared/ # Shared components and utilities
โ โโโ components/ # Reusable UI components
โ โ โโโ atoms/ # Basic components (Button, Input, etc.)
โ โ โโโ molecules/# Composite components
โ โ โโโ templates/# Layout components
โ โโโ contexts/ # React contexts
โ โโโ hooks/ # Custom hooks
โ โโโ utils/ # Utility functions
โโโ state/ # Global state management
โโโ theme/ # Theme configuration and styles
โโโ translations/ # Internationalization files
โโโ types/ # TypeScript type definitions
๐ ๏ธ Available Scripts
# Development
npm start # Start Metro bundler
npm run android # Run on Android
npm run ios # Run on iOS
# Building
npm run build:android # Build Android APK
npm run build:ios # Build iOS app
# Code Quality
npm run lint # Run ESLint + Prettier + TypeScript
npm run lint:fix # Fix linting issues
npm run test # Run tests
๐ง Configuration
Environment Setup
-
Development Environment: Follow the React Native environment setup guide
- iOS Setup (macOS only):
# Install Ruby dependencies
bundle install
# Install CocoaPods
cd ios && bundle exec pod install
- Android Setup:
- Set
ANDROID_HOME
environment variable
- Install Android SDK and required build tools
Theme Customization
Edit src/theme/
files to customize:
- Colors
- Typography
- Spacing
- Component styles
API Configuration
Update src/config/
files for:
- API endpoints
- Environment variables
- App configuration
๐ Documentation
๐ก Tip: For the most up-to-date and comprehensive documentation, visit our Documentation Website
Key Concepts
- Atomic Design: Components are organized as atoms โ molecules โ organisms โ templates
- Barrel Exports: Use index files for clean imports
- Type Safety: Leverage TypeScript for better development experience
- State Management: Use Zustand for global state, React Query for server state
Best Practices
- Components: Keep components small and focused
- Styling: Use the theme system for consistent styling
- State: Separate local, global, and server state appropriately
- Testing: Write tests for critical business logic
- Performance: Use FlashList for large lists, optimize images
๐ Additional Resources
๐ค Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
)
- Commit your changes (
git commit -m 'Add some amazing feature'
)
- Push to the branch (
git push origin feature/amazing-feature
)
- Open a Pull Request
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
๐ Support
Happy coding! ๐