Rushit013 / RNProjectStructure

Ideal clear and organized structure for react-native with use redux applications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Imgur

React Native Project Structure

This project aims to be a strong foundation for react-native applications. It provides a clear and organized structure

Base dependencies

Usage

Option 1: Using React-Native-Rename

You can start by cloning this repository and using react-native-rename. In the current state of this project, it should give you no issues at all, just run the script, delete your node modules and reinstall them and you should be good to go.

Keep in mind that this library can cause trouble if you are renaming a project that uses Pods on the iOS side.

After that you should proceed as with any javascript project:

  • Go to your project's root folder and run npm install.
  • If you are using Xcode 12.5 or higher got to /ios and execute pod install --repo-update`
  • Run npm run ios or npm run android to start your application!

(Using yarn: yarn ios or yarn android)

Option 2: Copy the structure to your project

If you want to roll on your own and don't want to use this as a template, you can create your project and then copy the /src folder (which has all the code of your application) and update your index.js.

Keep in mind that if you do this, you'll have to install and link all dependencies (as well as adding all the necessary native code for each library that requires it).

Folder structure

This template follows a very simple project structure:

  • assets: Asset folder to store all images, vectors, fonts, etc.
  • src: This folder is the main container of all the code inside your application.
    • components: Folder to store any common component that you use through your app
    • constants: Folder to store any kind of constant that you have.
    • routes: Folder to store the navigators.
    • redux: This folder should have all your reducers and store
    • screens: Folder that contains all your application screens/features.
    • helper: Define helper functions in this folder.
    • utils: Folder to store any common function such as Analytics, Logger, DateTime, and etc.
  • App.js: Main component that starts your whole app.
  • index.js: Entry point of your application as per React-Native standards.

Modify the environment variables files in root folder (.env)

How to use it

The idea of this section is to explain how the template composition is the best and easiest to use when you try to use well-formed, architectures, especially using redux flow.

The template follows a simple and convenient exporting pattern. The folder index exposes the resources, allowing to import all from the same path.


Give a Star ⭐

If you like this project then give it a Github star by pressing the Star button ⭐


Note:

I'm currently looking for good Freelance and Contract-based work remotely (worldwide). So, if you have a good opportunity that matches my skills experience then you can contact me on my Linkedin or my email id rushitjivani1999@gmail.com πŸ™Œ


Author πŸ‘¨β€πŸ’»

About

Ideal clear and organized structure for react-native with use redux applications


Languages

Language:JavaScript 42.3%Language:Java 27.1%Language:C++ 12.6%Language:Objective-C++ 7.7%Language:Objective-C 4.2%Language:Ruby 2.8%Language:Shell 1.7%Language:Starlark 1.0%Language:CMake 0.5%