0.0.1 ā€¢ Published 4 years ago

react-native-template-qualquerum-alecpo v0.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

react-native-template-alecpo

āš ļø Thanks for coming, but first...let's take a selfie!šŸ¤³šŸ»

You will need to ensure that the React Native development environment is working correctly. If you haven't already, I suggest taking a look here before continuing.

āš›ļø About the project

The intent of this project is to provide a custom template for React Native developers that wishes to start a brand new application, not by the begin, but having a pre-built project with the most commons and populars libraries and a reasonable pattern for the folder hierarchy.

šŸ¤” How many different libraries do we have?

  • @react-navigation/native ā†’ Provide a powerful, easy to use and completely customizable screens navigation in React Native;
  • @react-navigation/stack ā†’ Provide a stack navigation model to use on react navigation;
  • axios ā†’ "Promise based HTTP client";
  • formik ā†’ Helper to build forms in react/react-native easily;
  • prop-types ā†’ "Used as runtime type checking for React props and to document the intended types of properties passed to components";
  • react-native-masked-text ā†’ "This is a simple masked text (normal text and input text) component for React-Native";
  • react-native-safe-area-context ā†’ "A flexible way to handle safe area", is something like a better version of SafeAreaView;
  • redux ā†’ "A Predictable State Container for JS Apps";
  • react-redux ā†’ Integration of redux to Reacts applications;
  • redux-logger ā†’ Allows to log the changes that is made in the redux state (display actions dispatches and store changes in browser console);
  • redux-thunk ā†’ Intercept an action and handle with it's behavior and results;
  • styled-components ā†’ Have a clean code with native css styling creating custom natives components;
  • yup ā†’ Validation JS tool to improve the use of Formik library;

    šŸ™ How to use it

    It's simple, just run the command bellow on your workspace directory:

    npx react-native init MyProjectName --template react-native-template-alecpo

šŸ—‚ The folder hierarchy explanation

āš ļø This topic only describes that folders and files that diverges from the original React Native template.

alecpo-template
ā”œā”€ā”€ src/
ā”‚   ā”œā”€ā”€ assets/ # Use this folder to storage any kind of assets required by your app.
ā”‚   ā”‚   ā””ā”€ā”€ img/ # Feel free to divide the images into subfolders .
ā”‚   ā”‚   ā””ā”€ā”€ svgAnimations/ # svg folder for animations (e.g: used by Lottie library)
ā”‚   ā”œā”€ā”€ components/ # Put every kind of reusable custom components here.
ā”‚   ā”‚   ā””ā”€ā”€ DivisorLine.js # custom component to divide sections or elements in a list.
ā”‚   ā”‚   ā””ā”€ā”€ Icon.js # custom provided by react-native-vector-icons.
ā”‚   ā”‚   ā””ā”€ā”€ Label.js # custom text.
ā”‚   ā”‚   ā””ā”€ā”€ SubmitButton.js # custom submit button.
ā”‚   ā”œā”€ā”€ config/ # Folder to the configurations files (e.g: API constants file, Reactotron, i18n, etc).
ā”‚   ā”‚   ā””ā”€ā”€ api.js # file to define the API's and endpoints constants.
ā”‚   ā”œā”€ā”€ navigation/ # Folder for the "navigators" of React Navigation library. Use to structure the folder hierarchy. (Hint: Do this with advance planning).
ā”‚   ā”‚   ā””ā”€ā”€ RootStackNavigator.js # initial navigator of React Nativagation library.
ā”‚   ā”œā”€ā”€ screens/ # Folder for ALL the screens files.
ā”‚   ā”‚   ā””ā”€ā”€ HomeScreen.js # Initial screen.
ā”‚   ā”œā”€ā”€ store/ # Follow the structure to use Redux in your project.
ā”‚   ā”‚   ā””ā”€ā”€ actions/ # Action types and action creators files.
ā”‚   ā”‚   ā””ā”€ā”€ reducers/ # "Reducer's" files.
ā”‚   ā”‚   ā””ā”€ā”€ storeConfig.js # "store" settings file.
ā”‚   ā”œā”€ā”€ utils/ # Helpers for your project.
ā”‚   ā”‚   ā””ā”€ā”€ customPropTypes/ # This folder contains the customs PropTypes that you probably will need.
ā”‚   ā”‚   ā””ā”€ā”€ enums/ # Enums folders.
ā”‚   ā”‚   ā””ā”€ā”€ colors.js # File to specify your application's color palette.
ā”‚   ā”‚   ā””ā”€ā”€ spacing.js # Generic pattern of spacings to your project.
ā”‚   ā”‚   ā””ā”€ā”€ strings.js # Strings constants used to prevent syntax mistakes and provide a scalable internationalization.
ā”‚   ā”‚   ā””ā”€ā”€ typography.js # Constants used to customize the "Label" component.
ā”œā”€ā”€ .prettierrc.json # Used to indent your project automatically.
ā”œā”€ā”€ babel.config.js # Allows you to use an alias on import custom modules or components (e.g: #/components/Label).
ā”œā”€ā”€ jsconfig.json # Offers autocomplete for your absolute path using alias (#/).
ā”œā”€ā”€ LICENSE # License file description.
ā””ā”€ā”€ README.md # Template documentation in markdown text.