This package contains the mobile client for Field. The app is developed in React Native and the Expo CLI.
This is an Expo project created with create-expo-app
.
-
Install dependencies
npm install
-
Install pouchdb-async-storage-adapter The old pouchdb asyncstorage adapter here is no longer maintained nor it updated with the latest version of pouchdb. instead we are using an updated fork which at the time of writing this document is not yet clear what would be the final name/url for this package and thus needs to be installed locally for now using yalc.
- in a separate folder clone the fork
git clone [email protected]:neighbourhoodie/pouchdb-asyncstorage-adapter.git
cd pouchdb-asyncstorage-adapter
npx yalc publish
- go back to mobile app folder and run
npx yalc add @neighbourhoodie/pouchdb-asyncstorage-adapter
this will link the adapter so it can be bundled with the app. if you get this error while building the app after an npm install38 | type Registry<TEventToArgsMap: {...}> = { > 39 | [K in keyof TEventToArgsMap]: Set<Registration<TEventToArgsMap[K]>>, | ^ 40 | }; 41 | 42 | /**] ``` you need to run `npx yalc add @neighbourhoodie/pouchdb-asyncstorage-adapter` again after npm install.
- in a separate folder clone the fork
-
Start the app
npx expo start
-
Run iOS
npm run ios
In the output, you'll find options to open the app in a
- development build
- Android emulator
- iOS simulator
- Expo Go, a limited sandbox for trying out app development with Expo
You can start developing by editing the files inside the mobile directory.
This project uses file-based routing.
Run eslint with
npm run lint