Giter VIP home page Giter VIP logo

t-528-simpleapp's Introduction

React-Native Monorepo: SimpleApp

"SimpleApp" is an app which uses Firebase for authentication & data storage.

This is upgrade work to other monorepos; i.e. ticket.524 & ticket.526. The repos are examples for how to share code between different platforms (Web, Android, & iOS). They can be used as a template or starter-kit for React-Native & React-Native-Web. The key to code sharing is React-Native's Platform-specific extensions. The extensions are .native.js , .ios.js or .android.js and when used, the relevant platform file is compiled.

The main benefit of any monorepo is to share application logic. Another benefit is the rendering of individual components unique to each platform. Development is mobile-first AND then webapp.

Installation

Required: React-Native working per Getting Started. If using React-Native ^0.60 , make sure
you review the blog post & use the upgrade guide. As notes in those links, update these files

  • Change root/android/build.gradle as needed
  • Change root/android/app/build.gradle as needed
  • Change root/android/gradle.properties as needed
  • etc

Run

For each platform, from the root directory, do

Web

  • node_modules/.bin/webpack -p --progress
  • node_modules/.bin/webpack-dev-server --content-base public/ --config ./webpack.config.js --port 3001 --inline --hot --colors
  • Manually open a browser to localhost:3001 to see webapp
  • Inspect browser window = open console to see shared code working on button click

Android

  • react-native run-android -- --clear-cache

iOS

  • react-native run-ios or open ios/SimpleApp.xcodeproj with Xcode

Animated GIFs

Animated GIF - Web Existing User Animated GIF - Android New User Animated GIF - Android Existing User Animated GIF - iOS New User Animated GIF - iOS Existing User

Notes - Development

  • To keep code simple, Email verification not used
  • Button is common CSS ; it is not a React Component
  • React Router aka 1 package used as Navigational Components
  • Form Input Error checking is basic ; repo user can refactor as needed
  • Password Authentication and Password Resets (via Firebase), left as exercise to repo user
  • Additional Social Logins, e.g. Facebook or Twitter, for web & mobile, left as exercise to repo user

Notes - Miscellaneous

  • To make code easy to use & follow, Redux is omitted.
  • React props is used for web / mobile & React state is used for web / mobile.
  • Lerna or Yarn Workspaces is not used ; there is only 1 node_modules folder.

Inspiration

t-528-simpleapp's People

Contributors

ottograjeda avatar

Watchers

James Cloos avatar  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.