Disciple Tools Mobile App
The React Native code base for the Disciple Tools mobile app.
Download the App
Latest status
Production |
Development |
|
|
Team
Dependent Repo
Offline Usage
Offline Usage Guide
Basic Design Idea
Installation (Development)
- Set up Expo
- Clone this repository
- Download the "Expo" app on iOS or Android:
- Run the following commands:
npm install
npm start
OR
expo start
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