AI ranked Toyota matchmaker with swipe style discovery for Hackathon 2025.
ToyotaTinder lets shoppers enter budget and lifestyle preferences, then uses a Toyota inventory CSV plus Google Gemini 2.5 Flash to surface best fit cars for swiping, saving, and revisiting.
-
Preference intake (
/find) Simple form for budget, mileage, fuel type, use case, and notes. -
AI ranking (
/api/analyze) Sends up to 75 filtered rows fromCarData.csvto Gemini 2.5 Flash and expects JSON with selected IDs and reasoning. If Gemini fails or no API key is set, falls back to a local scoring function or random but clearly labeled matches. -
Swipe deck (
/swipe) Stacked, draggable card deck built with Framer Motion plus click buttons for like or skip. -
Persistent likes and results Matches, AI notes, and liked cars are stored in
localStorageso refreshes and navigation do not lose progress. -
Lightweight auth
/signupand/loginstore accounts and a simple session token inlocalStorage.AuthGateprotects swipe and liked routes. This is for demo only and not secure for production. -
Liked garage (
/liked) Shows all liked cars and gives a clear path to restart matching or clear saved likes.
| Layer | Details |
|---|---|
| UI | Next.js App Router with React 19, Tailwind CSS utilities in src/app/globals.css, Framer Motion animations, simple page transition wrapper. |
| Data | src/data/CarData.csv loaded on the server and converted into typed Car objects. |
| AI | @google/genai client calls Gemini 2.5 Flash with strict JSON output, with local scoring fallback. |
| State | likes.ts wraps localStorage for likes and results, AuthGate checks a tt-auth token. |
- User fills in preferences on
/find. - Server filters the CSV by budget, fuel type, mileage, and optional location.
- Up to 75 rows are sent to Gemini 2.5 Flash with
responseMimeType: application/json. - Gemini returns car IDs plus short reasoning.
- IDs map back to
Carobjects and are saved for the client. /swipeshows the deck and records likes into a saved list used by/liked.- If Gemini response is missing or invalid, the app logs a warning and uses local scoring or random selection so the demo still works.
Requirements: Node.js 20 or higher, npm 10 or higher, optional Gemini API key.
npm install
npm run dev # http://localhost:3000Environment variables in .env.local:
GEMINI_API_KEY=your-google-genai-keyWithout a key, matching still runs using the local heuristic or random fallback with a visible warning.
Useful scripts:
npm run devlocal developmentnpm run buildproduction buildnpm run startrun built appnpm run lintrun ESLint