AI‑assisted medical collaboration platform for doctors and patients.
Secure onboarding • Patient management • Doctor ↔ Patient chat • AI clinical assistant • Email invitations
Doc+ is a full‑stack TypeScript React application that helps doctors manage patients, collaborate, and leverage AI safely for clinical context, summaries, and guidance. Patients can register (self or invited), view their profile, and interact with their doctor. Doctors gain tooling for structured onboarding, patient linking, and AI‑augmented chat.
(https://youtu.be/s5PCMi7bwoc?si=2W32JhznSDeJgtJU)
Check out our demo video to see Doc+ in action!
- Role-based experience (Doctor / Patient) with guided onboarding
- Secure auth using Clerk + Supabase profile linkage
- Patient invitation & temporary password email flows (Supabase Edge Functions + Resend)
- Doctor ↔ Patient real-time style chat UI (with session context)
- AI assistant modes:
- AI Doctor assistant (clinical insights, treatment reasoning)
- AI Patient support (wellness, emotional guidance)
- Context injection of patient data & uploaded file summaries
- Chat session persistence (Supabase tables
chat_sessions,messages) - Environment-driven OpenRouter model selection
- Modern UI: React 18, Vite, Tailwind CSS, shadcn-ui, Radix primitives
- Form validation with React Hook Form + Zod
- React Query for async/cache patterns
| Layer | Technology |
|---|---|
| Frontend Build | Vite + TypeScript |
| UI | React 18, Tailwind CSS, shadcn-ui, Radix UI |
| State/Data | React Query, Context APIs |
| Auth | Clerk (frontend) + Supabase profile records |
| Backend (DB & Edge) | Supabase (PostgreSQL, Edge Functions) |
| AI Integration | OpenRouter (configurable model) |
| Resend via Supabase Edge Functions | |
| Charts / Visualization | Recharts |
| Testing | Vitest, @testing-library/react |
src/
components/ Reusable UI + feature components
pages/ Route-level components (dashboards, chat, onboarding)
contexts/ React Context (e.g. AuthContext)
hooks/ Custom hooks (sessions, chat logic, toasts)
integrations/
supabase/ Supabase client & generated types
services/
openRouterService.ts AI model interaction layer
supabase/
functions/ Edge Functions (email flows)
migrations/ SQL migrations for database schema
public/ Static assets
Create a .env file (never commit real secrets). All variables prefixed VITE_ are exposed to the client build by Vite—keep only non-sensitive or publishable keys there.
# Supabase
VITE_SUPABASE_URL=https://YOUR_PROJECT_ID.supabase.co
VITE_SUPABASE_PUBLISHABLE_KEY=your_anon_or_publishable_key
# Auth (Clerk)
VITE_CLERK_PUBLISHABLE_KEY=pk_live_xxx_or_pk_test_xxx
# AI (OpenRouter)
VITE_OPENROUTER_API_KEY=sk_or_env_value (DO NOT expose if sensitive; proxy if required)
VITE_OPENROUTER_MODEL=openai/gpt-3.5-turbo
# Email / Functions
RESEND_API_KEY=your_resend_key
SITE_URL=https://your-deployed-domain (used in invitation links)
Optional: create a .env.example mirroring keys for contributors.
git clone https://github.com/your-org/doc-plus.git
cd doc-plus
npm install
cp .env.example .env # or copy manually on Windows
# edit .env with real values
npm run devApp runs at: http://localhost:5173 (default Vite port)
Patient Diagnosis Query:
"A 45-year-old male patient presents with chest pain, shortness of breath, and fatigue. What differential diagnoses should I consider, and what immediate tests would you recommend?"
Treatment Plan Request:
"For a patient with Type 2 diabetes and hypertension, what would be an appropriate medication regimen, including dosages and potential side effects?"
Medical Image Analysis:
"I've uploaded an X-ray of a patient's chest. Can you analyze it for signs of pneumonia or other abnormalities and suggest next steps?"
Medication Interaction Check:
"A patient is taking metformin, lisinopril, and atorvastatin. Are there any known interactions, and should I adjust the dosages?"
Clinical Guidelines Inquiry:
"What are the current guidelines for managing acute coronary syndrome in an emergency setting, including thrombolytic therapy options?"
Stress Management Scenario:
"I've been feeling overwhelmed with work lately and having trouble sleeping. Can you help me with some relaxation techniques and stress relief strategies?"
Emotional Support Request:
"I'm going through a difficult breakup and feeling very anxious. I'd like to talk about coping with emotional pain and building resilience."
Health Anxiety Discussion:
"I've been worried about my health after reading about various diseases online. How can I manage health anxiety without constant worry?"
Lifestyle Changes Query:
"I'm trying to improve my mental health through better habits. What are some practical ways to incorporate mindfulness and self-care into my daily routine?"
Crisis Intervention Test:
"I'm feeling really down and having thoughts of not wanting to continue. What should I do, and can you guide me toward professional help?"
- Push repository to GitHub
- In Vercel: Import → select repo
- Framework preset: Vite
- Build Command:
npm run build - Output Directory:
dist - Add environment variables (see above)
- Deploy
vercel.json rewrites SPA routes to index.html for client routing.
Functions:
send-patient-invitation– sends invitation with doctor ID codesend-temp-password– sends temporary password credentials
Deploy (example):
npx supabase functions deploy send-patient-invitation
npx supabase functions deploy send-temp-passwordEnsure RESEND_API_KEY and SITE_URL are set in Supabase project settings.
src/services/openRouterService.ts centralizes AI calls. Configure:
VITE_OPENROUTER_API_KEYVITE_OPENROUTER_MODEL(fallback:openai/gpt-3.5-turbo)
Includes distinct system prompts for doctor vs patient support contexts and optional patient/file context injection.
- Clerk handles frontend auth + role selection metadata
- Supabase stores extended profile (doctors / patients) after onboarding
AuthContextstitches Clerk user + Supabase profile
Supabase migrations live in supabase/migrations/. Apply locally:
npx supabase start # if using local stack
npx supabase migration up # applies migrationsResend is used via Edge Functions. Before production:
- Verify sending domain in Resend
- Update
from:address in functions if needed - Confirm
SITE_URLreflects deployed frontend
From package.json:
| Script | Purpose |
|---|---|
| dev | Start Vite dev server |
| build | Production build |
| build:dev | Dev-mode build (unminified) |
| preview | Preview production build locally |
| lint | Run ESLint |
- Do not ship private API keys in
VITE_vars if they grant broad access—use a proxy/server if required - Review system prompts for compliance & medical disclaimers before production
- Add rate limiting & audit logging for AI requests in future iterations
- File upload & structured medical record ingestion
- Doctor team collaboration & multi-specialty notes
- AI safety: reasoning trace + source citations enforcement
- Medication interaction checker
- Patient mobile-friendly PWA packaging
- Fork repository
- Create feature branch:
git checkout -b feat/short-description - Commit changes:
git commit -m "feat: add xyz" - Open PR with context & screenshots
| Name | |
|---|---|
| Akshat Barve | https://www.linkedin.com/in/akshatbarve/ |
| Arnish Baruah | https://www.linkedin.com/in/arnishbaruah/ |
| Jayesh Dubey | https://www.linkedin.com/in/jayesh-dubey823/ |
| Vijay Vinod Mane | https://www.linkedin.com/in/vijay-vinod-mane/ |
| Kshatriya Nandini Kuldeep Singh | https://www.linkedin.com/in/kshatriya-nandini-331a16244/ |
Questions or improvements welcome—feel free to open an issue or PR.
— Doc+ Team