Skip to main content
Back to ArchiveSYSTEMS ARCHIVE
06 // Full-Stack AI PWALive • 109 Tests + Evals

WasteVisor

Guest-first installable PWA waste advisor combining Gemini Vision identification, a deterministic YAML ranking & impact engine, Groq step-by-step execution kits, and stateless Neon Better Auth (EdDSA/JWKS) with atomic guest session claiming.

RoleFull-Stack & AI Systems Engineer
ContextLive Production PWA (v1.0.0)
Live DemoSource Code
Test Suite
109 Tests
Ranking Engine
YAML + Evals
Auth Layer
EdDSA / JWKS
01 // THE BOTTLENECK

Problem Space

Recycling apps either force signup walls before giving any value or delegate critical disposal and environmental impact logic to ungrounded LLM prompts.

02 // THE SYSTEM

Production Architecture

An installable Next.js PWA lets guests scan items immediately; FastAPI pairs Gemini Vision with a versioned deterministic YAML rule/impact engine, Groq action guides, and stateless JWKS JWT auth that atomically claims prior guest history on sign-in.

Execution Pipeline

  1. STAGE 01

    Zero-Friction Guest Scan

    Starts every browser with an anonymous session ID for instant camera/gallery scanning, manual selection, or demo items.

  2. STAGE 02

    Gemini Vision Identification

    Classifies item category, materials, and condition into strict Pydantic schemas.

  3. STAGE 03

    Deterministic YAML Ranking

    Versioned knowledge_base.yaml and impact_factors.yaml deterministically rank reuse, repair, resale, compost, and safe disposal paths.

  4. STAGE 04

    Groq Kits & Atomic Claim

    Generates tailored execution steps via Groq; optional Email/Google/GitHub sign-in verifies EdDSA JWTs via remote JWKS and merges guest records atomically.

Key Engineering Trade-Offs & Decisions

  • Separated perception (Gemini Vision), deterministic decisioning (YAML rules + backend/evals/ harness), and prose generation (Groq) to prevent disposal hallucinations.
  • Implemented stateless PyJWT[crypto] EdDSA/JWKS verification against Neon Better Auth with zero shared session tables.
  • Built atomic guest-to-user migration (POST /api/auth/claim-session) so /impact history transfers cleanly without data loss.
  • Automated lint, typecheck, and 109 pytest tests in GitHub Actions CI before deploying to Vercel + Azure ACA.

Tech Stack

Next.jsTypeScriptFastAPIGemini VisionGroq APINeon PostgreSQLBetter AuthTailwind v4DockerAzure ACA
Deployment & Runtime

Live at wastevisor.vercel.app; non-root FastAPI container (ghcr.io/tusharsingh-sde/wastevisor-backend:v1) on Azure Container Apps (centralindia) with pooled Neon PostgreSQL.

Open-source repo: PRs, issues, and feature collabs are always welcome on GitHub.