Inspiration

Farming has always been personal to me. My dad was a farmer, his dad was a farmer, and his dad before him was a farmer too. This made me understand how much farming depends on timing, weather, and quick decisions. A crop can start showing signs of stress, but it is not always obvious whether the cause is disease, heat, water, or changing weather conditions. Small farmers often do not have immediate access to expensive crop consultants, lab testing, or advanced monitoring tools. I wanted to build something that could give farmers simple guidance from tools they already have: a phone camera, their location, and basic land information. FarmLens AI was inspired by that background. It is built to help small farmers scan a crop, check local weather risk, and get a clear 7-day action plan before crop damage gets worse.

What it does

FarmLens AI helps small farmers turn a crop photo, local weather, and land size into a simple crop risk report. A user can upload or take a photo of their crop, enter their land size, and use their current location. The app checks the local weather forecast and uses AI to analyze the crop image together with the weather conditions. The result is a clear report showing the likely crop, crop health, weather risk, low-cost next steps, watering advice, and land-size-specific guidance. It also includes a week-ahead risk calendar, which shows which days are low, medium, or high risk for that specific crop. The report can also be translated into Spanish to make the guidance more accessible.

How I built it

I built FarmLens AI with a React and TypeScript frontend and an Express backend. The frontend is a mobile first app with a simple flow: home screen, input screen, loading screen, and results screen. The user uploads a crop photo, enters land size, and uses their current location. The app stores the image preview for the interface and converts the image into base64 so it can be sent to the backend. The backend keeps the Gemini API key secure. It receives the crop image, land size, location, and coordinates. It then calls the Open-Meteo weather API to get the local forecast and sends the image plus weather data to Gemini with a structured prompt. Gemini returns a JSON report with crop health, weather risk, recommendations, and a 7-day risk calendar. I also added a translation route so the report can be translated into Spanish.

Challenges I ran into

One of the biggest challenges was learning how data moves through a React app. I had to understand props, state, TypeScript interfaces, and how to pass information from the input screen to the loading screen and then to the results screen. Another challenge was handling the crop image correctly. At first, I only had an image preview URL, which worked visually but could not be used by the backend. I fixed this by converting the image into base64 while still keeping the preview for the user interface.

Accomplishments that I am proud of

My First Hackathon!! I am proud that FarmLens AI is a working end-to-end product. A user can upload a crop photo, enter land size, use their current location, generate an AI-powered crop risk report, view a 7-day risk calendar, and translate the report into Spanish. I am also proud that the app is focused on practical, low-cost guidance for small farmers. The goal is not to replace experts, but to give farmers a faster first step when they notice crop stress. I wanted to adopt a farmer first approach.

What I learned

I learned how to build a full-stack AI app using React, TypeScript, Express, Gemini, and weather data. I learned how to pass data between components, create backend API routes, protect API keys with environment variables, and connect multiple APIs together. I also learned how important it is to structure AI responses so they can be displayed clearly in the app. Most importantly, I learned that a good AI product is not just about calling a model. The design matters. Turning the AI response into simple cards, low-cost next steps, and a 7-day risk calendar made the app much easier to understand and more useful for the user.

What's next for FarmLens AI

Next, I would like to add saved scan history so farmers can track crop health over time and compare changes across different weeks. I also want to add SMS or push alerts for high-risk weather days. If the app sees that heat, rain, humidity, or dry conditions could affect a crop, it could warn the farmer before the risk gets worse. Another next tep is expanding language support beyond Spanish, since many farming communities are multilingual. Long term, FarmLens AI could become a handy decision support tool for small farms, community gardens, and agricultural extension programs. The goal is to help farmers catch crop problems earlier, prepare for weather risks, and take simple action before crop damage becomes more serious.

Built With

Share this project:

Updates