Privacy-preserving USC-only student marketplace: ZKP-based access, cross-session identity, no PII stored.
- Enrollment: Google Sign-In (@usc.edu) or dev email; backend verifies token but never stores email or Google
sub. - Access: Client proves membership (ZK proof + stableId); backend issues JWT with
sub = stableId(stable pseudonym). - Data: Listings and chats keyed by
owner_id/sender_id/recipient_id= stableId only. No PII in DB.
- Enroll: Sign in with Google (@usc.edu) or use dev email → client creates identity, sends
idToken+identityCommitment. Backend verifies token (hd, email_verified), adds commitment to group, discards token. - Login: Client fetches group root, generates proof, computes stableId → sends proof + stableId → backend verifies, returns JWT with
sub = stableId. - Listings / Chats: Create and query by
req.user.sub; same identity gets same sub across sessions.
backend/: Express API (enroll, group-root, verify-proof, listings, chats, ai-chat).frontend/: Next.js (Google Sign-In, ZKP proof, listings & chats UI).frontend/components/AIChatbot.jsx: Floating AI chat widget (Tommy Trojan) powered by Groq. Shows real listings with images, supports markdown responses, and requires JWT authentication.shared/: Constants (no PII).docs/: Architecture and cross-session identity.
- PostgreSQL:
docker compose up -d(or setDB_URL). - Env: copy
backend/.env.exampletobackend/.env; setDB_URL,JWT_SECRET,GOOGLE_CLIENT_ID. Frontend:.env.localwithNEXT_PUBLIC_GOOGLE_CLIENT_ID(same value). - AI Chatbot: Get a free Groq API key at https://console.groq.com and add
GROQ_API_KEY=your-keytobackend/.env. Install the SDK:cd backend && npm install groq-sdk. - Install:
npm install - Backend:
npm run dev:backend - Frontend:
npm run dev:frontend - Optional seed:
npm run init-group
A floating chat widget powered by Groq (llama-3.3-70b-versatile) that helps USC students navigate the marketplace.
Features:
- Shows real listings from the database with images and clickable links
- Responds only based on actual marketplace data — no made-up listings
- Requires JWT authentication (only accessible to verified USC students)
- Supports markdown formatting for clean, readable responses
- Clear chat button to reset the conversation
- Privacy-safe: never references or stores any PII
To use:
- Log in with your USC account
- Click the 🤖 button in the bottom-right corner
- Ask Tommy Trojan anything about the marketplace!
Example questions:
- "Show me all listings"
- "Are there any items under $20?"
- "Help me write a listing description for my laptop"
- "What categories are available?"
Controlled by env (no PII is ever logged).
- Backend:
LOG_MODE=disabled|basic|verboseinbackend/.env(default:basic). - Frontend:
NEXT_PUBLIC_LOG_MODE=disabled|basic|verbosein.env.local(default:basic).
| Mode | Backend | Frontend |
|---|---|---|
| disabled | No logs from app logger | No logs from app logger |
| basic | Request method/url/status, auth/zkp outcomes | API path + method, zkp step names |
| verbose | Basic + body keys, timings, step details | Basic + response keys, durations |