react-native-boilerplate

๐Ÿš€ React Native Boilerplate Template

React Native Boilerplate Banner

Documentation NPM GitHub

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:

โœจ Features

๐Ÿ—๏ธ Architecture & Structure

๐Ÿ“ฑ Navigation & UI

๐Ÿ”„ State Management & Data

๐ŸŽจ Styling & Theme

๐ŸŒ Internationalization

๐Ÿงช Developer Experience

๐Ÿ“ฆ Additional Libraries

๐Ÿš€ Quick Start

Create a new project

npx @react-native-community/cli@latest init MyAwesomeApp --template @sohantalukder/react-native-boilerplate
cd MyAwesomeApp

The post-init script will automatically:

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

  1. Development Environment: Follow the React Native environment setup guide

  2. iOS Setup (macOS only):
    # Install Ruby dependencies
    bundle install
       
    # Install CocoaPods
    cd ios && bundle exec pod install
    
  3. Android Setup:
    • Set ANDROID_HOME environment variable
    • Install Android SDK and required build tools

Theme Customization

Edit src/theme/ files to customize:

API Configuration

Update src/config/ files for:

๐Ÿ“š Documentation

๐Ÿ’ก Tip: For the most up-to-date and comprehensive documentation, visit our Documentation Website

Key Concepts

Best Practices

  1. Components: Keep components small and focused
  2. Styling: Use the theme system for consistent styling
  3. State: Separate local, global, and server state appropriately
  4. Testing: Write tests for critical business logic
  5. Performance: Use FlashList for large lists, optimize images

๐Ÿ“– Additional Resources

๐Ÿค Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

๐Ÿ“ž Support


Happy coding! ๐ŸŽ‰