Inspiration

Every year, millions of animals suffer because the systems meant to protect them are broken — fragmented, slow, and reactive. Pets go missing and are never found. Shelter animals wait months for the right adopter. Wildlife habitats collapse before anyone notices the warning signs. Livestock fall ill while farmers wait days for a vet visit.

The question that drove this project was simple: what if every animal had a digital guardian?

Not a spreadsheet. Not a paper record. A living, intelligent profile that watches, learns, predicts, and responds — in real time.

I was inspired by the way digital twins have transformed industrial engineering (aircraft engines, smart cities, manufacturing plants) and asked: why hasn't this concept reached the animal world? A Boeing engine gets a real-time AI twin. A stray dog in a Mumbai shelter does not. That asymmetry felt wrong — and fixable.

The animal welfare space also sits at a beautiful intersection of cutting-edge AI (computer vision, large language models, audio classification) and deeply human emotional stakes. It's not just a technical challenge. It's a mission.

"Give every animal a guardian." That became the north star.

What It Does

AnimaNexus is an AI-powered animal welfare platform — a unified command center that protects pets, shelter animals, livestock, and wildlife through eight intelligent modules working in concert.

Core Modules

🧬 Digital TwinCreates a living AI profile for every animal — health, behaviour, stress index, location, and risk score, updated every 30 seconds

🧠 Health AIPhoto and symptom triage using computer vision and LLMs, returning a confidence-scored risk assessment and a prioritised action plan

📍 Lost PetsVisual matching engine combined with a predictive search radius — turns your community into a distributed sensor network

🏠 Shelter & AdoptionAI compatibility ranking that matches shelter animals to adopters most likely to give them a forever home

🌍 Wildlife GuardianHabitat threat scoring, climate risk modelling, poaching alert integration, and NASA environmental event feeds

🎵 Audio InsightDecodes barks, meows, and bird calls to infer emotional state and potential distress

🚨 Emergency ResponseOne-tap SOS that classifies urgency and returns a time-critical, step-by-step first-aid action plan

The platform also has a Demo Mode for first-time visitors and a How It Works flow that explains the four-step pipeline: create twin → continuous intelligence → predict & match → act in time.

The Risk Taxonomy Risk is unified across all modules using a four-tier system:

Rscore=α⋅Hrisk+β⋅Banomaly+γ⋅Ethreat+δ⋅LmissingR_{score} = \alpha \cdot H_{risk} + \beta \cdot B_{anomaly} + \gamma \cdot E_{threat} + \delta \cdot L_{missing}Rscore=α⋅Hrisk+β⋅Banomaly+γ⋅Ethreat+δ⋅Lmissing

Where: HriskH_{risk} Hrisk = health risk score from symptom + photo analysis BanomalyB_{anomaly} Banomaly = behavioural anomaly score from audio and activity signals EthreatE_{threat} Ethreat = environmental threat score from wildlife and location data LmissingL_{missing} Lmissing = recency and radius score for lost-pet status α,β,γ,δ\alpha, \beta, \gamma, \delta α,β,γ,δ = module-specific weighting coefficients

This produces four output tiers: Low risk → Monitor → High risk → Critical, with each tier triggering different response flows.

How We Built It

AnimaNexus was built as a solo project from the ground up using a modern, performance-first stack.

Frontend & Framework

TanStack Start (React SSR) — chosen for its file-based routing, server-side rendering out of the box, and streaming HTML support. The entire homepage is server-rendered for instant first paint and full SEO indexability. Tailwind CSS — utility-first styling with a custom design token system built around OKLCH colour space for vivid neon-on-dark aesthetics (cyan oklch(0.85 0.18 200) and violet oklch(0.75 0.24 300) as the primary brand palette) Lucide React — icon library for all module and UI icons A fully custom cinematic design system including animated globe, 3D-perspective cube cards with mouse-tracking parallax, neon glow layers, and a bespoke loading screen

AI Layer

The AI layer was built around Groq's ultra-fast inference API: meta-llama/llama-4-scout-17b-16e-instruct — used for structured analysis tasks: health triage, symptom assessment, wildlife threat scoring, audio interpretation, and emergency classification llama-3.3-70b-versatile — used for the conversational AI assistant (the floating chat button), capable of answering questions about any animal, module, or situation in real time

Both models are accessed via a server-side API route (/api/chat and /api/analyze) to keep keys secure. The Groq API was chosen over alternatives for its sub-500ms response times — critical for emergency response flows where latency matters. The AI gateway was migrated from an earlier Lovable-managed integration to a direct Groq implementation for full control, better performance, and elimination of the third-party dependency.

Backend & Database

Supabase (PostgreSQL + Auth + Storage) — 13 database tables covering all eight modules: digital_twins, health_records, lost_pets, sightings shelter_animals, adoption_applications, adopter_profiles wildlife_zones, threat_events audio_sessions, emergency_events analytics_snapshots, users

Supabase Auth handles sign-in/sign-up via the /auth route Supabase Storage handles animal photo uploads used by Health AI and Lost Pets visual matching

