How nalintiwari36-coder/lifehealth-id-development works
LifeHealth ID is a privacy-focused health-record organizing experience. The visible workflow is sign-in, access-checked dashboard entry, and protected record upload or download; record files use private blob storage while metadata and audit events use PostgreSQL. The schema also models organizations, patient memberships, consent grants, notifications, and rate limits, though their runtime flows are not shown. The README is brief, so sharing is described as a product goal rather than a verified implemented workflow. Unexcerpted UI and API capabilities are included where the source index identifies them; uncertain links are omitted.
Main entry points: index.ts Database client · authz.ts Access checks · auth.ts Auth service setup · page.tsx Dashboard route
Components 26
User experience
- Localized pages
app/[locale] - Landing page
components/landing-page.tsx - Sign-in page
app/sign-in/page.tsx - Authentication form
components/auth-form.tsx - Dashboard route
app/dashboard/page.tsx - Health dashboard
components/health-dashboard.tsx - Account menu
components/account-menu.tsx - Sign-out control
components/sign-out-button.tsx - Privacy information
app/privacy/page.tsx - Localization
lib/i18n.ts
Identity and access
- Auth client
lib/auth-client.ts - Auth API route
app/api/auth/[...all]/route.ts - Auth service setup
lib/auth.ts - Access checks
lib/authz.ts - OTP send endpoint
app/api/otp/send/route.ts - OTP verify endpoint
app/api/otp/verify/route.ts
Health records
- Record upload endpoint
app/api/records/upload/route.ts - Record download endpoint
app/api/records/[id]/file/route.ts - Private blob storage
Data and messaging
- Message send endpoint
app/api/messages/send/route.ts - PostgreSQL database
- Database client
lib/db/index.ts - Data schema
lib/db/schema.ts - Environment config
lib/env.ts - Email delivery
Other components
- Person
Connections 34
- Person → Localized pages: opens
app/[locale]/page.tsx - Localized pages → Landing page: renders
app/[locale]/page.tsx - Localized pages → Localization: loads locale
app/[locale]/layout.tsx - Person → Sign-in page: signs in
app/sign-in/page.tsx - Sign-in page → Authentication form: renders
app/sign-in/page.tsx - Authentication form → Auth client: uses
components/auth-form.tsx - Account menu → Auth client: uses
components/account-menu.tsx - Sign-out control → Auth client: uses
components/sign-out-button.tsx - Person → Dashboard route: opens
app/dashboard/page.tsx - Dashboard route → Access checks: requires session
app/dashboard/page.tsx - Dashboard route → Health dashboard: renders
app/dashboard/page.tsx - Dashboard route → Sign-out control: renders
app/dashboard/page.tsx - Landing page → Account menu: renders
components/landing-page.tsx - Person → Privacy information: reads
app/privacy/page.tsx - Auth client → Auth API route: sends auth requests
- Auth API route → Auth service setup: delegates
app/api/auth/[...all]/route.ts - Auth service setup → Database client: uses pool
lib/auth.ts - Auth service setup → Environment config: reads settings
lib/auth.ts - Access checks → Auth service setup: checks session
lib/authz.ts - Access checks → Database client: queries access
lib/authz.ts - OTP send endpoint → Database client: stores code
app/api/otp/send/route.ts - OTP send endpoint → Email delivery: sends code
app/api/otp/send/route.ts - OTP verify endpoint → Database client: checks code
app/api/otp/verify/route.ts - Record upload endpoint → Access checks: requires session
app/api/records/upload/route.ts - Record upload endpoint → Database client: writes metadata and audit
app/api/records/upload/route.ts - Record upload endpoint → Private blob storage: stores file
app/api/records/upload/route.ts - Record download endpoint → Access checks: requires session
app/api/records/[id]/file/route.ts - Record download endpoint → Database client: reads record and audits
app/api/records/[id]/file/route.ts - Record download endpoint → Private blob storage: fetches file
app/api/records/[id]/file/route.ts - Message send endpoint → Access checks: uses access checks
app/api/messages/send/route.ts - Message send endpoint → Environment config: reads settings
app/api/messages/send/route.ts - Database client → Data schema: registers schema
lib/db/index.ts - Database client → PostgreSQL database: connects
lib/db/index.ts - Auth service setup → PostgreSQL database: configures auth database
lib/auth.ts