Mobile-friendly Next.js app connecting restaurants and pantries with people nearby who can claim edible surplus before it expires.
Donors photograph leftovers; a free local Food-101 classifier (ONNX via @huggingface/transformers) suggests listing details (with offline / rate-limit fallback). Recipients browse a map, claim portions, and optimize a multi-stop pickup run.
Live: https://kyhacks.vercel.app
Stack: Next.js 15 · Prisma · Supabase Postgres · Auth.js · Food-101 ONNX · Leaflet · OSRM · Vercel
Docs: docs/ · PRD · TRD · Supabase · Deploy
git clone https://github.com/defAaron/kyhacks.git
cd kyhacks
npm install
cp .env.example .env
# Set DATABASE_URL + DIRECT_URL (Supabase) and AUTH_SECRET
# See docs/setup/SUPABASE.md
npx prisma db push
npm run db:seed
npm run dev| Variable | Required | Notes |
|---|---|---|
DATABASE_URL |
Yes | Supabase Transaction pooler URI |
DIRECT_URL |
Yes | Supabase direct URI (Prisma push) |
AUTH_SECRET |
Yes | openssl rand -base64 32 |
AUTH_URL |
Prod | https://kyhacks.vercel.app locally http://localhost:3000 |
NEXT_PUBLIC_DEFAULT_CITY_LAT/LNG |
No | Louisville defaults |
VISION_* |
No | Local Food-101 CPU quotas |
| Command | Purpose |
|---|---|
npm run dev |
Dev server (Turbopack) |
npm run build / npm start |
Production build & serve |
npx prisma db push |
Apply schema to Supabase |
npm run db:seed |
Demo users + Louisville listings |
npm run lint |
ESLint |
Password for all: demo1234
| Role | |
|---|---|
| Donor | [email protected] |
| Donor (2nd stop) | [email protected] |
| Recipient | [email protected] |
- Explore —
/exploreseed listings on map + list (Louisville). - Donor listing —
[email protected]→ New listing → photo → confirm AI fields → publish. - Claim —
[email protected]→ claim portions → Claims. - Pickup run — claim a second stop → optimize route.
- Expiry — past
pickupEnd→ not claimable.
Vision: local Food-101 ONNX. On Vercel, offline/manual entry may appear if the model cannot load — listing still works.
src/
app/ # routes + API
components/
home/ explore/ listings/ donor/ auth/ layout/ motion/ ui/
lib/
auth/ db/ vision/ routing/ # domain modules + barrels
schemas.ts storage.ts …
docs/
product/ setup/ engineering/
prisma/ # schema + seed (Postgres)
- Donors remain responsible for food handling and safety.
- Allergen suggestions are assistive — staff must confirm.
- Public explore does not expose recipient identity.
- Coordination tool for surplus-share demos, not a certification service.