SavePoultry

Cover Image

Inspiration

Poultry farming is the backbone of millions of households across Africa and Asia — but a single disease outbreak can destroy months of income in days. The gap isn't treatment knowledge, it's access to diagnosis. A farmer in rural Nigeria or Bangladesh often has no vet nearby, no quick way to know what's killing their birds, and no time to wait.

What inspired SavePoultry was thinking about who actually needs AI tools right now — not developers, not knowledge workers, but people whose livelihoods depend on decisions they have to make with incomplete information. A smallholder farmer watching their flock die with no idea why felt like exactly that person.

What it does

SavePoultry is a free, browser-based AI veterinarian for poultry farmers. Upload a photo of your sick bird, describe the symptoms, and Dr. Cluck — the AI vet at the core of the platform — returns a structured diagnosis with a disease name, confidence score, severity level, and treatment steps in under 30 seconds. No signup required.

Beyond the chat, SavePoultry offers five tools in one place:

  • AI Diagnosis Chat — conversational diagnosis with Dr. Cluck, powered by vision and text inference
  • Quick Scan — single photo upload for an instant structured diagnosis card
  • Disease Library — searchable reference covering 10 major poultry diseases with symptoms, transmission, treatment, and prevention
  • AI Treatment Guide — complete treatment protocols generated on demand from any disease name or symptom
  • Outbreak Map — an interactive COBE globe showing regional disease prevalence and seasonal risk data across major poultry-farming regions

How we built it

SavePoultry is built on Next.js 16 with TypeScript and Tailwind CSS. All AI features route through a single Next.js API endpoint that proxies requests to Google Gemini 2.5 Flash — handling both vision input for photo-based diagnosis and text inference for treatment protocol generation. The Gemini API key lives exclusively server-side and never touches the browser.

The frontend uses shadcn/ui for components, TanStack Query for async state, Framer Motion for transitions, and Three.js with React Three Fiber for the 3D hero scene. The Disease Library is powered by hardcoded TypeScript data for zero-latency lookups, while all AI-dependent features go through the Gemini proxy. The app is fully stateless — no database, no auth — making deployment trivial and the demo clean.

Challenges we ran into

Structured JSON output from Gemini — Getting the model to return clean, parseable JSON consistently was harder than expected, particularly for the Treatment Guide. At higher temperatures the model would ignore formatting instructions and wrap responses in markdown or prose. The fix was framing the API route as a JSON API endpoint directly in the system prompt, dropping temperature to 0.3, and adding server-side JSON extraction as a fallback before any response reached the client.

The COBE globe — COBE renders on a canvas element using WebGL, with no awareness of React's rendering lifecycle. On first load the globe would mount before the canvas had a stable size in the DOM, producing a blank render or a stretched aspect ratio that broke the 3D projection entirely. The fix was a ResizeObserver that deferred COBE's initialization until the container had settled, combined with a devicePixelRatio correction for high-DPI screens. Marker positioning was a separate battle — latitude and longitude had to be converted into COBE's internal coordinate system, and small rounding errors would place markers visibly off their intended locations on the globe surface.

Accomplishments that we're proud of

  • A fully functional AI diagnosis pipeline that accepts real bird photos and returns structured, actionable results
  • A clean, light-mode UI optimised for readability on mid-range phones in bright outdoor conditions — the exact environment our target users are in
  • Five distinct features built and polished within the hackathon window, all routing through a single secure API endpoint
  • An interactive 3D outbreak globe that makes regional disease data immediately visual and intuitive
  • Zero infrastructure requirements beyond a browser — no accounts, no downloads, no barriers

What we learned

Building SavePoultry was mostly a lesson in prompting for structured output under real conditions. The model's behavior at different temperatures, the importance of system prompt framing, and the need for server-side validation of AI responses were all things that only became clear when things broke in production. The hardest part of building for real-world impact isn't the AI integration — it's the last mile of making the output trustworthy, fast, and usable by someone who has never heard of a language model and just needs to know what is wrong with their bird.

What's next for SavePoultry

  • PWA with offline capability — so farmers in low-connectivity areas can access the Disease Library and past diagnoses without a live connection
  • Local language support — Hausa, Swahili, Hindi, and Bengali, leveraging Gemini's multilingual capabilities
  • User accounts and flock health history — persistent records so farmers can track disease patterns over time
  • Real-time outbreak data — integration with FAO and OIE surveillance feeds to replace static regional data with live alerts
  • Vet referral network — connecting farmers to verified local veterinarians directly from a diagnosis result
  • SMS-based diagnosis — extending access to feature phones with no smartphone or data plan required
  • Fine-tuned vision model — trained on a curated dataset of poultry disease images for higher accuracy and confidence scores

Built With

  • next.js
Share this project:

Updates