<br/><br/>
Book consultations with verified specialists, manage prescriptions, track payments, and coordinate care β all in one place.
Desktop
|
Mobile
|
Desktop
|
Mobile
|
- π Find Doctors β Search & filter by specialization, fee, availability
- π Book Appointments β Real-time slot selection with Stripe payment
- π Prescriptions β View electronic prescriptions issued by doctors
- π³ Payment History β Track all consultation payments with spending chart
- π Notifications β Real-time alerts for appointments & payments
- π€ Profile Management β Update personal info, photo, and contact details
- π Appointment Management β Confirm, complete, or reject bookings
- π Issue Prescriptions β Write and manage patient prescriptions
- π Earnings Dashboard β Track consultation revenue and history
- π₯ Profile Setup β Specialization, fees, availability schedule
- π₯ User Management β View, search, and suspend all users
- β Doctor Verification β Approve or reject doctor applications
- π Platform Analytics β Stats overview across all roles
- ποΈ Full Oversight β Manage appointments, payments, and reviews
- Credentials login (email + password via JWT)
- Google OAuth via Better Auth
- Role-based access β patient, doctor, admin, nurse, lab, pharmacist
| Layer | Technology |
|---|---|
| Frontend | Next.js 16 (App Router, Turbopack), TypeScript, Tailwind CSS v4 |
| UI Components | Radix UI, shadcn/ui, Framer Motion, Recharts |
| Backend | Express.js, TypeScript, Node.js |
| Database | MongoDB Atlas (via Mongoose + native driver) |
| Auth | Better Auth (JWKS), JWT (HTTPOnly cookies) |
| Payments | Stripe Checkout (server-side sessions) |
| Icons | Lucide React, React Icons |
| Deployment | Vercel (frontend + backend as serverless) |
medicare-connect/
βββ frontend/ # Next.js 16 App Router
β βββ src/
β β βββ app/ # Pages & API routes
β β β βββ dashboard/ # Role-based dashboards
β β β β βββ patient/ # Patient pages
β β β β βββ doctor/ # Doctor pages
β β β β βββ admin/ # Admin pages
β β β βββ find-doctors/ # Doctor search & booking
β β β βββ login/ # Auth pages
β β β βββ success/ # Post-payment confirmation
β β βββ components/ # Shared UI components
β β β βββ Navbar.tsx
β β β βββ NotificationBell.tsx
β β β βββ ...
β β βββ context/ # AuthContext (global auth state)
β β βββ lib/ # mockDb (localStorage + MongoDB sync)
β β βββ utils/ # backendUrl helper
β βββ public/assets/ # Static assets & screenshots
β
βββ backend/ # Express API server
βββ index.ts # All routes, middleware, seeding
- Node.js 20+
- MongoDB Atlas account
- Stripe account
- Google OAuth credentials
git clone https://github.com/CoderGUY47/medicare-connect.git
cd medicare-connectcd backend
npm installCreate backend/.env:
MONGODB_URI=mongodb+srv://<user>:<pass>@cluster.mongodb.net/medi-doc
JWT_SECRET=your_jwt_secret_key
PORT=5000
CLIENT_URL=http://localhost:3000Start the backend:
npm run devcd frontend
npm installCreate frontend/.env.local:
NEXT_PUBLIC_SERVER_URL=http://localhost:5000
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_...
STRIPE_SECRET_KEY=sk_test_...
BETTER_AUTH_SECRET=your_better_auth_secret
BETTER_AUTH_URL=http://localhost:3000
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secretStart the frontend:
npm run dev| Role | Password | |
|---|---|---|
| π§ββοΈ Patient | patient@gmail.com |
patient123 |
| π©Ί Doctor | doctor@gmail.com |
doctor123 |
| π‘οΈ Admin | admin@gmail.com |
admin123 |
| π Pharmacist | pharmacist@gmail.com |
pharmacist123 |
| π¬ Lab | lab@gmail.com |
lab123 |
| π₯ Nurse | nurse@gmail.com |
nurse123 |
π‘ Demo accounts are available until June 29, 2026. Register for a permanent account anytime.
| Card | Number |
|---|---|
| β Success | 4242 4242 4242 4242 |
| β Decline | 4000 0000 0000 0002 |
Use any future date for expiry and any 3-digit CVV.
| Method | Endpoint | Auth | Description |
|---|---|---|---|
POST |
/api/auth/login |
β | Login with credentials |
POST |
/api/auth/logout |
β | Logout |
GET |
/api/db-dump |
β | Sync all collections |
POST |
/api/db-sync |
β | Push local data to MongoDB |
GET |
/doctors |
β | List all doctors |
GET |
/doctors/:id |
β | Single doctor profile |
POST |
/appointments |
β | Book appointment |
GET |
/appointments/:userId |
β | Get user appointments |
GET |
/payments/:userId |
β | Get payment history |
POST |
/payment-confirm |
β | Stripe webhook sync |
GET |
/reviews/:doctorId |
β | Get doctor reviews |
POST |
/reviews |
β | Submit review |
GET |
/users |
β Admin | All users |
- Hybrid Storage: Data is stored in both
localStorage(fast reads) and MongoDB (persistence). They sync bidirectionally β the backend is the source of truth but locally added records (e.g. just-paid appointments) are merged, not overwritten. - Seed Guarantee: Seed appointments and payments for demo accounts are always injected if missing, ensuring a rich demo experience on every reload.
- SSR-safe Charts: Recharts
ResponsiveContaineris wrapped with amountedguard and explicit-height parent div to prevent thewidth(-1)SSR error. - JWT + JWKS: Custom credentials use server-signed JWTs stored as HTTPOnly cookies. Google OAuth tokens are validated via JWKS (Better Auth's public key endpoint).
Both the frontend and backend are deployed on Vercel:
| Service | URL |
|---|---|
| Frontend | https://medicare-connect-ten.vercel.app |
| Backend API | https://backend-nu-rosy-20.vercel.app |
The backend runs as a serverless Express function via Vercel's Node.js runtime.
This project is open source and available under the MIT License.
Built with β€οΈ using Next.js, MongoDB & Stripe



