30-day post-discharge patient tracking for psychiatric nurses in Sierra Leone
# Ward2Home
30-day post-discharge patient tracking for psychiatric nurses in Sierra Leone.
## Problem
50% of psychiatric patients relapse within 30 days of discharge because hospitals lose contact.
## Solution
A web app for nurses to track patients for 30 days after discharge using WhatsApp check-ins.
## Tech Stack
- Frontend: React + Vite + TypeScript + Tailwind CSS
- UI: shadcn/ui style components (included)
- Backend: Netlify Functions (serverless)
- Database: Supabase (PostgreSQL + Auth)
- Hosting: Netlify
## Features
- Discharge patients and auto-schedule follow-ups (Day 3, 7, 14, 30)
- Dashboard showing who to contact today
- Filter by Due Today, At Risk, Completed
- Send WhatsApp check-in button (demo: logs to DB)
- Supabase Auth with row-level security
## Setup Guide
### Step 1: Create Supabase Project
1. Go to
supabase.com and create a new project
2. Wait for it to provision (2-3 minutes)
### Step 2: Create Database Tables
1. In Supabase, go to SQL Editor
2. Paste and run this SQL:
```sql
create extension if not exists "uuid-ossp";
create table patients (
id uuid primary key default uuid_generate_v4(),
name text not null,
phone text,
family_phone text,
diagnosis text,
discharge_date date not null,
risk_level text default 'Medium',
created_by uuid,
created_at timestamp with time zone default now()
);
create table discharge_plans (
id uuid primary key default uuid_generate_v4(),
patient_id uuid references patients(id) on delete cascade,
meds_json jsonb,
notes text,
created_by uuid,
created_at timestamp with time zone default now()
);
create table followups (
id uuid primary key default uuid_generate_v4(),
patient_id uuid references patients(id) on delete cascade,
day integer not null,
scheduled_date date not null,
status text default 'PENDING',
created_at timestamp with time zone default now()
);
create table followup_logs (
id uuid primary key default uuid_generate_v4(),
followup_id uuid references followups(id) on delete cascade,
respon …