Overview
The react-directory-structure is a React Native and React boilerplate that provides a structured directory setup for starting new projects. It includes reusable components, context setup, API services, navigation, error handling, and more. This boilerplate can be used as a starting point for both React Native and React Web projects.
Features
- Context API: Allows for state management and sharing data between components.
- Components / Screens: Included reusable components and screens for building user interfaces.
- Hooks: Provides custom hooks for common functionalities and state management.
- API Services Setup with apisauce: Sets up API services using the apisauce library for making HTTP requests.
- Config: Configuration setup for the project, including environment variables.
- Library Helpful functions: Includes a library of helpful utility functions for various tasks.
- Navigation: Sets up navigation for the application using a navigation library.
- Assets and Themes: Handles assets such as images and themes for consistent styling.
- Global error handling with notification: Provides a global error handler and notification system for displaying error messages.
Installation
- Copy the
srcfolder andApp.tsxfile into your React Native app. - Update the
index.jsfile with the necessary dependencies and libraries. - Install the recommended and required dependencies listed in the package.json file.
- Use App Icons Generators to generate app icons for iOS and Android.
Summary
The react-directory-structure is a useful boilerplate for setting up new React Native and React Web projects. It provides a well-organized directory structure, reusable components, state management with the Context API, API integration, navigation setup, and error handling. By following the provided installation guide, developers can quickly start new projects and build upon this solid foundation.