MedTun – A Tunisian digital health platform connecting patients and doctors. Features appointment booking, shared medical records, real-time chat, and an AI symptom checker.
# MedTun – Tunisian Digital Health Platform
MedTun is a digital health platform connecting patients and doctors in Tunisia.
It streamlines appointment booking, medical records management, real-time messaging, and AI-powered symptom assessment.
## 🚀 Key Features
- **Doctor Search** – find doctors by name, specialty, or location on an interactive map.
- **Appointment Management** – book appointments with affiliated doctors (via available slots) and non‑affiliated ones (via email notification).
- **Patient & Doctor Dashboards** – quick stats, upcoming appointments, notifications, documents, charts.
- **Shared Medical Records** – patients can grant temporary access to doctors for adding antecedents, documents, or vital sign readings.
- **Real‑time Chat** – one‑on‑one patient‑doctor messaging powered by Socket.IO.
- **AI Assistant (MediAssist)** – symptom analysis and medical guidance using the Groq API (LLaMA 3.3).
- **Notifications** – emails (Nodemailer + Brevo) and real‑time browser notifications (SSE).
- **Favorites** – patients can save their preferred doctors.
- **Paramedical Directory** – pharmacies, parapharmacies, ambulances, and more.
## 🛠️ Tech Stack
| Area | Technology |
|--------------|-----------------------------------------------------|
| **Frontend** | Next.js 14 (App Router), TypeScript, Tailwind CSS, Recharts, Leaflet, FullCalendar |
| **Backend** | Express.js, TypeScript, Prisma ORM, PostgreSQL |
| **Real‑time**| Socket.IO (chat), Server‑Sent Events (notifications)|
| **AI** | Groq API (LLaMA 3.3) |
| **Email** | Nodemailer + Brevo SMTP |
| **Maps** | Leaflet / OpenStreetMap |
| **Icons** | react-icons/md (Material Design) |
## 📁 Project Architecture
```
medtun/
├── backend/ # Express API
│ ├── src/
│ │ ├── controllers/
│ │ ├── mi …