Infrastructure Vercel — deployment platform with preview deployments on every PR, production at animanexus.vercel.app Node.js 24.x runtime CI/CD via GitHub → Vercel automatic deployments Environment variables managed in Vercel project settings: SUPABASE_URL, SUPABASE_SERVICE_ROLE_KEY, GROQ_API_KEY

External Integrations NASA EONET API — live environmental event feeds (wildfires, floods, storms) powering the Wildlife Guardian module's threat map Geolocation API — browser-native location for lost pet search radius and emergency responder proximity

Challenges We Ran Into

  1. Supabase Environment Variables in Production

The most persistent issue was Supabase environment variables not being correctly injected in the Vercel production build. The app worked perfectly in local development but threw silent errors in production whenever a server-side route tried to initialise a Supabase client. The root cause was that TanStack Start's SSR context requires variables to be available at build time AND runtime — a subtlety that caused 29+ runtime errors before we diagnosed and fixed it. Fix: Explicitly added SUPABASE_URL and SUPABASE_SERVICE_ROLE_KEY to Vercel's environment variable settings and triggered a fresh production deployment.

  1. Groq API Migration The original architecture used a Local AI Gateway as an abstraction layer over the AI calls. This worked initially but added latency, reduced control, and created a hard dependency on a third-party proxy. Migrating to direct Groq API calls required: Rewriting the /api/chat and /api/analyze server routes from scratch Switching from gateway-managed auth to direct GROQ_API_KEY management Handling streaming responses correctly in TanStack Start's server context

  2. Designing for Emotional Weight

Building a platform about animal welfare means users arrive with genuine emotional stakes — a lost pet, a sick animal, a conservation emergency. The UI had to feel serious, credible, and fast without being cold or clinical. Getting the design language right — cinematic but trustworthy, futuristic but warm — required many iterations on colour, typography, and motion design.

Accomplishments That We're Proud Of

🎨 The UI — a full cinematic design system built from scratch: animated globe hero, 3D cube cards with mouse parallax, OKLCH neon colour palette, bespoke loading screen. It genuinely looks unlike anything else in the animal welfare space. ⚡ Real AI, really fast — the Groq integration delivers sub-500ms AI responses. Health triage, emergency classification, and the conversational assistant all feel instantaneous. 🏗️ Scale of ambition — 8 modules, 16 routes, 13 database tables, 2 AI models, external NASA API integration, SSR, auth, file uploads — all shipped as a solo project. 🔒 Zero build errors — the production build is clean. Every deployment passes. No TypeScript errors, no broken imports, no missing dependencies. 🌐 Full SSR — unlike most hackathon projects that ship a blank SPA shell, AnimaNexus renders complete HTML server-side. First contentful paint is near-instant and the site is fully crawlable. 📐 Unified risk model — designing a single risk taxonomy that works coherently across pets, wildlife, shelter animals, and emergency response was a genuinely hard conceptual challenge. The four-tier system (Low → Monitor → High → Critical) gives users consistent, actionable signal regardless of which module they're in.

What We Learned

Technical TanStack Start's SSR model is powerful but opinionated — environment variables, server functions, and streaming behaviour all require careful attention to context boundaries. Groq API is exceptionally fast for inference tasks. For real-time animal triage where latency matters, it's the right choice over slower, more expensive alternatives. OKLCH colour space for CSS is a revelation for dark-mode UI design — it produces perceptually consistent neon glows that don't look washed out or oversaturated the way hex-based approaches do. Supabase RLS (Row Level Security) needs to be designed upfront, not retrofitted. Multi-table schemas with cross-module joins require careful policy design.

Product / Design Emotion-driven design is different from feature-driven design. Every interaction in AnimaNexus has to answer the question: what does someone feel when their pet is missing, or when a habitat is under threat? Fear, urgency, hope. The UI has to absorb that energy and return calm, clear, actionable information. The "digital twin" metaphor is more than a feature — it's the product's philosophy. Once you think of every animal as having a persistent digital counterpart that accumulates intelligence over time, the entire feature set follows naturally. Hardcoded stats are a credibility risk. Launching with impressive-looking numbers that aren't backed by real data undermines trust the moment a user notices. Real data, even small, is always better.

AI Prompt engineering for structured outputs — getting Llama 4 to return consistently structured JSON (risk score, confidence, recommended actions) required careful system prompt design with explicit JSON schema definitions and fallback handling. Model selection matters by task — Llama 4 Scout is better for structured analysis; Llama 3.3 70B is better for open-ended conversation. Using the right model for the right task meaningfully improves output quality.

What's Next for AnimaNexus

Push notifications — Supabase Realtime + Web Push for emergency alerts and lost pet sighting notifications Mobile app — a React Native / Expo companion app for field use (rangers, shelter workers, pet owners on the go. Multi-language support — animal welfare is a global problem. Hindi, Portuguese, Swahili, and Spanish are the first priority languages. Open API — expose the risk scoring and AI triage endpoints as a public API so NGOs, vets, and conservation organisations can integrate AnimaNexus intelligence into their own tools.

Built With

Share this project:

Updates