DEV Community

Cover image for Pup Card: what's your dog really thinking? (Gemini 3.5 Flash)
Asuran
Asuran

Posted on

Pup Card: what's your dog really thinking? (Gemini 3.5 Flash)

DEV Weekend Challenge: Dog Days Edition Submission πŸ•

This is a submission for Weekend Challenge: Dog Days Edition.

What I Built

Pup Card turns one dog photo into a shareable card. Drop in a photo or hit Surprise me for a random dog. Gemini 3.5 Flash reads the picture and hands back:

  • the likely breed with a confidence score, plus the mix if it is not purebred
  • the dog's mood and a plain read of its body language
  • a first-person caption, as if the dog is talking
  • two or three breed-appropriate care tips
  • a fun fact

It all renders as a card you can download as a PNG and share. I wanted something that was genuinely fun to use on a Saturday and that leaned on the one thing a multimodal model is really good at: looking at an image and saying something specific and true about it.

Pup Card reading a random dog, start to finish

Demo

Live demo: https://pupcard.vercel.app

It needs no login and runs on your phone. If you do not have a dog photo on hand, the Surprise me button pulls a random one so you can try it right now.

A finished Pup Card

Code

GitHub logo zkasuran / pupcard

Snap a dog photo, get an AI Pup Card: breed, mood and what they're thinking. Powered by Gemini 3.5 Flash.

🐢 Pup Card

Snap a dog photo and get back a Pup Card: the likely breed, a read on the dog's mood and body language, a first-person line of what they are probably thinking and a few care notes. One multimodal call to Google Gemini 3.5 Flash does the whole read.

Built for the DEV Weekend Challenge: Dog Days, for the Best use of Google AI category.

Live demo: https://pupcard.vercel.app

A Pup Card for a Bluetick Coonhound

What it does

  • Upload a dog photo (or hit Surprise me to pull a random dog from dog.ceo).
  • Gemini 3.5 Flash looks at the image and returns a structured read: breed guess with a confidence score, likely mix, mood, body language, a playful first-person caption, 2-3 care tips and a fun fact.
  • The result renders as a card you can download as a PNG and share.

No dog photo on hand? The Surprise me button means anyone can…

How I Built It

The whole read is a single generateContent call to gemini-3.5-flash. The photo goes in as inline image data next to a prompt that asks for JSON in a fixed shape. A zod schema validates the response so the front end always gets the same fields. If the model returns malformed JSON the server retries once with the parse error fed back. If the primary model is overloaded or out of quota it falls back to gemini-2.5-flash.

The stack is deliberately small:

  • Gemini 3.5 Flash through @google/genai for the read
  • TypeScript everywhere, with Hono for the local server
  • plain Node serverless functions on Vercel for /api/analyze and /api/random-dog, so there is no long-lived server to run
  • a vanilla HTML, CSS and JS front end with a <canvas> export for the downloadable card, so there is no build step and nothing shipped to the browser but three static files
  • the free dog.ceo API for the random dog

Two details I liked. Photos are downscaled in the browser before upload, which keeps the request tiny and the read fast. And the caption is where 3.5 Flash shows off: it picks up on the actual photo, the odd-colored eyes, the golden-hour light, the paw draped over a toy, instead of writing something generic.

The Gemini key stays on the server. The public endpoint has no login, so it is guarded by a size cap and a simple per-IP rate limit instead.

Prize Categories

Best Use of Google AI.

Gemini is not a feature bolted onto Pup Card, it is the product. One multimodal Gemini 3.5 Flash call does the breed identification, the mood and body-language read, the writing and the care tips, all returned as structured JSON that the card renders directly. There is no separate model, no rules engine and no template behind it.


Built over the challenge weekend. I used an AI coding assistant to help write it, then designed the prompt, reviewed the code and tested the whole thing end to end against real dog photos with live Gemini calls before shipping.

Top comments (0)