-
Select the right version of node.
nvm use
-
Bootstrap the monorepo
pnpm install
-
Run the local dev server demoing the components.
pnpm dev
Note: this doesn't current auto-open the browser. Open
http://localhost:3000
in your browser.
- First, generate a
baseline.json
file containing all species from the user account that entered the known baseline species data. This data file will be incorporated into the curated list generation script in lieu of the data already being in iNat.
[
{
id: number;
speciesName: string;
taxonomy: []; // figure out type here
}
...
]
- Update the generation script for species data, new additions & taxon changes to factor in this data as a baseline. Accepting it as existing data.
- Do a diff of old vs new files to confirm it's correct, then delete all observations on iNat made by that account.
- One off: run the generation script, then filter out anything in
baseline.json
that's already been identified on iNat.
Okay! At this point, here's how regular usage of the script will work.
-
Run the generation script, but always have a copy of the last-ran
new-additions-data.json
file. That's essential.Store the data files in a repo. It's the only sensible way. That would simplify logging change to
new-additions-data.json
and greatly simplify debugging when issues come up (we'll have the full history). Every time you run it, it would generate new JSON files for new additions, species + taxon changes & they would be committed to the repo if any changes took place. -
Do a diff between the new additions data files (before + after). if there are new additions:
- Ping iNat (find endpoint here) to see if there's been a taxon change for the taxon IDs and names for any new additions.
- If there have been changes, examine
baseline.json
and see if any of that data is out of date. If so, set the new taxon names and IDs and re-run the generation script. - If not, it's a genuine new addition.
-
Q: What about taxon changes for the baseline data that HAVE no observations?
- these won't get updated and are effectively orphaned.
- other than looping through each one (slow!) and updating, what options do we have? Though perhaps a script to do this could be ran very rarely.
-
So part of this script would be describing how to manually create the baseline data - or providing a script to generate it from iNat.