A comprehensive healthcare management platform built with React, TypeScript, and Supabase. This system enables secure patient-doctor interactions, appointment scheduling, medical records management, and KYC verification.
- Patients: Book appointments, view medical records, manage profile
- Doctors: Manage appointments, create medical records, view patient history
- Admins: Approve doctors, verify KYC documents, manage users
- Role-based access control (RBAC)
- Row-level security (RLS) policies
- Server-side role verification
- KYC document verification
- Secure authentication with Supabase
- Error message sanitization
- Appointment Management: Schedule, view, and manage appointments
- Medical Records: Secure storage of diagnoses, prescriptions, and lab results
- KYC Verification: Government ID verification for patients
- Doctor Approval Workflow: Admin approval required before doctors can practice
- Real-time Updates: Live data synchronization across users
- Node.js (v20 or higher)
- npm or yarn
- Supabase account
- Clone the repository
git clone https://github.com/6aruch/med-notes-now.git
cd med-notes-now- Install dependencies
npm install- Set up environment variables
Create a .env file in the root directory:
VITE_SUPABASE_URL=your_supabase_project_url
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key- Set up the database
Run the SQL scripts in your Supabase SQL editor:
- Create tables (users, appointments, medical_records, kyc_documents, user_roles)
- Set up RLS policies
- Create the
verify_user_role()function - Enable necessary extensions
- Start the development server
npm run devVisit http://localhost:5173 to view the application.
- React - UI framework
- TypeScript - Type safety
- Vite - Build tool
- Tailwind CSS - Styling
- shadcn/ui - UI components
- React Query - Data fetching
- Zod - Input validation
- Supabase - Backend as a Service
- PostgreSQL database
- Authentication
- Row Level Security
- Real-time subscriptions
- Storage for documents
src/
├── components/ # Reusable UI components
│ ├── ui/ # shadcn/ui components
│ └── ... # Feature components
├── hooks/ # Custom React hooks
├── integrations/ # Supabase integration
├── pages/ # Page components
│ ├── Auth.tsx
│ ├── PatientDashboard.tsx
│ ├── DoctorDashboard.tsx
│ └── AdminDashboard.tsx
├── lib/ # Utilities
└── types/ # TypeScript types
- users: User profiles (extends Supabase auth.users)
- user_roles: Role assignments (patient, doctor, admin)
- appointments: Appointment bookings
- medical_records: Patient medical history
- kyc_documents: Identity verification documents
All tables have RLS enabled with specific policies for data access control.
- Zod schemas for all forms
- Password strength requirements
- Format validation for emails, phones, dates
- Sanitization of user inputs
- Email/password authentication via Supabase
- Secure session management
- Role-based route protection
- Server-side role verification
# Start development server
npm run dev
# Build for production
npm run build
# Preview production build
npm run preview
# Run linting
npm run lint- Sign up and complete KYC verification
- Wait for admin approval
- Browse and book appointments with doctors
- View medical records and prescriptions
- Sign up with license number
- Wait for admin approval
- View assigned appointments
- Create and manage medical records
- Access admin dashboard
- Approve/reject doctor applications
- Verify KYC documents
- Manage system users
- Email notifications for appointments
- SMS reminders
- Video consultation integration
- Prescription e-signatures
- HIPAA compliance audit
- Multi-language support
- Mobile app (React Native)
- Analytics dashboard
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
This is a demonstration project. For production use with real patient data:
- Conduct professional security audits
- Ensure HIPAA compliance (if US-based)
- Implement additional backup systems
- Add comprehensive error logging
- Set up monitoring and alerting
- Consult legal counsel for healthcare regulations
For issues and questions:
- Open an issue on GitHub
- Contact: 6aruch@gmail.com
⚡ Built with passion for better healthcare technology