Skip to content

DiscipleTools/disciple-tools-mobile-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Disciple Tools Mobile App

The React Native code base for the Disciple Tools mobile app.

Download the App

AppStore PlayStore

Latest status

Production Development

Team

Dependent Repo

Offline Usage

Offline Usage Guide

Basic Design Idea

Basic Design Idea

Installation (Development)

npm install
npm start
OR
expo start
  • Run in Simulator:

  • Run on device (phone) via Expo:

    • Scan the QR code above with Expo Go (Android) or the Camera app (iOS), or
    • or, manually open Expo app on phone and select appropriate option from under "Development servers"
    • (NOTE: Your phone must be on the same local network as the development computer)
  • Recently tested with the following library versions:

    • Node v14 or v16 (or should work with latest)
    • Expo CLI v5+

Issues

HTTPS

You MUST connect to a D.T. instance URL with https protocol, otherwise it will fail to connect with

"Network Error"

If you are using a local D.T. instance without SSL, you can use a service like ngrok or cloudflared to create a tunnel to an https address.

With this solution, you would then also need to change the values of home and siteurl in the dt_options table in your WP database.

Firewall

If running on a device using Expo, you may need to open the necessary port on your computer to allow expo to access the app.

DataStore

Information on the redux setup for managing data: Data Store

Tests

Run all tests:

npm run test

Design Decisions

General:

  • Offline-First (via dispatch to Redux onAppBackground & persistent FIFO request queue for API writes)
  • Aggressive data fetching, preferring to get all vs. pagination (so that data is available offline)
  • CNonce: PIN (3 sec)
  • (Coming soon) Accessibility (double as Test IDs?)

UI/Framework-specific:

  • Functional Components vs. Class
  • Modular component design to mirror D.T Post Types and Fields, and dynamically respond to API changes, and support plugins
  • Custom Hooks - map well to REST endpoints
  • SWR (stale-while-revalidate), also meets requirement for background fetching, onFocus fetching (prevent stale data on refocus of app)
  • Redux AND Context - Redux handles any persisted state, and Context is in-memory, runtime app state
  • Prefer Skeletons to Spinners, except for Button Actions
  • Minimize 3rd party dependencies where possible (eg, implement own Login form validation vs. something like Formik). Purpose: long-term maintenance (since this is an OSS project with volunteers), fewer library preference debates, less app bloat
  • SecureStore - use as much as practical
  • Component Library: N/A (removed Native Base)
  • Abstract service libraries (ie, Expo, SWR, Axios) via Hooks, in case we want to swap for something else later

Contributing

Contributing Guide