How samruth-2005/supportlens-ai works
SupportLens AI guides a user from an IT issue report through diagnosis and one safe troubleshooting check at a time, then records a resolution or escalation. The analyze endpoint validates the request and delegates diagnosis to Gemini; the deterministic engine advances sessions from user-reported results. Session history is available through the store boundary. The README describes screenshot analysis and Supabase as capabilities or plans, but says they are not connected; those integrations are not shown as working. The route and component excerpts establish the main wiring; details of unsampled UI and storage internals are omitted.
Main entry points: troubleshoot/route.ts Advance endpoint · analyze/route.ts Analyze endpoint · index.ts Session store boundary · gemini.ts Gemini client
Components 18
User experience
- Issue entry page
app/page.tsx - Issue input
components/IssueInput.tsx - Troubleshooting view
components/TroubleshootingSession.tsx - Session timeline
components/SessionTimeline.tsx - History page
app/history/page.tsx
API and workflow
- Analyze endpoint
app/api/analyze/route.ts - Advance endpoint
app/api/troubleshoot/route.ts - Request schemas
lib/schemas.ts - Transition engine
lib/engine/index.ts - Step catalog
lib/engine/catalog.ts - Session bootstrap
lib/engine/bootstrap.ts
Diagnosis
- Gemini client
lib/gemini.ts - Diagnosis prompts
lib/prompts.ts - Seeded scenarios
lib/demo/scenarios.ts
Session state
- Session store boundary
lib/store/index.ts - Durable cookie store
lib/store/cookie.ts
Other components
- Support requester
- Gemini service
Connections 22
- Support requester → Issue entry page: opens app
- Issue entry page → Issue input: renders
- Issue input → Analyze endpoint: submits issue
- Analyze endpoint → Request schemas: validates request
- Analyze endpoint → Gemini client: requests diagnosis
- Gemini client → Diagnosis prompts: builds prompts
- Gemini client → Gemini service: sends analysis
- Gemini client → Analyze endpoint: returns diagnosis
- Analyze endpoint → Transition engine: creates session
- Analyze endpoint → Session store boundary: creates session
- Support requester → Troubleshooting view: reports check result
- Troubleshooting view → Advance endpoint: posts result
- Advance endpoint → Request schemas: validates request
- Advance endpoint → Session bootstrap: loads or seeds
- Advance endpoint → Session store boundary: loads session
- Advance endpoint → Transition engine: advances session
- Transition engine → Step catalog: resolves next step
- Advance endpoint → Session store boundary: saves session
- Advance endpoint → Troubleshooting view: returns session
- Troubleshooting view → Session timeline: renders progress
- History page → Session store boundary: lists sessions
- Session store boundary → Durable cookie store: exports implementation