Skip to content

mathncode-sid/lifelineplus

Repository files navigation

LifeLine+

Medication adherence and care coordination platform supporting UN SDG 3 (Good Health and Well-being).

Tech Stack

  • Framework: Next.js 15 (App Router)
  • Language: TypeScript
  • Styling: TailwindCSS + shadcn/ui
  • Database: Prisma Postgres with Prisma ORM
  • Auth: Auth.js (NextAuth v5)
  • Forms: React Hook Form + Zod
  • Charts: Recharts
  • PDF: jsPDF

Getting Started

Set DATABASE_URL in .env to your Prisma Postgres connection string, then run:

npm install
npx prisma migrate dev
npx prisma db seed
npm run dev

Open http://localhost:3000

Deployment Environment

Set these environment variables in Vercel before deploying to production:

AUTH_SECRET="a-long-random-production-secret"
NEXTAUTH_URL="https://your-production-domain"
DATABASE_URL="your-production-database-url"

Generate AUTH_SECRET with a secure random value and keep it private. Do not reuse the local development value from .env.

For Prisma Postgres, use the connection string Vercel provides as DATABASE_URL. After connecting the database, deploy the schema with npx prisma migrate deploy and seed demo data with npx prisma db seed if you want the sample accounts available.

Demo Accounts (password: password123)

Role Email
Patient patient@lifelineplus.com
Doctor doctor@lifelineplus.com
Caregiver caregiver@lifelineplus.com
Admin admin@lifelineplus.com

Features

Patient

  • Dashboard with health score, adherence, charts, and quick actions
  • Medication management (add/edit/delete, log taken/skipped/missed)
  • Symptom journal with pain and energy levels
  • Mood tracker with weekly trends
  • Appointment booking and cancellation
  • Health timeline of all events
  • In-app notifications

Caregiver

  • Monitor assigned patients
  • View adherence and health scores
  • Receive missed medication alerts

Doctor

  • Patient records with full health history
  • Approve and complete appointments
  • Write consultation notes
  • Download PDF health reports

Admin

  • User management with role assignment
  • Platform analytics and statistics

Health Score Formula

See lib/health-score.ts for the deterministic scoring algorithm:

  • Medication adherence (40%)
  • Appointment attendance (20%)
  • Mood trend (20%)
  • Symptom frequency (10%)
  • Logging consistency (10%)

Project Structure

app/           → Pages, API routes, layouts
components/    → UI, layout, charts, shared components
features/      → Feature modules with actions and components
lib/           → Auth, Prisma, health score, PDF, utilities
prisma/        → Schema, migrations, seed
types/         → Shared TypeScript types

About

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors