Biodiversity explorer proof of concept for Appsilon.
You use the app to select a specific specie that interests you. You can either search by Scientific Names or Common Names, but not both.
- If you search by scientific names however, the common name is deployed as a plot title for convinence.
- You can see the occurences/sightings of these animals over time. Individual sightings aren't plotted, rather the aggregated counts are.
- The App uses shiny modules to modularize code.
- It is made up of Four main Modules in total. The "DataServer", "Input" module, "Map" Module, "Timeline" Module.
- The time line modules have both UI and Server components. Both of which are composed of the Input and Data Server Modules.
- The Input and Data Server modules serve has the fundamental building blocks of the app and can be thought of as root modules.
-
The Input module contains the UI element for the sidebar where inputs are provided. The inputs here are required by the DataServer Module and as such they share a name space.
-
The MapUI and TimelineUI sub modules are composed of the Input module where a distinct namespace ID is hardcoded in the Input modules in each of this cases, this enforces that the inputs for the two modules never crash.
-
In the MapServer and Timeline server, the Data Module inherents the namespace ids described earlier. Again this ensure they both have unique computations and consistent data.
Bootstraplib is used here.
- A green theme was carefully selected to compliment the purpose of the app.
- A Navbar page is used to show that the logic is decoupled.
- A bootstrap 4 was used as it is more stable than 5.
- I had setup a cloud-based Postgres sql server. However, firewall restrictions with my company laptop made experimenting with this architecture impossible.
- To make this architecture work however. Set up a database connection with DBI, then simply replace the "test" dataset everywhere in the app with the database.
- Use DBPLYR to query the database and keep the current syntax constant. Or use SQL directly
- Cache the plots to decrease load time.
- Perform some of the logic in a different R session perharps with Plumber.
- Alternatively, use connect with a Spark Cluster and use sparklyr
-
UI test, the ui components where "snapshotted" and can be used to check for changed behaivours in the future.
-
The DataServer logic is checked for reactivity and to ensure that implemented logic for each search term is decoupled.