{"id":23557647,"url":"https://github.com/albersonmiranda/global_biodiversity","last_synced_at":"2025-07-30T21:16:46.800Z","repository":{"id":269494795,"uuid":"891626997","full_name":"albersonmiranda/global_biodiversity","owner":"albersonmiranda","description":"Home assignment for X Company recruitment process","archived":false,"fork":false,"pushed_at":"2025-03-27T19:05:55.000Z","size":725,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T20:22:50.630Z","etag":null,"topics":["assignment-problem"],"latest_commit_sha":null,"homepage":"https://albersonmiranda.shinyapps.io/Global_Biodiversity/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/albersonmiranda.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-20T17:02:33.000Z","updated_at":"2025-03-27T19:05:59.000Z","dependencies_parsed_at":"2024-12-24T01:30:05.321Z","dependency_job_id":"9dc74131-8396-45f2-939c-bfe3b71ee399","html_url":"https://github.com/albersonmiranda/global_biodiversity","commit_stats":null,"previous_names":["albersonmiranda/global_biodiversity"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albersonmiranda%2Fglobal_biodiversity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albersonmiranda%2Fglobal_biodiversity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albersonmiranda%2Fglobal_biodiversity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albersonmiranda%2Fglobal_biodiversity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/albersonmiranda","download_url":"https://codeload.github.com/albersonmiranda/global_biodiversity/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254447365,"owners_count":22072753,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assignment-problem"],"created_at":"2024-12-26T15:15:56.581Z","updated_at":"2025-05-16T00:31:24.915Z","avatar_url":"https://github.com/albersonmiranda.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# X Company Home Assignment\n\n## A brief description of the project and my process\nThis is my approach for the 2nd recruitment stage for X Company. This project provides [an interactive platform to explore biodiversity data from the GBIF](https://albersonmiranda.shinyapps.io/Global_Biodiversity/). Users can view datasets, maps, and timelines of species observations.\n\n## My Process\nI started by exploring the data and understanding its structure. From the very beginning, I was interested in displaying images of the species, as I was curious about what those names looked like. So, I spent my first minutes identifying foreign keys and testing whether the images were available and matched the descriptions (I checked with *Canis lupus* and ladybugs!).\n\nNext, I handled the data. I could have easily used a simple CSV for the Poland dataset, but I knew I could do more. I considered using Parquet and Feather formats but decided on `duckdb`. I’m not experienced in shipping apps; in my experience, I usually work with on-premises or cloud databases. I’m not sure how much technical debt shipping a database with the app incurs, so in a real-life scenario, I’d consult someone more experienced.\n\nI dropped all unused columns to create a lightweight database. I then tested the app's performance with the global dataset, and it performed well with 20 GB of data. However, GitHub has a 2 GB limit, so I decided to focus on Europe. Besides, I've already reached my quota on Github LFS 💸.\n\nFor the project structure, I aimed for clarity and organization. The `data-raw` folder contains scripts for downloading and processing data, `data` contains the processed data, `R` contains the modules and server, and `www` holds images and CSS. I considered breaking `style.css` into smaller files (like `buttons.css`), but I think it’s fine for now.\n\nFor the UI, I chose to use `{shinydashboard}` and reused a lot of code and styling from my previous apps. Realistically, three days while working full-time and pursuing a doctorate is a short time to develop a full-fledged app. Stack Overflow and ChatGPT were my usual allies in this journey. What I didn’t expect was the rich blog material from X Company, which was incredibly helpful. Nearly everything I needed was covered in some level of detail on your blog.\n\nFor the first module, I focused on the dataset module, which wasn’t a requirement but I think is a basic feature. Then, I realized I missed having a homepage. It’s not common in Shiny apps, but I like it because it gives a sense of completeness and professionalism to the app. I chose Poland's wildlife symbols as background images for the module buttons. I think the transparency hover effect was a nice touch—hope you like it!\n\nOnce the logic for querying the database was established in the dataset module, implementing the map functionality wasn’t much additional effort, especially since I had worked with `{leaflet}` before and found plenty of resources online, including examples very close to this assignment. I also added a checkbox to filter observations with images, which I found very appealing (I’ve enjoyed exploring the images on the map!).\n\nFor the timeline module, I initially considered defaulting to all countries to display more data and a prettier plot (as there are usually few observations for a specific species in a single country), but I didn’t think that would be smart performance-wise. I have a lot of experience with `{plotly}`, so that part was straightforward.\n\nFinally, when everything else was done, I used the \"featured projects\" section from the GBIF website to populate the homepage. This helps demonstrate the potential benefits of a homepage in communicating other projects while making the app more beautiful and engaging.\n\nNo dedicated JavaScript was needed for this project. Everything was already covered by the R ecosystem.\n\nI’m not experienced in debugging Shiny apps, so I relied heavily on the console. This was also my first time using unit tests for a Shiny app. I’ve used `{testthat}` before, but only for R packages. The tests consisted of navigating through the app and recording snapshots with `{shinytest2}`.\n\nFor deployment, I used Google Cloud Run. I’m currently working on Google’s Professional Cloud Security Engineer certification, so I’m familiar with the platform. I also have experience with containerization and Docker, so the process was smooth. I would typically integrate the deployment process with the GitHub repository and use a CI/CD pipeline, but the database size posed a problem. Using `git-lfs` would require changes to the Dockerfile, and I didn’t want to risk it.\n\nThat’s it! I hope you enjoy the app, and I’m looking forward to your feedback! I’ve learned a lot during this process, and I’m confident this experience will be valuable in my future projects.\n\n## Thanks\nSpecial thanks to my fiancée for testing the app. Before asking for her help, I thought it was complete (it wasn’t).\n\n## Author\nAlberson Miranda\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbersonmiranda%2Fglobal_biodiversity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falbersonmiranda%2Fglobal_biodiversity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbersonmiranda%2Fglobal_biodiversity/lists"}