Code for Good: O-FISH App for Wild Aid

“Code for good” is where the MongoDB values of “think big, go far”, “make it matter” and “build together” intersect. We built the open source O-FISH app to help the not-for-profit WildAid protect our oceans. The O-FISH app consists of an iOS mobile app, an Android mobile app and a web app, that use Realm Sync for a unified data platform.

If you want to see the code in action you can build your own instance of the O-FISH app for free.

6 Likes

This project is awesome! I’m trying to build my own OFISH instance following the github site instructions. So far so good until I reach step 6 to import realm code. I’ve changed the command line from stitch-cli to realm-cli but still no luck.
stitch-cli import --strategy=replace --include-dependencies --app-id=REALM_APP_ID
realm-cli import --strategy=replace --include-dependencies --app-id=REALM_APP_ID
Question is, do I need to provide --app-name as well since it’s required? Or maybe some of the configuration.json file is wrong. Thank you!

Hi! The app name should only be required if the app is new. The instructions were tested but it’s possible things have changed with a new version (old version was called stitch-cli, new version is realm-cli). We will look into it.

1 Like

Hello Sharon_Xue,

I’m pleased to let you know that we found the issue. When stitch-cli was updated, and renamed to realm-cli, the configuration file name changed from stitch.json to the more standard config.json.

So, there are 2 changes to be made - in the WildAidDemo directory:
rename stitch.json to config.json

In the config.json, set the config_version to 20200603, so the line looks like this:
“config_version”: 20200603,

Alternatively, git pull the main branch for o-fish-realm. You will want to check that your local settings for your cluster name and app name haven’t been overwritten, e.g. start from step 3 on https://wildaid.github.io/build/2020/06/09/Import-Realm-Code.html

I hope this helps! I’m so glad you like the project.

1 Like

Thank you Sheer for your quick response. Here’s a quick update. After I made 2 changes, it seems to be working and showed that the import is done. However, when I went to Atlas to verify the code to be imported, it’s empty under the Realm App - Functions. I will do the git pull and check the previous steps to fix it then. Thanks for your help!

Hi @Sharon_Xue - just wanted to follow up - did you get the functions to import?

1 Like

Hi @Sheeri_Cabral Thanks for your follow up. I did the git pull again but couldn’t get it work. It said successfully imported however when I went to atlas to check the functions, it’s empty

So I found a Mac, followed the build steps from scrach, installed node.js and realm-cli. It said Successfully imported ‘wildaidapp-tenld’ but when I tried to verify the functions, it’s empty.

Ugh, that’s frustrating! I got that at first, when the Realm code was not complete. Can you try re-cloning the repo at GitHub - WildAid/o-fish-realm: Realm application code and sample data for the Officer's Fishery Information Sharing Hub (O-FISH). The mobile app allows fisheries officers to document and share critical information gathered during a routine vessel inspection. The web app allows agencies to gain insights from the aggregated information.? We changed the production branch name to “main” and I wonder if that had an impact. I tried to import today and it worked, so I’m hopeful it will work for you now too.

Hi @Sheeri_Cabral, it’s working after I re-cloned the repo and re-imported the data. Yay! Thanks for helping me out. I’ve tested the web app and it connects to the Realm data just imported (7 collections in total and 3039 documents in BoardingReports). Now I have the environment set up and please let me know if I can be any help with this project. Thanks again! :slight_smile:

2 Likes

Fantastic news! I’m glad it works now.

Each repository has its own issue tracker. If your focus is on web development, the React app issue tracker is at Issues · WildAid/o-fish-web · GitHub and there are a few issues marked “Good first issues”, although you can work on anything there. And I’m happy to help give you guidance if you like, if there’s something in an issue that doesn’t have all the context there. Just ask :slight_smile:

-Sheeri

1 Like