A modern telemedicine consultation platform built with Next.js, Supabase, and shadcn/ui. This application enables secure communication between patients and doctors through a role-based system with internal authentication.
- 🔐 Secure Authentication: Internal auth using Bcrypt password hashing
- 👥 Role-Based Access: Separate dashboards for patients and doctors
- 🎨 Beautiful UI: Built with shadcn/ui components and Tailwind CSS
- 🚀 Modern Stack: Next.js 14+ with App Router and Server Components
- 💾 Supabase Backend: PostgreSQL database with real-time capabilities
- 🔒 Session Management: HTTP-only cookies for secure session storage
- Node.js 18+ installed
- A Supabase account (Sign up free)
-
Clone and install dependencies
npm install
-
Set up Supabase
- Create a new project on Supabase
- Go to the SQL Editor
- Copy contents from
supabase-schema.sqland execute it - This creates tables and demo users
-
Configure environment variables
Create
.env.localin the root directory:NEXT_PUBLIC_SUPABASE_URL=your-supabase-project-url NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key
Find these values in: Supabase Dashboard → Project Settings → API
-
Run the development server
npm run dev
- Patient:
patient1/password123 - Doctor:
doctor1/password123
├── app/
│ ├── api/auth/ # Authentication endpoints
│ ├── dashboard/ # Role-based dashboard
│ ├── login/ # Login page
│ └── page.tsx # Home (redirects)
├── components/
│ ├── ui/ # shadcn/ui components
│ ├── PatientDashboard.tsx
│ └── DoctorDashboard.tsx
├── lib/
│ ├── auth.ts # Session management
│ ├── supabase.ts # Supabase client
│ ├── types.ts # TypeScript types
│ └── utils.ts # Utilities
└── scripts/
└── hash-password.js # Password hashing tool
- Framework: Next.js 14+
- Database: Supabase (PostgreSQL)
- Authentication: Internal (Bcrypt + HTTP-only cookies)
- UI Components: shadcn/ui
- Styling: Tailwind CSS
- Language: TypeScript
Generate bcrypt hashes for new users:
node scripts/hash-password.js yourpasswordFor detailed setup instructions, see SETUP.md
- RLS is disabled for initial development (enable in production!)
- Always use HTTPS in production
- Rotate secrets regularly
- Implement rate limiting on auth endpoints
MIT
Contributions are welcome! Feel free to open issues or submit pull requests.