This project is a React Native boilerplate that can be used to kickstart a mobile application.
The boilerplate provides a solid foundation for building cross-platform mobile applications. It emphasizes a clear separation of concerns between the UI and business logic, making it easier to maintain and scale your mobile app.
If you like the project, give us a star π€©.
- Requirements
- Quick Start
- Dependencies
- Dev Dependencies
- Folder Structure
- License
- About Us
- Contributing
Node 18 or greater is required. Development for iOS requires a Mac and Xcode (please use the latest version).
You also need to install the dependencies required by React Native.
Go to the React Native environment setup, then select React Native CLI Quickstart
tab.
Follow instructions for your given development OS
and target OS
.
To initialize a new project using this boilerplate, run the following command:
npx react-native@latest init AwesomeProject --template @gbrlcoelho/react-native-boilerplate
- React Native - A framework for building native apps with React.
- React Navigation - Routing and navigation for your React Native apps.
- react-hook-form - Performant, flexible and extensible forms with easy-to-use validation.
- react-native-mmkv - MMKV is an efficient, small mobile key-value storage framework.
- @tanstack/react-query - Powerful asynchronous state management for React.
- react-native-svg - SVG support to React Native on iOS, Android, macOS, Windows, and a compatibility layer for the web.
- @shopify/restyle - A type-enforced system for building UI components with React Native.
- axios - Promise based HTTP client for the browser and node.js.
- date-fns - Modern JavaScript date utility library.
- @hookform/resolvers - Resolvers for react-hook-form.
- zod - TypeScript-first schema declaration with static type inference.
- zustand - A small, fast and scalable bearbones state-management solution.
- @tanstack/eslint-plugin-query - ESLint plugin for react-query.
- jest - A delightful JavaScript Testing Framework with a focus on simplicity.
- testing-library/react-native - Simple and complete React Native testing utilities that encourage good testing practices.
- babel-plugin-module-resolver - A Babel plugin to add a new resolver for your modules when compiling your code using Babel.
- cz-conventional-changelog - Commitizen adapter following the conventional-changelog format.
- eslint-plugin-import - ESLint plugin with rules that help validate proper imports.
- husky - Git hooks made easy.
- lint-staged - Run linters against staged git files and don't let π© slip into your code base!
- prettier - An opinionated code formatter.
- msw - Mock Service Worker is an API mocking library for browser and Node.
- react-native-dotenv - A Babel plugin that allows you to use environment variables in your React Native app.
The folder structure of this boilerplate is explained below:
.
βββ src
β βββ api
β β βββ apiConfig.ts
β β βββ index.ts
β βββ assets
β β βββ brand
β β βββ fonts
β β βββ icons
β βββ components
β β βββ index.ts
β βββ domain
β β βββ Auth
β β β βββ adapter.ts
β β β βββ api.ts
β β β βββ service.ts
β β β βββ types.ts
β β βββ index.ts
β βββ hooks
β β βββ index.ts
β βββ infra
β β βββ hooks
β β βββ index.ts
β β βββ types.ts
β βββ routes
β β βββ index.ts
β βββ screens
β β βββ index.ts
β βββ services
β β βββ index.ts
β βββ test
β β βββ server
β β β βββ handlers.ts
β β β βββ server.ts
β β βββ jestSetup.ts
β β βββ test-utils.tsx
β β βββ index.ts
β βββ theme
β β βββ theme.ts
β βββ types
β β βββ index.ts
β βββ utils
β βββ index.ts
βββ .env
.
This folder is the main container of all the code inside your application.
This folder contains all the api related stuff like apiConfig.
This folder contains all the assets of your application like brand, fonts and icons.
This folder contains all the shared components of your application.
This folder contains all the domain related stuff like use cases, services, adapters and types.
This folder contains all the custom hooks of your application.
This folder contains all the infrastructure of react query like hooks and types.
This folder contains all the routes of your application.
This folder contains all the screens of your application.
This folder contains all the internal services of your application like MMKV, zustand and etc.
This folder contains all the test related stuff like server, jestSetup, test-utils and etc.
This folder contains @shopify/restyle theme of your application.
This folder contains all global types of your application.
This folder contains all the utility functions of your application.
This project is licensed under the MIT License - see the LICENSE file for details.
I am a mobile developer and I love to create beautiful and performant mobile applications, if you want to talk about it, please contact me.
If you find any problems, please open an issue or submit a fix as a pull request.