← Back to browser
examples

Production AI Dog Breed Identifier & Care Guide

This is a submission for Weekend Challenge: Dog Days Edition Have you ever looked at a dog at the...

*This is a submission for [Weekend Challenge: Dog Days Edition](https://dev.to/challenges/weekend-2026-08-13)*

Have you ever looked at a dog at the park or in an adoption shelter and wondered: *"What breed is that, and what kind of care does it need?"*

Meet **BreedSnap**, a production-grade, full-stack canine intelligence web application powered by **Google Gemini Multimodal Vision AI**. With just a single photo, BreedSnap instantly identifies the dog breed, scores temperament and energy traits, generates a veterinary-grade care guide, and lets you download a verified PDF breeding report with one click.

---

What I Built

**BreedSnap** transforms any canine photo into an actionable, comprehensive genetic and breed profile.

Instead of returning a simple text label, BreedSnap delivers a complete companion intelligence profile:

---

Demo

---

Code

The entire codebase is open-source and available on GitHub:

**Repository Link**: [https://github.com/inusha-thathsara/Weekend-Challenge-Dog-Days-Edition---Breed-Identifier](https://github.com/inusha-thathsara/Weekend-Challenge-Dog-Days-Edition---Breed-Identifier)

---

How I Built It

1. Architecture & Tech Stack

BreedSnap was designed with speed, privacy, and visual excellence in mind:

---

2. Prompt Engineering & Structured Gemini Vision

To ensure consistent veterinary outputs, Gemini is guided with structured system instructions and `responseMimeType: "application/json"`:

const prompt = `You are a world-class veterinarian and canine genetics expert. Analyze this dog photo carefully.
Respond strictly with valid JSON only (no markdown fencing, no backticks, no explanatory comments).

If the image clearly contains a dog, return:
{
  "isDog": true,
  "breed": "Official breed name (e.g. Golden Retriever, French Bulldog)",
  "confidence": "High (98%) / Medium (85%) / Low (60%)",
  "origin": "Country / Region of origin",
  "summary": "Engaging 2-3 sentence overview of this breed's character and heritage.",
  "temperament": ["Trait 1", "Trait 2", "Trait 3", "Trait 4"],
  "size": "Size category and typical adult weight range (lbs & kg)",
  "lifespan": "Typical life expectancy in years",
  "ratings": {
    "energyLevel": 1-5,
    "groomingDemand": 1-5,
    "trainability": 1-5,
    "childFriendliness": 1-5,
    "barkingTendency": 1-5
  },
  "careGuide": {
    "exercise": "Recommended daily exercise schedule and activity types",
    "grooming": "Coat maintenance and grooming frequency",
    "nutrition": "Dietary requirements or sensitivities",
    "healthWatchlist": "Common genetic health conditions to monitor"
  },
  "funFacts": [
    "Fascinating historical or behavioral trivia item 1",
    "Fascinating historical or behavioral trivia item 2"
  ]
}

If the image does NOT contain a dog:
{
  "isDog": false,
  "message": "A friendly, witty description of what is actually visible in the image."
}`;

---

3. Resilient Multi-Model Fallback Cascade

To guard against high-demand traffic spikes and quota limits, the backend implements an automatic fallback cascade across Gemini models: 1. `gemini-3.1-flash-lite` (ultra-fast latency & high throughput) 2. `gemini-3.7-flash` (deep multimodal reasoning) 3. `gemini-3.5-flash` (high-capacity fallback)

If any model encounters high demand or temporary unavailability, the request seamlessly transitions to the next model without failing the user experience.

---

4. Official PDF Report Generation

Rather than a simple screenshot, clicking **Download PDF Report** dynamically constructs a high-resolution, branded certificate offscreen, formatting:

---

What's Next for BreedSnap?

---

*Thank you for reading! Feel free to check out the live demo and share your feedback in the comments.*

Have questions about this article?

Ask DocuMind