AI-powered production-style, zero-budget Support Assistant with automated replies and lead extraction.
- Public demo: https://client-orbit-kohl.vercel.app/
This application provides:
- Policy-aware support responses with escalation behavior.
- Lead capture from user conversations (name, email, need, urgency).
- API validation and request rate limiting.
- Persistent storage for conversations and leads.
- Next.js (App Router, TypeScript)
- Google Gemini API
- Supabase (Postgres)
- Upstash Redis (rate limiting)
- app/api/chat/route.ts: Chat endpoint and request orchestration
- app/api/health/route.ts: Health check endpoint
- app/api/leads/route.ts: Lead listing and manual lead insert endpoint
- lib/ai/provider.ts: Gemini integration and fallback logic
- lib/ai/prompts.ts: System and extraction prompts
- lib/db/queries.ts: Persistence layer for leads and conversations
- lib/rateLimit/upstash.ts: Rate limiter implementation
- lib/utils/validation.ts: Input validation schemas
- Install dependencies: npm install
- Configure environment variables: copy .env.example .env.local
- Start the development server: npm run dev
- Run checks: npm run lint npm run test
Use these variables in local and deployment environments:
- GEMINI_API_KEY
- GEMINI_MODEL
- SUPABASE_URL
- SUPABASE_SECRET_API_KEY (preferred) or SUPABASE_SERVICE_ROLE_KEY (fallback)
- UPSTASH_REDIS_REST_URL
- UPSTASH_REDIS_REST_TOKEN
- ADMIN_TOKEN
- GET /api/health
- GET /api/chat (usage helper)
- POST /api/chat
- GET /api/leads (requires x-admin-token)
- POST /api/leads
Deploy to Vercel and set all required environment variables in project settings.





