npm package: @niteshchowdhary/create-react-native-app
Description: Create a new React Native app with production-ready boilerplate - TypeScript, Redux Toolkit, Redux Saga, React Navigation, Theming, MMKV Storage, and more
Author: Nitesh Chowdhary
Latest version: 1.0.4

# @niteshchowdhary/create-react-native-app

Create a new React Native app with a production-ready boilerplate template in seconds.

[![npm version](https://badge.fury.io/js/%40nitesh%2Fcreate-react-native-app.svg)](https://www.npmjs.com/package/@niteshchowdhary/create-react-native-app)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

## Quick Start

```bash
npx @niteshchowdhary/create-react-native-app MyApp
cd MyApp
yarn ios    # or yarn android
```

## Features

- **React Native 0.83+** - Latest stable version
- **TypeScript** - Full type safety with path aliases
- **Redux Toolkit** - Modern state management
- **Redux Saga** - Side effect management
- **Redux Persist + MMKV** - High-performance state persistence
- **React Navigation 7** - Type-safe Stack & Bottom Tabs navigation
- **Theming System** - Dark/Light mode with persistence
- **UI Components** - Button, TextInput, Toast, Dialog, BottomSheet, and more
- **Environment Config** - Multi-environment support (.env)
- **Hermes Engine** - Optimized JavaScript engine enabled
- **New Architecture** - React Native's new architecture enabled
- **Form Validation** - Built-in validation schemas

## Usage

### Create a new app

```bash
npx @niteshchowdhary/create-react-native-app MyApp
```

### Options

| Option | Description |
|--------|-------------|
| `--skip-install` | Skip installing dependencies |
| `--npm` | Use npm instead of yarn |

### Examples

```bash
# Create app with default settings (yarn)
npx @niteshchowdhary/create-react-native-app MyApp

# Create app using npm
npx @niteshchowdhary/create-react-native-app MyApp --npm

# Create app without installing dependencies
npx @niteshchowdhary/create-react-native-app MyApp --skip-install
```

## Project Structure

```
MyApp/
├── src/
│   ├── assets/          # Fonts, images, SVGs
│   ├── components/      # Reusable UI components
│   │   ├── core/        # Base components (Button, Text, TextInput)
│   │   └── ui/          # Complex components (Dialog, BottomSheet)
│   ├── config/          # Environment configuration
│   ├── constants/       # App constants (colors, fonts)
│   ├── features/        # Feature-based screens
│   ├── hooks/           # Custom React hooks
│   ├── navigation/      # Navigation setup
│   ├── providers/       # Context providers (Theme)
│   ├── schema/          # Validation schemas
│   ├── services/        # API services (Axios)
│   ├── store/           # Redux store, slices, sagas
│   ├── styles/          # Global styles, theme colors
│   ├── types/           # TypeScript definitions
│   └── utils/           # Utility functions
├── android/             # Android native code
├── ios/                 # iOS native code
├── App.tsx              # App entry point
└── package.json
```

## What's Included

### State Management
- Redux Toolkit with typed hooks (`useAppDispatch`, `useAppSelector`)
- Redux Saga for async operations
- Redux Persist with MMKV storage for persistence

### Navigation
- React Navigation 7 with native stack
- Bottom tabs navigation
- Type-safe route params

### UI Components
- **Core**: Button, Text, TextInput, Screen, Spinner, Switch, ProgressBar
- **UI**: Toast, Dialog, BottomSheet, Card, Checkbox, RadioButton, Chips, SearchBar, Divider

### Theming
- Dark/Light mode support
- System preference detection
- Theme persistence across app restarts
- Comprehensive color system

### API Layer
- Axios with interceptors
- Safe async error handling
- Environment-based base URL

### Storage
- MMKV high-performance storage
- Singleton pattern
- Type-safe getters/setters

## Available Scripts

After creating your app, these scripts are available:

```bash
# Start Metro bundler
yarn start

# Run on iOS (with pod install)
yarn ios

# Run on Android
yarn android

# Run on specific environments
yarn ios:dev      # Development
yarn ios:stag     # Staging
yarn ios:prod     # Production

yarn android:dev  # Development
yarn android:stag # Staging
yarn android:prod # Production

# Linting
yarn lint
```

## Environment Setup

The template creates example environment files. Configure them for your project:

```bash
# .env.development
BASE_URL=https://api.dev.example.com
ENV=development

# .env.staging
BASE_URL=https://api.staging.example.com
ENV=staging

# .env.production
BASE_URL=https://api.example.com
ENV=production
```

## Requirements

- Node.js >= 18.0.0
- React Native CLI
- Xcode (for iOS)
- Android Studio (for Android)
- CocoaPods (for iOS)

## License

MIT © [Nitesh Chowdhary](https://github.com/niteshchowdhary)