How codesbyrohit/dastak works
Dastak’s primary workflow is a community health worker completing a protocol-driven visit on a head-worn display: the app presents one question at a time, records answers, derives referral flags, and retains visit state on the device. Separate planner and review pages provide deterministic support, with optional AI limited to nonclinical ordering or aggregate descriptions. The graph reflects documented flows and sampled API dependencies; page-to-module connections are based on the README, since those page implementations were not excerpted.
Main entry points: plan.js Plan endpoint · glasses-app.js Visit app · review.js Review endpoint · engine.js Protocol interpreter
Components 18
Wearable visit
- Visit app
public/js/glasses-app.js - Protocol interpreter
public/js/engine.js - Device visit state
public/js/store.js - Visit records
public/js/record-page.js
Protocol content
- Protocol definitions
protocols - Bundled registry
public/generated/registry.js
Planning and review
- Planner page
public/js/plan-page.js - Deterministic planner
public/js/planner.js - Household roster
data/roster.json - Review page
public/js/review-page.js
API services
- Plan endpoint
api/_lib/plan.js - Review endpoint
api/_lib/review.js - Request validation
api/_lib/validate.js - HTTP guards
api/_lib/http.js - Optional AI client
api/_lib/ai.js - Protocol endpoint
api/_lib/protocol.js
Other components
- Health worker
- AI provider
Connections 20
- Health worker → Visit app: answers questions
README.md - Visit app → Protocol interpreter: interprets protocol
README.md - Visit app → Device visit state: saves visit state
README.md - Visit app → Bundled registry: loads bundled protocols
README.md - Protocol interpreter → Protocol definitions: executes steps
README.md - Visit records → Device visit state: reads visit records
- Planner page → Plan endpoint: requests ordering
README.md - Planner page → Household roster: uses household list
- Plan endpoint → Deterministic planner: computes deterministic order
api/_lib/plan.js - Plan endpoint → Bundled registry: loads demo roster
api/_lib/plan.js - Plan endpoint → Request validation: validates roster
api/_lib/plan.js - Plan endpoint → Optional AI client: requests optional ordering
api/_lib/plan.js - Review page → Review endpoint: requests summary
README.md - Review endpoint → Request validation: validates visits
api/_lib/review.js - Review endpoint → Optional AI client: requests optional description
api/_lib/review.js - Optional AI client → AI provider: sends AI request
api/_lib/ai.js - Protocol endpoint → Bundled registry: reads bundled protocol
api/_lib/protocol.js - Protocol endpoint → Protocol interpreter: resolves protocol ID
api/_lib/protocol.js - Plan endpoint → HTTP guards: uses request guards
api/_lib/plan.js - Review endpoint → HTTP guards: uses request guards
api/_lib/review.js