Skip to content

Asmit-Swain/MedSync

Repository files navigation

πŸ₯ MedSync - Medical Appointment Platform πŸ’ŠπŸ©Ί

MedSync Logo

MedSync is a modern, AI-powered medical appointment platform that seamlessly connects patients with healthcare providers. Built with cutting-edge technology, it offers intelligent doctor recommendations, smart scheduling, interactive maps for finding nearby doctors, and AI-assisted prescription writingβ€”all in one comprehensive healthcare solution.

πŸ₯ About

Connecting Patients and Healthcare Providers with AI Intelligence

MedSync revolutionizes the way patients find and connect with doctors through intelligent technology, making healthcare more accessible and efficient for everyone.

✨ Key Features

For Patients

  • πŸ—ΊοΈ Interactive Map: Find nearby doctors using Leaflet.js and OpenStreetMap
  • πŸ€– AI Doctor Recommendations: Get personalized doctor suggestions based on symptoms
  • πŸ“… Smart Scheduling: AI-optimized appointment booking with availability detection
  • πŸ” Advanced Search: Filter by specialization, rating, distance, and experience
  • πŸ“± Responsive Design: Seamless experience across all devices
  • πŸ” Secure Authentication: JWT-based user authentication

For Doctors

  • πŸ“‹ Digital Prescriptions: Create and manage prescriptions
  • πŸ€– AI Prescription Assistant: Get diagnosis and medication suggestions
  • πŸ“Š Appointment Management: View and manage patient appointments
  • πŸ‘₯ Patient Dashboard: Track patient history and visits

AI-Powered Features (Groq Integration)

  • Doctor Matching: Llama 3.3 70B model analyzes patient requirements
  • Prescription Assistance: AI-generated diagnosis and medication recommendations
  • Smart Scheduling: Intelligent time slot optimization

πŸ› οΈ Tech Stack

Frontend

  • Framework: React 18 + TypeScript
  • Build Tool: Vite
  • UI Library: shadcn/ui + Tailwind CSS
  • Routing: React Router v6
  • Maps: Leaflet.js + react-leaflet
  • Animation: Framer Motion
  • Forms: React Hook Form + Zod validation

Backend

  • Runtime: Node.js
  • Framework: Express.js
  • Database: MongoDB with Mongoose
  • Authentication: JWT + bcrypt
  • File Upload: Cloudinary integration
  • Security: Helmet, CORS, Rate Limiting

AI Integration

  • Provider: Groq AI
  • Model: Llama 3.3 70B Versatile
  • SDK: groq-sdk

πŸ“ Project Structure

MedSync_JK1/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ controllers/      # Request handlers
β”‚   β”‚   β”œβ”€β”€ models/           # MongoDB schemas
β”‚   β”‚   β”œβ”€β”€ routes/           # API routes
β”‚   β”‚   β”œβ”€β”€ middlewares/      # Auth, validation, error handling
β”‚   β”‚   β”œβ”€β”€ validators/       # Input validation
β”‚   β”‚   β”œβ”€β”€ utils/            # Helper functions
β”‚   β”‚   └── config/           # Database config
β”‚   β”œβ”€β”€ server.js             # Entry point
β”‚   β”œβ”€β”€ Dockerfile            # Docker configuration
β”‚   └── .env.production       # Production environment template
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/       # React components
β”‚   β”‚   β”œβ”€β”€ pages/            # Page components
β”‚   β”‚   β”œβ”€β”€ services/         # API services + Groq AI
β”‚   β”‚   β”œβ”€β”€ contexts/         # React Context (Auth)
β”‚   β”‚   β”œβ”€β”€ hooks/            # Custom hooks
β”‚   β”‚   └── lib/              # Utilities
β”‚   β”œβ”€β”€ public/               # Static assets
β”‚   β”œβ”€β”€ Dockerfile            # Docker configuration
β”‚   β”œβ”€β”€ nginx.conf            # Nginx configuration
β”‚   └── .env.production       # Production environment template
β”œβ”€β”€ docker-compose.yml        # Multi-container setup
β”œβ”€β”€ build.sh                  # Linux/Mac build script
β”œβ”€β”€ build.bat                 # Windows build script
β”œβ”€β”€ DEPLOYMENT_GUIDE.md       # Comprehensive deployment guide
β”œβ”€β”€ GROQ_AI_INTEGRATION.md    # AI features documentation
└── PROJECT_DOCUMENTATION.md  # Full project documentation

πŸš€ Quick Start

Prerequisites

  • Node.js 18+ and npm
  • MongoDB (local or Atlas)
  • Groq API key (for AI features)

Installation

  1. Clone the repository

    git clone <your-repo-url>
    cd MedSync_JK1
  2. Install dependencies

    # Install all dependencies
    npm run install:all
    
    # Or install separately
    cd backend && npm install
    cd ../frontend && npm install
  3. Configure environment variables

    Backend (backend/.env):

    PORT=5000
    MONGODB_URI=mongodb://localhost:27017/medsync
    JWT_SECRET=your_secret_key
    CLIENT_URL=http://localhost:8080

    Frontend (frontend/.env):

    VITE_API_URL=http://localhost:5000/api
    VITE_GROQ_API_KEY=your_groq_api_key
  4. Run development servers

    # Terminal 1 - Backend
    cd backend
    npm run dev
    
    # Terminal 2 - Frontend
    cd frontend
    npm run dev
  5. Access the application

🐳 Docker Deployment

Using Docker Compose (Recommended)

# Build and start all services
docker-compose up -d

# View logs
docker-compose logs -f

# Stop services
docker-compose down

Individual Containers

# Backend
cd backend
docker build -t medsync-backend .
docker run -p 5000:5000 --env-file .env medsync-backend

# Frontend
cd frontend
docker build -t medsync-frontend .
docker run -p 8080:80 medsync-frontend

πŸ“¦ Production Build

Windows

build.bat

Linux/Mac

chmod +x build.sh
./build.sh

Manual Build

# Backend
cd backend
npm install --production

# Frontend
cd frontend
npm install
npm run build

🌐 Deployment

See DEPLOYMENT_GUIDE.md for comprehensive deployment instructions including:

  • Vercel + Render deployment
  • Railway deployment
  • Heroku deployment
  • Docker deployment
  • Environment configuration
  • Security checklist
  • Monitoring setup

πŸ€– AI Features

See GROQ_AI_INTEGRATION.md for details on:

  • AI doctor recommendations
  • Smart prescription assistant
  • Intelligent appointment scheduling
  • Groq API configuration
  • Fallback strategies

πŸ“š API Documentation

Authentication

  • POST /api/auth/register - User registration
  • POST /api/auth/login - User login
  • GET /api/auth/me - Get current user

Doctors

  • GET /api/doctors - Get all doctors
  • GET /api/doctors/:id - Get doctor by ID
  • POST /api/doctors - Create doctor (protected)

Appointments

  • GET /api/appointments - Get appointments (protected)
  • POST /api/appointments - Book appointment (protected)
  • PUT /api/appointments/:id - Update appointment (protected)

Prescriptions

  • GET /api/prescriptions - Get prescriptions (protected)
  • POST /api/prescriptions - Create prescription (doctor only)

πŸ”’ Security Features

  • JWT authentication with httpOnly cookies
  • Password hashing with bcrypt
  • Rate limiting on API endpoints
  • CORS configuration
  • Input validation and sanitization
  • XSS protection
  • MongoDB injection prevention

πŸ§ͺ Testing

# Backend tests
cd backend
npm test

# Frontend tests
cd frontend
npm test

πŸ“„ License

This project is licensed under the MIT License. See LICENSE for details.

πŸ‘₯ Contributing

Contributions are welcome! Please open an issue or submit a pull request for bug fixes, new features, or improvements.

  1. Fork the repository
  2. Create your feature branch
    git checkout -b feature/AmazingFeature
  3. Commit your changes
    git commit -m 'Add AmazingFeature'
  4. Push to your branch
    git push origin feature/AmazingFeature
  5. Open a Pull Request!

πŸ“ž Support

For issues and questions:

  • Create an issue on GitHub
  • Check existing documentation
  • Review DEPLOYMENT_GUIDE.md or PROJECT_DOCUMENTATION.md

🎯 Roadmap

  • Mobile app (React Native)
  • Video consultations
  • Payment integration
  • Multi-language support
  • Advanced analytics dashboard
  • Email/SMS notifications
  • Insurance integration

⚑ Performance

  • Lighthouse Score: 95+
  • First Contentful Paint: <1.5s
  • Time to Interactive: <3s
  • Optimized bundle size with code splitting
  • Image optimization with Cloudinary

πŸ‘¨β€πŸ’» Author

ASMIT SWAIN

πŸ™ Acknowledgments

About

Modern medical appointment platform connecting patients with healthcare providers.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors