How adityakeerti/anand-kosh works
Anand Kosh is a role-aware clinical portal for patient records and medical documents. Staff create or update patient profiles, then upload and manage categorized records; observers have read-only access, while administrators also use reporting, scheduling, reminders, and migration tools. The Next.js portal exposes API route handlers backed by Prisma/PostgreSQL, with Google Drive used for document files and patient folders. The README identifies the main portal controller, but its UI-to-endpoint wiring is not shown in the sampled source, so those links are omitted.
Main entry points: db.ts Database client · patients Patient records API · auth.ts Auth and roles · documents Document API
Components 19
Portal
- Portal interface
src/app/page.tsx
Identity
- Authentication API
src/app/api/auth - Auth and roles
src/lib/auth.ts
Clinical Records
- Patient records API
src/app/api/patients - Document API
src/app/api/documents - Disease catalogue API
src/app/api/diseases/route.ts - Disease tracking
src/lib/diseases.ts
Clinic Operations
- Calendar API
src/app/api/calendar - Reminder API
src/app/api/reminders - Checklist API
src/app/api/checklist - Reports API
src/app/api/reports/route.ts - Migration API
src/app/api/migrate/route.ts
Runtime Services
- Audit logging
src/lib/audit.ts - Database client
src/lib/db.ts - Clinical data schema
prisma/schema.prisma - Drive integration
src/lib/drive.ts
Other components
- Clinical user
- Neon PostgreSQL
- Google Drive
Connections 21
- Clinical user → Portal interface: uses
- Authentication API → Auth and roles: checks identity
- Patient records API → Auth and roles: checks access
- Document API → Auth and roles: checks access
- Migration API → Auth and roles: checks access
- Patient records API → Database client: reads and writes
- Document API → Database client: reads and writes
- Calendar API → Database client: reads and writes
- Reminder API → Database client: reads and writes
- Checklist API → Database client: reads and writes
- Reports API → Database client: queries metrics
- Migration API → Database client: migrates records
- Database client → Neon PostgreSQL: connects
- Clinical data schema → Neon PostgreSQL: defines data
- Patient records API → Drive integration: provisions folders
- Document API → Drive integration: stores files
- Patient records API → Disease tracking: records diseases
- Disease catalogue API → Disease tracking: uses catalogue
- Patient records API → Audit logging: logs changes
- Authentication API → Audit logging: logs sign-in
- Drive integration → Google Drive: stores files