Seek is an app for identifying plants and animals. It is available on iOS and Android., if you'd like to help out, please see CONTRIBUTING.
- Android and iOS environment setup described in the RN docs
- Android NDK and cmake setup described in the Android developer docs
- Make sure you're running the Node version specified in
.nvmrc. Realm only works with certain versions of Node, so you will need this for local data storage. - Install dependencies with
npm install - If building for iOS, run
npx pod-installfrom within theiosdirectory.
- Go to
android/app/src/main/res/valuesand renameconfig.example.xmltoconfig.xml(and change its values to match your API keys) - Rename
config.example.jstoconfig.jsand change the JWT secret. - Add AR Camera model and taxonomy files.
- Add the example model files by executing
npm run add-example-model. If that does not work continue with the next steps. - If the download script fails: The sample model files are available in the latest release in this
repository. - On Android, these files are named
INatVision_Small_2_fact256_8bit.tflite,INatGeomodel_Small_2_8bit.tfliteandtaxonomy.csv. Create a camera folder within Android assets (i.e.android/app/src/debug/assets/camera) and place the files there. - On iOS, these files are named
smallINatVision_Small_2_fact256_8bit.mlmodel,INatGeomodel_Small_2_8bit.mlmodelandtaxonomy.json, but need to be renamed tooptimized_model_v2_13.mlmodel,geomodel_v2_13.mlmodelandtaxonomy_v2_13.json, respectively, and should be added to the Resources folder in XCode. - Unzip the common names file
commonNames.tar.gzintoutility/commonNamesto allow the AR camera to load common names in localized languages. - Copy
commonNamesIndex.examplefrom the utility directory to a new index.ts file into the new directoryutility/commonNames.
- Add the example model files by executing
- For Fastlane, add
.envfile and corresponding JSON_KEY_ANDROID file, following example in.env.example. - Add
local.propertiesfile toandroidfolder with correct sdk path to build on an Android device.
- Run
npm start - Build locally to a device or simulator by running
npm run iosornpm run android
Most third-party libraries use autolinking as of React Native 0.60.0. Any exceptions are listed in the react-native.config.js file.
We currently have three kinds of tests:
tests/integration: Tests the integration of multiple modules, e.g. a list of observation that makes requests to a mocked API, persists the response data in local storage, retrieves the data from local storage and renders components.tests/unit: Tests only specific modules, like a single component, or a hook.e2e: Tests user interactions on the finished app build running on the iOS simulator (see below).
We're using Jest and React Native Testing Library for most of our tests.
# Run all tests
npm testWe're using Detox for E2E tests. If you want to run the e2e tests on your local machine (MacOS only), make sure you fulfill the RN development requirements, see above, and also follow the test-specific environment setup.
# Build the app and run the tests
npm run e2eIf you have built the app already for a previous test, and just want to run an updated test without changing the app code, you can run npm run e2e:test.
If you are running into some issues after the tests have been working for some time, try updating applesimutils with brew update && brew upgrade applesimutils.
- One common issue in React Native involves libraries not being found by the bundler. If this happens, try
npx react-native clean-projectto clear caches and reinstall node_modules and pods.
We do our translations on Crowdin. Head over to https://crowdin.com/project/seek and create an account, and you can start suggesting translations there. We regularly export translations from Crowdin and import them to this project.
When a language is at least 20% translated on Crowdin, follow these steps to enable it in the app.
- Import translation files into
i18n.ts. - Add localized names to
utility/dictionaries/languageDict.jsfor users to be able to choose a locale in settings. - Import languages in
utility/dateHelpers.jsso date strings can be correctly translated. - Use staging to add new locales to
seek_common_names.rb. - Generate a compressed
commonNames.tar.gzdirectory via staging and copy it to your local machine - Spot check that common name translations look correct, then overwrite existing files in
utility/commonNames. - If needed, load additional files via
addCommonNamesFromFilefunction inutility/commonNamesHelpers.js.