This is a powerful CLI tool for scaffolding React Native projects with a comprehensive, opinionated project structure. It helps developers quickly set up a well-organized React Native application with optional configurations for navigation, state management, and storage.
The scaffolder creates a robust, scalable project structure with carefully organized directories:
project-root/
│
├── src/
│ ├── assets/
│ │ ├── fonts/
│ │ ├── icons/
│ │ │ ├── BottomTabIcons/
│ │ │ ├── imageIcons/
│ │ │ └── svgIcons/
│ │ └── images/
│ │ ├── PngAndJpgImages/
│ │ ├── SvgImages/
│ │ └── OtherImages/
│ │
│ ├── components/
│ │ ├── global/ # Reusable global components
│ │ └── forms/ # Form-related components
│ │
│ ├── constants/ # Application-wide constants
│ │
│ ├── context/ # React Context providers
│ │
│ ├── features/ # Feature-based screens
│ │ ├── auth/
│ │ ├── dashboard/
│ │ ├── settings/
│ │ └── chat/
│ │
│ ├── i18n/ # Internationalization
│ │ └── locales/
│ │
│ ├── navigation/ # Navigation setup
│ │
│ ├── service/ # API services
│ │
│ ├── store/ # State management
│ │
│ ├── styles/ # Common styles
│ │
│ ├── theme/ # Theme configurations
│ │
│ ├── types/ # TypeScript types
│ │
│ └── utils/ # Utility functions
│
└── tsconfig.json
When you run the scaffolder, you'll be prompted with several configuration choices:
-
Bottom Tab Navigation
- Opt to set up a bottom tab navigation structure
- Creates dedicated navigation files and icon directories
-
Storage Solution Choose from:
- Async Storage
- React Native MMKV
- None
-
Navigation Setup
- Comprehensive navigation structure with navigation references
-
State Management Choose from:
- Redux Toolkit
- Zustand
- Context API
- None
- fs-extra
- path
- chalk
- inquirer
- @react-native/typescript-config
# Navigate to your project directory
yarn add babel-plugin-module-resolver --dev
# Run the scaffolder
npx react-native-maker
and copy and paste these code in that file:
module.exports = {
presets: ['module:@react-native/babel-preset'],
plugins: [
[
'module-resolver',
{
root: ['./src'],
alias: {
"@assets": './src/assets',
"@features": './src/features',
"@navigation": './src/navigation',
"@components": './src/components',
"@state": './src/state',
"@store": './src/store',
"@service": './src/service',
"@styles": './src/styles',
"@utils": './src/utils',
"@i18n": './src/i18n',
"@theme": './src/theme',
"@types": './src/types',
"@constants": './src/constants',
"@context": './src/context',
"@hooks": './src/hooks',
}
}
],
// other pluging you can add here
]
};
Remember that it will modify you tsconfig.json file also. 👶
All folder are created, now you can modify files and folder its create typescript files which you may change or delete
- Async Storage Utility
- MMKV Storage Utility
- Includes methods for:
- Setting items
- Getting items
- Deleting items
- Clearing storage
- Includes methods for:
- Root Navigator setup
- Navigation reference for programmatic navigation
- Methods for:
- Navigating to routes
- Going back
- Resetting navigation stack
Depending on your choice:
- Redux Toolkit: Configured store with example slice
- Zustand: Basic store with increment/decrement example
- Context API: Provider with example state management
- Predefined path aliases
- Type root configurations
- Jest type support
- Install dependencies
- Configure any additional libraries
- Customize generated files
- Start building your app!
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License
- Ensure you have the latest version of Node.js
- Check that all peer dependencies are installed
- Verify React Native CLI is set up correctly
For issues or questions, please file an issue on our GitHub repository.