Skip to content

ericfly02/BeeMovr

Repository files navigation



Logo


Who are we?


Google Maps, but for beekeepers. We called beekeepers all over the country and asked them, "We want to help you save bees. What can we do for you? We can program."

Keith Robert from the Valley Hive in California explained that beekeepers are sometimes forced to relocate their beehives - e.g. California drought - and they can't just move into any location. They need to find an area that has the highest survival rate and the best nectar availability for their colonies. That's how BeeMovr started.


Getting Started

1. How to spin up a development server
2. How we deploy to beemovr.com
3. How does this work?


Acknowledgement

Special thanks to Keith Robert from The Valley Hive, our favorite beekeeper.

Also, our work would not have been possible without the paper "The Impact of Precipitation and Temperature on Honey Yield in the United States" (Hayes Kent Grogan, 2020, Auburn University). This paper is what made our core prediction model possible.

BeeMovr is a HackMIT and Call for Code project.


Call for Code

Architecture diagram of BeeMovr

Stack Name
CDN Cloudflare
Reverse Proxy Nginx
Deployment Containerized with Docker + server runtime with Node.js
Front-end Next.js client-side components + OpenStreetMap interactivity from Mapbox
Back-end Next.js server-side components + real-time weather data from Open Meteo API
Experimental Machine learning with IBM Cloud watsonx.data + persistent data handling with IBM Cloud PostgresSQL

The issue we are addressing

☐ Brief description of "The issue we are hoping to solve" (2-3 sentences)
This should be a short description, 2-3 sentences in length, of the specific sustainability problem your solution is meant to address.

Whenever beekeepers need to relocate their colonies, they need to find an area that has the higest survival rate and the maximum potential for honey yield. BeeMovr allows our users (beekeepers ♥) to do exactly that.


What BeeMovr does

☐ Description of "How our technology solution can help" (approximately 10 words)
This is where you will give a short description of your team's technology solution, in about 10 words.

We can calculate honey-yield prediction value of any given coordinates.


The idea behind BeeMovr

☐ Long description of your team’s solution (approximately 500 words)
This is a longer description of your solution.
In about 500 words, describe your solution in more detail.
Include the real-world problem you identified, describe the technological solution you have created, and explain how it's an improvement over existing solutions.
You can supply additional documentation in this source code repository that you link to as well.

BeeMovr pulls in real-time precipitation, maximum temperature, and minimum temperature data from Open Meteo API, and calculates a prediction of the maximum possible honey yield value of any given coordinates on the map based on Hayes Kent Grogan's paper. Our project seeks to give beekeepers increased information about ideal pollinator conditions near them to increase colony survival rate and reduce uncertainty. We focused on researching the most accurate model possible. Currently, we use a linear regression model with the factors of precipitation, maximum temperature, and minimum temperature. Further, we plan to use IBM watsonx.data to pull combined data from USDA (U.S. Department of Agriculture) and NASS (National Agricultural Statistics Service) for improved prediction models.

We're also trying to increase prediction accuracy by ingesting colony-specific demographic data into our prediction model, as colony demographic data such as the age of the queen were found to be statistically significant, as discovered by Grogan's 2020 paper. Currently, we rely on Next.js built-in request memorization caching to avoid duplicate API calls. This process is fairly efficient. However, we believe the data fetching process can be improved by implementing IBM Cloud PostgresSQL to cache and store all precipitation & temperature requests { key: latLng, values: [precipitation, maxTemp, minTemp] }. These data, in turn, will be used in conjunction with IBM watsonx.data to improve our prediction models.

We envision BeeMovr to become the de-facto map for helping beekeepers make an informed decision about what's best for their bees. What we're trying to do here is to make our project helpful for our beekeepers as best as we can. We aim to create the beekeeper's map, the first feature of which is maximum potential honey yield prediction, but as we iterate with our beekeepers, we'll listen to what their (and their bees') needs are, and we'll incrementally add those features. We therefore believe the most important part of BeeMovr is to listen, understand, and deliver what the beekeepers want and need to serve their bees.

As we promised our beekeeper Keith Robert, BeeMovr has been and will always be open-sourced and open to all beekeepers. If you're a beekeeper and have any suggestions or feature requests, please feel free to email us at <workerbees@beemovr.com>. Our program is up and online at beemovr.com and we are Schaler Starks <schaler@beemovr.com>, Eric Gonzalez Duro <eric@beemovr.com>, Jasper Ha <jasper@beemovr.com>, and Soobin Rho <soobin@beemovr.com>. If you share our goal to make a positive impact on environmental sustainability by helping beekeepers and their bees, you're welcome to join us and feel free to make pull requests on any feature you think is the best for BeeMovr.

Timeline of BeeMovr development

1. How to spin up a development server

# ---------------------------------------------------------------------
# Development workflow.
# ---------------------------------------------------------------------
cd BeeMovr

# Install pnpm: package manager that is faster and more disk efficient
npm install -g pnpm
pnpm setup

# If you're using zsh:
source ~/.zshrc

# If you're using bash:
source ~/.bashrc

# Install dependencies.
pnpm install

# Go to https://mapbox.com and get an API token.
# Then, copy and paste the token to `.env.local` file.
cp ./.env.development ./.env.local

# Run a development server.
pnpm dev

2. How we deploy to beemovr.com

# ---------------------------------------------------------------------
# Deployment workflow.
# ---------------------------------------------------------------------
# Our server is an Ubuntu box on Hetzner with 3 vCPU, 4GB RAM, and
# 80GB SSD, which amounts to only $8 per month. We wanted to make our
# program as sustainable as possible, so we tried to use the most
# reliable, yet the most inexpensive server available.
ssh <username>@<ip address>
cd ~
git clone https://github.com/soobinrho/BeeMovr
cd BeeMovr/docker

# For development purposes, just running `cd ./BeeMovr && pnpm dev` is
# perfect, and in fact that is how we run a development server all the
# time for testing purposes. However, if you want to run a production
# server, by which we mean deployment to a server so that it becomes
# available to everyone on the internet, we use Docker Compose to
# deploy Next.js through Node.js and reverse proxy that through Nginx.
docker compose up -d

# ---------------------------------------------------------------------
# How we re-deploy whenever we make changes to our code.
# ---------------------------------------------------------------------
cd BeeMovr/docker
git pull
docker compose build --no-cache
docker compose up --force-recreate -d

3. How does this work?

We created a separate section for all of our development logs.