DEV Community

Cover image for CropShield: Rainfall Reporting for Smart Approvals
Nandini Sivakumar
Nandini Sivakumar

Posted on

CropShield: Rainfall Reporting for Smart Approvals

This is a submission for the GitHub Copilot Challenge : New Beginnings

What I Built

_1. App Overview
The app collects latitude, longitude, and a date as input to provide the rainfall quantity for that location and time. The data can then be used by crop insurance agencies to assess whether funds can be approved based on predefined thresholds or eligibility criteria.

  1. Key Features User Input: Latitude & Longitude: Determines the geographic location. Date: Fetches historical or forecasted rainfall data for the specified date. Data Output: Rainfall Quantity: Displays the total rainfall (e.g., in mm or inches) for the location and date. Recommendation: Suggests whether the conditions meet the eligibility for insurance payouts.
  2. Functional Workflow Input Stage: User enters latitude, longitude, and date. The app validates inputs (e.g., correct formats, valid date ranges). Processing Stage: Rainfall Data Retrieval: Fetch rainfall data using APIs (e.g., OpenWeatherMap, NOAA, or Climate Data APIs). Parse and process data for the given inputs. Output Stage: User receives a detailed report: Rainfall quantity. Date and location._

Demo

Image description

Repo

https://github.com/FTNJAYABA/rainfall_weather_insurance.git

Copilot Experience

_Overview of Copilot Usage
I used GitHub Copilot throughout the development of my rainfall app, leveraging its prompts, autocomplete, and chat features to streamline the process from prototyping to completion."

  1. Prompts

Used comments like # Fetch rainfall data using latitude, longitude, and date to generate boilerplate code for API calls and business logic.
Saved time by quickly producing reusable code snippets.

  1. Autocomplete

Assisted in completing API request structures, CLI inputs, and formatting output.
Example: Automatically filled parameters for requests.get() based on context.

  1. Edits and Refinements

Reviewed and tweaked Copilot’s suggestions to handle edge cases (e.g., error handling for API calls).
Combined Copilot's logic with manual adjustments for custom business rules.

  1. Chat and Debugging

Asked Copilot for solutions, like input validation for latitude/longitude and data comparison logic.
Its suggestions accelerated problem-solving and debugging._

GitHub Models

Yes, I used GitHub Copilot to assist with prototyping LLM capabilities in my rainfall app. Here's how:

  1. Code Generation with Prompts

I wrote descriptive comments like # Fetch rainfall data using latitude, longitude, and date to guide Copilot in generating API call logic and data validation.
This streamlined the process of building key functionalities like fetching and processing weather data.

  1. Autocomplete and Refinements

Copilot’s autocomplete feature helped draft functions and complete logic, such as comparing rainfall data to thresholds for eligibility.
I reviewed and refined these suggestions to align with the app’s specific requirements.

  1. Leveraging Chat for Contextual Help

Used Copilot’s chat feature to debug issues and get ideas for enhancing functionality, such as validating user inputs or handling API errors.
It also suggested reusable templates for CLI-based outputs.

  1. Exploring LLM Integration

Used Copilot to prototype logic for integrating LLM APIs (like OpenAI) to generate explanations for eligibility decisions. For example, it suggested prompts like:
Explain why rainfall of {value} mm meets eligibility criteria._

Conclusion

_Copilot saved significant time by automating repetitive tasks and providing context-aware suggestions. While some manual refinements were needed, it proved to be an invaluable coding assistant.
_

Sentry blog image

How to reduce TTFB

In the past few years in the web dev world, we’ve seen a significant push towards rendering our websites on the server. Doing so is better for SEO and performs better on low-powered devices, but one thing we had to sacrifice is TTFB.

In this article, we’ll see how we can identify what makes our TTFB high so we can fix it.

Read more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay