# mahanaatma1/medimeet architecture

> Architecture diagram of the GitHub repository mahanaatma1/medimeet, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mahanaatma1/medimeet
- Repository: https://github.com/mahanaatma1/medimeet

## Overview

##### Project type and purpose
- MediMeet is a full‑stack telemedicine platform composed of three web applications:
- Patient Portal (frontend/)
- Administrator Dashboard (admin/)
- Backend API server (backend/)
- It provides appointment booking, video consultations, payments, notifications, and record management.

##### File structure
- Top‑level directories:
- frontend/ – React.js patient portal
- admin/ – React.js admin dashboard
- backend/ – Node.js/Express REST API
- backend/config, controllers, routes, models, middleware → a monolithic, MVC‑style API server
- frontend/src and admin/src each contain components, pages, context, assets → client‑side SPA structure
- Presence of config files for Netlify, Vercel, Tailwind, PostCSS → modern CI/CD and styling
- backend/utils includes emailTemplates, pdfGenerator, notifications → batch and transactional services

##### README for additional insights
- Confirms stack: React.js + Tailwind CSS on frontends; Node.js, Express, MongoDB on backend
- JWT auth, WebRTC video, Razorpay/Stripe payments, SMTP email, Cloudinary storage

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        Patient["Patient SPA"]:::frontend
        Admin["Admin SPA"]:::frontend
    end

    %% API Layer
    subgraph "API Layer"
        subgraph "Authentication & Middleware"
            AuthCore["auth.js"]:::api
            AuthAdmin["authAdmin.js"]:::api
            AuthDoctor["authDoctor.js"]:::api
            AuthUser["authUser.js"]:::api
        end
        subgraph "Controllers"
            UserCtrl["userController.js"]:::api
            AdminCtrl["adminController.js"]:::api
            DoctorCtrl["doctorController.js"]:::api
            PrescCtrl["prescriptionController.js"]:::api
            ReviewCtrl["reviewController.js"]:::api
            MeetingCtrl["meetingController.js"]:::api
        end
        subgraph "Models (Mongoose)"
            Models["appointmentModel.js, doctorModel.js, jobApplicationModel.js, jobModel.js, medicationModel.js, notificationModel.js, prescriptionModel.js, reviewModel.js, userModel.js"]:::db
        end
        subgraph "Utilities & Services"
            SendEmail["sendEmail.js"]:::util
            Notifications["notifications.js"]:::util
            PDFGen["pdfGenerator.js"]:::util
            CloudinaryConfig["cloudinary.js"]:::util
        end
    end

    %% Data Layer
    Database["MongoDB Atlas"]:::db

    %% External Services
    subgraph "External Services"
        TwilioVideo["Twilio Video (WebRTC)"]:::external
        Razorpay["Razorpay Payments"]:::external
        Stripe["Stripe Payments"]:::external
        SMTP["SMTP Email (Nodemailer)"]:::external
        CloudStorage["Cloudinary Storage"]:::external
    end

    %% CDN / Hosting
    CDN["Netlify/Vercel CDN"]:::cdn

    %% Connections
    Patient -->|"HTTPS REST"| UserCtrl
    Patient -->|"HTTPS REST"| DoctorCtrl
    Patient -->|"HTTPS REST"| PrescCtrl
    Patient -->|"WebSocket/WebRTC signaling"| MeetingCtrl
    Admin -->|"HTTPS REST"| AdminCtrl
    Admin -->|"WebSocket/WebRTC signaling"| MeetingCtrl
    UserCtrl -->|"CRUD"| Models
    AdminCtrl -->|"CRUD"| Models
    DoctorCtrl -->|"CRUD"| Models
    PrescCtrl -->|"CRUD"| Models
    ReviewCtrl -->|"CRUD"| Models
    MeetingCtrl -->|"CRUD"| Models
    UserCtrl -->|"uses"| AuthCore
    AdminCtrl -->|"uses"| AuthAdmin
    DoctorCtrl -->|"uses"| AuthDoctor
    PrescCtrl -->|"uses"| AuthUser
    AuthCore -->|"verifies JWT"| Models
    SendEmail -.->|"async email"| SMTP
    Notifications -.->|"async SMS"| SMTP
    PDFGen -.->|"generate PDF"| Database
    CloudinaryConfig -->|"media upload/download"| CloudStorage
    UserCtrl -->|"send email/SMS"| SendEmail
    UserCtrl -->|"send notifications"| Notifications
    MeetingCtrl ---->|"wavy media stream"| TwilioVideo
    UserCtrl -->|"payment processing"| Razorpay
    UserCtrl -->|"payment processing"| Stripe
    Razorpay -->|"webhook"| UserCtrl
    Stripe -->|"webhook"| UserCtrl
    UserCtrl -->|"store payment record"| Models
    UserCtrl -->|"store media URLs"| Models
    UserCtrl -->|"store file metadata"| Models
    UserCtrl -->|"file upload"| CloudinaryConfig
    UserCtrl -->|"PDF report"| PDFGen
    UserCtrl -->|"authenticate"| AuthUser
    AdminCtrl -->|"authenticate"| AuthAdmin
    DoctorCtrl -->|"authenticate"| AuthDoctor
    PrescCtrl -->|"authenticate"| AuthUser
    AdminCtrl -->|"manage users/doctors"| Models
    DoctorCtrl -->|"manage appointments"| Models
    Models -->|"persist data"| Database
    Patient -->|"static assets"| CDN
    Admin -->|"static assets"| CDN

    %% Click Events
    click Patient "https://github.com/mahanaatma1/medimeet/tree/main/frontend/"
    click Admin "https://github.com/mahanaatma1/medimeet/tree/main/admin/"
    click AuthCore "https://github.com/mahanaatma1/medimeet/blob/main/backend/middleware/auth.js"
    click AuthAdmin "https://github.com/mahanaatma1/medimeet/blob/main/backend/middleware/authAdmin.js"
    click AuthDoctor "https://github.com/mahanaatma1/medimeet/blob/main/backend/middleware/authDoctor.js"
    click AuthUser "https://github.com/mahanaatma1/medimeet/blob/main/backend/middleware/authUser.js"
    click UserCtrl "https://github.com/mahanaatma1/medimeet/blob/main/backend/controllers/userController.js"
    click AdminCtrl "https://github.com/mahanaatma1/medimeet/blob/main/backend/controllers/adminController.js"
    click DoctorCtrl "https://github.com/mahanaatma1/medimeet/blob/main/backend/controllers/doctorController.js"
    click PrescCtrl "https://github.com/mahanaatma1/medimeet/blob/main/backend/controllers/prescriptionController.js"
    click ReviewCtrl "https://github.com/mahanaatma1/medimeet/blob/main/backend/controllers/reviewController.js"
    click MeetingCtrl "https://github.com/mahanaatma1/medimeet/blob/main/backend/controllers/meetingController.js"
    click Models "https://github.com/mahanaatma1/medimeet/tree/main/backend/models/"
    click SendEmail "https://github.com/mahanaatma1/medimeet/blob/main/backend/utils/sendEmail.js"
    click Notifications "https://github.com/mahanaatma1/medimeet/blob/main/backend/utils/notifications.js"
    click PDFGen "https://github.com/mahanaatma1/medimeet/blob/main/backend/utils/pdfGenerator.js"
    click CloudinaryConfig "https://github.com/mahanaatma1/medimeet/blob/main/backend/config/cloudinary.js"

    %% Styles
    classDef frontend fill:#D6EFFF,stroke:#0366d6,stroke-width:1px
    classDef api fill:#D5F5E3,stroke:#239B56,stroke-width:1px
    classDef db fill:#F9E79F,stroke:#B9770E,stroke-width:1px
    classDef util fill:#FADBD8,stroke:#C0392B,stroke-width:1px
    classDef external fill:#E8DAEF,stroke:#6C3483,stroke-width:1px
    classDef cdn fill:#D6DBDF,stroke:#616A6B,stroke-width:1px
```
