Home

Awesome

<h1 align="center"> <img src='https://github.com/wataru-maeda/react-native-boilerplate/blob/main/__DELELE_ME__/banner.png' width='600'> </h1> <p align="center"> <img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="React Native is released under the MIT license." /> <img src="https://github.com/wataru-maeda/react-native-boilerplate/actions/workflows/preview.yml/badge.svg" alt="" /> <img src="https://github.com/wataru-maeda/react-native-boilerplate/actions/workflows/test.yml/badge.svg" alt="" /> <img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs welcome!" /> </p> <p align="center"> <img src='https://github.com/wataru-maeda/react-native-boilerplate/blob/main/__DELELE_ME__/demo.gif' width='150px'> </p> <p align="center"> <a href="https://expo.dev/%40wataru/react-native-boilerplate?serviceType=eas&distribution=expo-go&scheme=exp%2Breact-native-boilerplate&channel=main&sdkVersion=50.0.0"> Demo </a> </p>

Say goodbye to time-consuming setup tasks like restructuring files, installing libraries, and crafting reusable components. Our project boilerplate is your solution to eliminate redundant work when starting from scratch. It includes only the most commonly-used libraries, so you can hit the ground running with a fully configured setup.

🗒️ Requirements

🚀 Quick Start

  1. Download zip or click "Use this template"
  2. Install packages with npm install or yarn install
  3. Spin up dev environment with npm run start or yarn run start

🤖 What's included

<details> <summary><b>Navigation</b></summary>

Utilizes react-navigation v6 for stack, tab, and drawer navigation configurations as the default setup. Flexibility in modifying navigation styles. For adjustments to the navigation style, refer to the implementation details in Stack.tsx, Drawer.tsx, and Tab.tsx.

Simplified navigation structure customization:

Dynamic navigation switching based on user status:

</details> <details> <summary><b>Redux</b></summary>

Redux Hooks are pre-configured for immediate use.

Access all Redux modules within the modules folder.The boilerplate includes Redux Hooks integration for straightforward state management. For an illustration of module utilization, refer to app.slice.ts.

</details> <details> <summary><b>Assets</b></summary>

This project centralizes the management of assets, including images, icons, and fonts, within the theme directory. For seamless integration of new assets, ensure their importation into the designated files where they will be utilized. This approach facilitates streamlined access to all assets via the theme structure. To further optimize performance, asset preloading has been incorporated into the boilerplate. This setup also supports the use of SVG files, offering extensive flexibility in managing visual resources. Assets are made effortlessly accessible for implementation across the project by importing them directly from the theme.

</details> <details> <summary><b>Absolute Paths</b></summary>

Navigating through complex project architectures with deeply nested folders often complicates the use of relative paths, potentially leading to errors. To alleviate this issue, our boilerplate simplifies the development process by facilitating the use of absolute paths. This means you can replace convoluted relative paths like ../../../components/Button with straightforward references such as @/components/Button in your import statements. The implementation for this feature is configured within both the babel.config.js and tsconfig.json files. These configurations ensure a hassle-free experience in utilizing absolute paths across your project, enhancing clarity and reducing the likelihood of path-related errors.

</details> <details> <summary><b>Environment Variables</b></summary>

Environment variables can be defined within the respective files for different deployment stages: .env.development for development, .env.production for production, and .env.test for test.

</details> <details> <summary><b>[CI] Code formatting, linting and testing on pre-commit</b></summary>

  1. Throughout the coding process, these integrated tools proactively scan and refine your code. Activating the 'Format on Save' feature further streamlines this process, automatically tidying your code with each save.
  2. Committing changes triggers a pre-commit script that meticulously checks, formats, and tests your code. This comprehensive review process ensures your contributions are both error-free and stylistically consistent.
  3. Successfully navigating through the stages of code verification, formatting, and testing empowers you to commit your changes with absolute confidence. You can rest assured knowing your code is not only efficient but also meets the highest standards of quality and reliability.
</details> <details> <summary><b>[CD] Release previews on Pull-Request</b></summary>

  1. Whenever you create a pull request (PR) or merge, it automatically generates a preview channel in your Expo account.
  2. You don't need to run 'eas' commands every time you create a PR; the process is streamlined for you.
  3. The continuous delivery (CD) process is managed through the preview.yml configuration file, which utilizes expo-github-action.

To set up the CD workflow, follow these steps:

  1. Create an EXPO_TOKEN in your Expo account. You can do this by visiting this link.
  2. In your GitHub repository, go to Settings, then navigate to Secrets and variables -> Actions -> Add new repository secret. Make sure to name the secret as EXPO_TOKEN.
  3. Update name, slug, owner, projectId and url in app.json:
  4. Update in name, slug, projectId, ios, android in app.config.ts
  5. After you push changes to the main branch, a new preview will be created automatically.
</details>

🧑‍💻 Need native code?

To generate iOS and Android native code, you can run npx expo prebuild in the project's root directory. For more details and specific instructions, please refer to the Expo documentation page.

🥇 Libraries

🥈 Libraries for development

☀️ Icons

Expo provides a popular set of vector icons. Please search icons from here

📓 License

This project is available under the MIT license. See the LICENSE file for more info.