How eswereddy/am-i-elegible-welfareschemes-openai works
The product is a multilingual Indian welfare-scheme discovery app: citizens provide a profile, receive deterministic eligibility results, then get explanations and practical follow-up tools. The API server owns request routing and delegates to the rule/catalog, persistence, and feature modules. README and sampled source support the main workflow and AI responsibilities; some feature wiring and frontend internals are not shown, so uncertain links are omitted.
Main entry points: server.js API server · ai-provider.js AI provider client · index.html Web app · schemes.js Scheme catalog
Components 21
Citizen experience
- Web app
public/index.html - Offline shell
service-worker.js - PDF report
pdf-report.js - QR report
qrcode-report.js - Follow-up reminder
reminder.js
Eligibility core
- Input validation
validate.js - Scheme catalog
schemes.js - Rule interpreter
rule-engine.js
Guidance features
- Profile parser
profile-parser.js - Result summary
ai-summary.js - Action plan
action-plan.js - Scheme chat
chat-assistant.js - Match investigator
eligibility-agent.js - Profile booster
profile-booster.js - Document checklist
document-checklist.js
API and records
- API server
server.js - SQLite records
db/index.js - AI provider client
ai-provider.js - AI cache
ai-cache.js
Other components
- Citizen
- AI providers
Connections 31
- Citizen → Web app: uses
- Web app → API server: requests checks
- Web app → Offline shell: loads cached shell
- Web app → Scheme catalog: checks offline
- API server → Input validation: sanitizes input
- API server → Scheme catalog: requests verdicts
- Scheme catalog → Rule interpreter: evaluates rules
- API server → SQLite records: reads and logs
- SQLite records → Scheme catalog: seeds metadata
- API server → Profile parser: parses profile
- Profile parser → AI provider client: generates fields
- API server → Result summary: requests explanation
- Result summary → AI provider client: generates text
- API server → Action plan: requests next steps
- Action plan → AI provider client: generates plan
- API server → Scheme chat: routes questions
- Scheme chat → AI provider client: generates answer
- API server → Match investigator: routes investigation
- Match investigator → AI provider client: runs tool loop
- API server → Profile booster: requests missing fields
- Profile booster → AI provider client: generates guidance
- API server → Document checklist: builds checklist
- Document checklist → AI provider client: generates document tips
- API server → PDF report: builds report
- API server → QR report: creates QR report
- API server → Follow-up reminder: creates reminder
- AI provider client → AI providers: calls with failover
- Result summary → AI cache: reads and writes
- Match investigator → AI cache: reads and writes
- Profile booster → AI cache: reads and writes
- Document checklist → AI cache: reads and writes