Skip to content

Latest commit

 

History

History
191 lines (139 loc) · 11.5 KB

File metadata and controls

191 lines (139 loc) · 11.5 KB

Rootstrap's React Native Template

Rootstrap's React Native Template

expo react-native GitHub Repo stars GitHub commit activity (branch) GitHub issues GitHub closed issues

📱 A template for your next React Native project 🚀, Made with developer experience and performance first: Expo, TypeScript, NativeWind, Husky, Lint-Staged, expo-router, react-query, react-hook-form, I18n and preconfigured for EAS.

This repository is a fork of Obytes Starter, which provides a solid foundation. We periodically sync with the original repo to stay up-to-date with their improvements, while making our own adjustments and optimizations to streamline our setup process.

📋 Node.js Version Management

This template specifies a recommended Node.js version in the .nvmrc file. We recommend using a Node.js version manager such as fnm or nvm to ensure you're using the correct version.

With fnm:

fnm install
fnm use

With nvm:

nvm install
nvm use

The version manager will automatically read the .nvmrc file and switch to the correct Node.js version for this project.

Overview

As a team of experienced developers at Rootstrap, we have spent years building high-quality React Native applications. Our initial starter kit was designed for React Native CLI apps. However, with the strong recommendation to work with Expo since React Native 0.75, we recognized the need to adapt quickly and leverage the best tools available.

To maintain our commitment to delivering top-quality products efficiently, we chose to explore and research existing templates maintained by a larger community.

Our objective with this template is to streamline the development process, enabling us to build high-quality apps more efficiently and with less overhead.

This template brings several key advantages. It provides our team with a consistent codebase and standards, making it easier to move between projects without a steep learning curve. This consistency allows us to focus more on the core functionality of each project instead of getting stuck on repetitive setup tasks. Furthermore, by promoting uniformity across our work, it simplifies maintenance, scaling, and collaboration across different teams.

⭐ Key Features

  • 🎉 TypeScript for type checking, to help you catch bugs and improve code quality.
  • 💅 A minimal UI kit built with NativeWind, which provides a range of pre-defined classes for styling your app.
  • ⚙️ Support for multiple environment builds, including Production, Staging, QA and Development, using Expo configuration.
  • 🦊 Husky for Git Hooks, to automate your git hooks and enforce code standards.
  • 💡 A clean project structure with Absolute Imports, to make it easier to navigate and manage your code.
  • 🚫 Lint-staged for running ESLint and TypeScript checks on Git staged files, to ensure that your code is always up to standards.
  • 🗂 VSCode recommended extensions, settings, and snippets to enhance the developer experience.
  • ☂️ Pre-installed Expo Router with examples, to provide a comprehensive navigation solution for your app.
  • 💫 An auth flow with zustand and react-native-mmkv as a storage solution to save sensitive data.
  • 🛠 +10 workflows for building, releasing, testing and distributing your app using Github action.
  • 🔥 React Query and axios for fetching data, to help you build efficient and performant apps.
  • 🧵 A good approach for handling forms with react-hook-form and zod for validation + keyboard handling.
  • 🎯 Localization with i18next, along with Eslint for validation.
  • Unit testing with Jest and React Testing Library setup to help you write tests for your app.

✍️ Documentation 🚧 UNDER CONSTRUCTION 🚧

🧑‍💻 Stay up to date

We are committed to continually improving our starter kit and providing the best possible resources for building React Native apps. To that end, we regularly add new features and fix any bugs that are discovered.

If you want to stay up to date with the latest developments in our starter kit, you can either watch the repository or hit the "star" button. This will allow you to receive notifications whenever new updates are available.

We value the feedback and contributions of our users, and we encourage you to let us know if you have any suggestions for improving our starter kit. We are always looking for ways to make it even more effective and useful for our community. So, please do not hesitate to reach out and share your thoughts with us.

Add RS GPT Review Bot

You can add a GPT Review Bot to your app by following these steps:

  • You need to have an OpenAI API key.
  • Save your OpenAI API key as a Secret in your repository.
  • Create a new workflow in folder .github/workflows that will be triggered on issues, pull requests, and comments.
  • You can see examples of workflows in the rs-gpt-review repository.

Notes:

The bot will be triggered on issues, pull requests and comments, you can modify your PULL_REQUEST_TEMPLATE.md to tag the review bot and trigger the workflow every time a pull request is created.

Check this file for more examples.

PR Risk Classification

This repository uses a simple risk:* label system when opening pull requests.

Label When to use
risk:low Config, copy, minor UI tweaks with low blast radius.
risk:medium Feature work and refactors touching multiple files.
risk:high Auth, payments, migrations, and security-sensitive code.

Before requesting review, apply the label that best matches the change. When in doubt, escalate instead of guessing.

Setup checklist:

  • Create risk:low, risk:medium, and risk:high labels in the repo.
  • Keep the risk criteria documented in the PR template or contributing guide.
  • Define who can override or escalate the label, such as the tech lead.

Pushgate

This repository uses ai-pushgate to run local checks before git push.

How this relates to PR approvals:

  • Pushgate is a local pre-push gate run from the Git pre-push hook.
  • PR approval calculation is handled separately by the Layer 4 gatekeeper workflow script at .github/scripts/gatekeeper.js.
  • Pushgate can help classify AI findings, while gatekeeper turns risk:* + ai:* labels into required approvals.

Pushgate setup for template users:

  • .pushgate.yml is versioned, so everyone gets the same rules.
  • .git/hooks/pre-push is local and is not committed to Git.
  • If you create the app with create-rootstrap-rn-app, Pushgate is installed automatically during setup.
  • For existing clones, or if the hook is missing, install it manually:

Install from repo root:

curl -fsSL https://raw.githubusercontent.com/rootstrap/ai-pushgate/main/install.sh | bash

Verify the hook was created:

ls .git/hooks/pre-push

How to skip checks:

Skip AI only: git -c pushgate.skip-ai-check=true push Skip everything: git push --no-verify

Layer 4 Gatekeeper Approval Calculation

The gatekeeper script computes required approvals from PR labels using this routing table:

Risk \ AI findings ai:clean ai:minor ai:serious
risk:low 0 0 1
risk:medium 0 1 2
risk:high 1 2 2

Decision rules implemented in .github/scripts/gatekeeper.js:

  • Missing risk:* or ai:* label -> status is pending.
  • required approvals = 0 -> status is success (auto-merge allowed by this check).
  • Otherwise status is success only when current approvals >= required approvals; else pending.
  • Approval count uses the latest review state per reviewer, and counts only APPROVED.

Workflow file: .github/workflows/layer4-gatekeeper.disabled.yml (rename/enable it in your repo if you want this check active).

💎 Libraries used

Contributors

This starter is maintained by Rootstrap React Native team and we welcome new contributors to join us in improving it. If you are interested in getting involved in the project, please don't hesitate to open an issue or submit a pull request.

🔖 License

This project is MIT licensed.