Coder Social home page Coder Social logo

luonglh90 / rnprojectstructure Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rushit013/rnprojectstructure

0.0 0.0 0.0 719 KB

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

Shell 1.74% JavaScript 42.35% Ruby 2.83% C++ 12.61% Objective-C 4.15% Java 27.11% Objective-C++ 7.68% CMake 0.49% Starlark 1.04%

rnprojectstructure's Introduction

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 [email protected] 🙌


Author 👨‍💻

rnprojectstructure's People

Contributors

rushit013 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.