samuelbeaulieu / react-native-template-obytes

πŸ“± A template for your next React Native project πŸš€, Made with developer experience and performance first: TypeScript, Husky, Lint-Staged, react-navigation, react-query, restyle, react-hook-form, AppIcon, Splash Screen.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React Native Template Obytes

React Native Template Obytes

πŸ“± A template for your next React Native project πŸš€, Made with developer experience and performance first: TypeScript, Husky, Lint-Staged, react-navigation, react-query, restyle, react-hook-form, AppIcon, Splash Screen.

πŸš€ Use the template to start your next project or navigate to code source to get some inspiration πŸ˜‰

⭐ Features

  • βœ… Last React Native version
  • πŸŽ‰ Type checking TypeScript
  • πŸ’… Minimal UI kit using @shopify/restyle with theming
  • πŸ€– Auto generate App Icon using react-native-make and Splash screen using react-native-bootsplash
  • 🦊 Husky for Git Hooks
  • πŸ’‘ Clean project structure with Absolute Imports
  • 🚫 Lint-staged for running linters on Git staged files
  • β˜‚οΈ React Navigation pre-installed with examples
  • πŸ’« Auth flow with zustand and react-native-mmkv as a storage to save sensitive data.
  • πŸ›  A simple workflow to build, release and distribute your application using Github action
  • πŸ”₯ React Query & axios to fetch Data
  • 🧡 A good approach with example to handle forms based on react-hook-form and yup for validation
  • βš™οΈ Handel environment variables with react-native-env
  • 🎯 Localization

🎀 Philosophy

  • πŸš€ Production-ready
  • 🧩 Minimal code
  • ⚠️ well maintained third-party libraries

πŸ›  Requirements

πŸ€– Getting started

Start your project using obytes template by running:

npx react-native init MyApp --template https://github.com/obytes/react-native-template-obytes

Open the project on your favorite IDE (vscode πŸ˜‰)

src
β”œβ”€β”€ api                    #axios client and api hooks using react-query
β”‚   β”œβ”€β”€ APIProvider.tsx
β”‚   β”œβ”€β”€ client.tsx
β”‚   β”œβ”€β”€ index.tsx
β”‚   β”œβ”€β”€ useAddTask.tsx
β”‚   └── useTasks.tsx
β”œβ”€β”€ core                   # core functionalities:authentication, storage, localization
β”‚   β”œβ”€β”€ Auth
β”‚   β”œβ”€β”€ I18n
β”‚   └── index.tsx
β”œβ”€β”€ index.tsx
β”œβ”€β”€ navigation             # Navigation, stacks and tabs
β”‚   β”œβ”€β”€ AuthNavigator.tsx
β”‚   β”œβ”€β”€ RootNavigator.tsx
β”‚   β”œβ”€β”€ TabNavigator.tsx
β”‚   β”œβ”€β”€ index.tsx
β”‚   β”œβ”€β”€ types.tsx
β”‚   └── utils.tsx
β”œβ”€β”€ screens                # App screens
β”‚   β”œβ”€β”€ Home
β”‚   β”œβ”€β”€ Login
β”‚   β”œβ”€β”€ Style
β”‚   └── index.tsx
β”œβ”€β”€ translations          # translation files
β”‚   └── en.json
└── ui                    # ui component with theming
    β”œβ”€β”€ Button.tsx
    β”œβ”€β”€ ErrorHandler
    β”œβ”€β”€ Input.tsx
    β”œβ”€β”€ Pressable.tsx
    β”œβ”€β”€ SafeAreaView.tsx
    β”œβ”€β”€ Screen.tsx
    β”œβ”€β”€ Text.tsx
    β”œβ”€β”€ View.tsx
    β”œβ”€β”€ constants.tsx
    β”œβ”€β”€ icons
    β”œβ”€β”€ index.tsx
    β”œβ”€β”€ theme
    └── utils.tsx

Enable husky Git pre-hooks by adding the following script to your packages.json and reinstall dependencies to enable husky pre-commit using yarn install

   "scripts": {
      "postinstall": "husky install",
    },

🧩 Customization

πŸ“² Update App Icon & Splash screen

Replace App logo template logo.png with your logo under assets folder

Run the following command to generate App icons assets :

yarn react-native set-icon  --path ./assets/logo.png --background "#FFF"

For android icon, make sure to provide a logo with more padding and generate a new app icon for android :

yarn react-native set-icon  --platform android  --path ./assets/android_logo.png --background "#FFF"

To generate a standard splash screen using bootsplash package.

yarn react-native generate-bootsplash assets/logo.png \
  --background-color=FFFFFF \
  --logo-width=150 \
  --assets-path=assets

✏️ Custom fonts

Replace Inter.ttf font file with your fonts under assets/fonts folder

Run the following command to generate App icons assets :

yarn react-native link

More details how to customize App Icon and Splash screen

πŸ“š Read More About Modules

πŸ‘‰ https://handbook.obytes.com/docs/mobile/get-started

Releasing and building the app with Github action

πŸ‘‰ https://handbook.obytes.com/docs/mobile/ci-cd/github-action-build

πŸ”– License

This project is MIT licensed.

About

πŸ“± A template for your next React Native project πŸš€, Made with developer experience and performance first: TypeScript, Husky, Lint-Staged, react-navigation, react-query, restyle, react-hook-form, AppIcon, Splash Screen.


Languages

Language:TypeScript 61.8%Language:Java 17.9%Language:Objective-C 11.9%Language:JavaScript 4.0%Language:Ruby 2.5%Language:Starlark 1.5%Language:Shell 0.4%