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.
Problem Space
Recycling apps either force signup walls before giving any value or delegate critical disposal and environmental impact logic to ungrounded LLM prompts.
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
- STAGE 01
Zero-Friction Guest Scan
Starts every browser with an anonymous session ID for instant camera/gallery scanning, manual selection, or demo items.
- STAGE 02
Gemini Vision Identification
Classifies item category, materials, and condition into strict Pydantic schemas.
- STAGE 03
Deterministic YAML Ranking
Versioned knowledge_base.yaml and impact_factors.yaml deterministically rank reuse, repair, resale, compost, and safe disposal paths.
- 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
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.