Skip to content

tanikush/MediWatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

24 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ₯ MediWatch – Hospital Infrastructure Reliability Platform

GitHub Docker Kubernetes Python

A production-grade DevOps project demonstrating automated infrastructure, CI/CD pipelines, monitoring, and self-healing systems for hospital applications.


πŸ“‹ Table of Contents


🎯 Problem Statement

Hospitals rely on critical systems like patient management, lab processing, and appointment scheduling. However:

  • ⏱️ Average downtime: 45+ minutes
  • 🚨 Manual failure detection
  • πŸ₯ Delays in patient care
  • πŸ“‰ No automated recovery

πŸ’‘ Solution Overview

MediWatch provides:

  • βœ… Real-time failure detection
  • βœ… Auto rollback when error rate > 5%
  • βœ… Recovery time reduced to < 2 minutes
  • βœ… Zero-downtime deployments

πŸ“Έ Screenshots

πŸ—οΈ Architecture Diagram

Architecture

🐳 Docker Services Running

Docker PS

πŸ“œ Service Logs

Docker Logs

❀️ Health Checks

Service 1 Health Check 1

Service 2 Health Check 2

Service 3 Health Check 3


πŸ”— API Testing

API Test

πŸ“Š Prometheus Metrics

Prometheus

πŸ› οΈ Tech Stack

Category Technologies
Backend Python 3.11, Flask
Database PostgreSQL 15
Containerization Docker, Docker Compose
Orchestration Kubernetes (K3s)
CI/CD Jenkins
IaC Ansible
Monitoring Prometheus, Grafana
Cloud AWS (EC2, ECR, S3)
Version Control Git, GitHub
Testing pytest

✨ Features

πŸ”„ CI/CD Pipeline

  • Linting with flake8
  • Testing with pytest
  • Docker image build & push to AWS ECR
  • Kubernetes rolling deployment
  • GitHub webhook integration

🎯 Microservices Architecture

  • Patient Service
  • Lab Service
  • Appointment Service

Each includes:

  • /health
  • /metrics

πŸ“Š Monitoring

  • Prometheus (15s scrape interval)
  • Grafana dashboards:
    • Uptime
    • Requests/sec
    • P95 latency
    • Pod restarts
  • Real-time alerting

πŸ”§ Self-Healing

  • Auto-remediation script
  • Rollback triggers:
    • Error rate > 5%
    • Health check failure
    • High pod restarts

⚑ High Availability

  • Kubernetes HPA enabled
  • CPU-based auto-scaling (70%)
  • 1–4 replicas per service
  • Zero-downtime rolling updates

πŸ“ Project Structure

mediwatch/
β”œβ”€β”€ services/
β”‚   β”œβ”€β”€ patient-service/
β”‚   β”‚   β”œβ”€β”€ app.py
β”‚   β”‚   β”œβ”€β”€ requirements.txt
β”‚   β”‚   β”œβ”€β”€ Dockerfile
β”‚   β”‚   └── tests/
β”‚   β”‚       └── test_patient.py
β”‚   β”œβ”€β”€ lab-service/
β”‚   β”‚   β”œβ”€β”€ app.py
β”‚   β”‚   β”œβ”€β”€ requirements.txt
β”‚   β”‚   β”œβ”€β”€ Dockerfile
β”‚   β”‚   └── tests/
β”‚   β”‚       └── test_lab.py
β”‚   └── appointment-service/
β”‚       β”œβ”€β”€ app.py
β”‚       β”œβ”€β”€ requirements.txt
β”‚       β”œβ”€β”€ Dockerfile
β”‚       └── tests/
β”‚           └── test_appointment.py
β”œβ”€β”€ jenkins/
β”‚   └── Jenkinsfile
β”œβ”€β”€ ansible/
β”‚   β”œβ”€β”€ provision.yml
β”‚   └── inventory.ini
β”œβ”€β”€ kubernetes/
β”‚   β”œβ”€β”€ patient-deployment.yaml
β”‚   β”œβ”€β”€ lab-deployment.yaml
β”‚   β”œβ”€β”€ appointment-deployment.yaml
β”‚   β”œβ”€β”€ postgres-deployment.yaml
β”‚   β”œβ”€β”€ configmap.yaml
β”‚   └── monitoring/
β”‚       β”œβ”€β”€ prometheus-config.yaml
β”‚       β”œβ”€β”€ prometheus-deployment.yaml
β”‚       β”œβ”€β”€ grafana-deployment.yaml
β”‚       └── alertmanager-config.yaml
β”œβ”€β”€ remediation/
β”‚   β”œβ”€β”€ auto-remediation.py
β”‚   └── requirements.txt
β”œβ”€β”€ monitoring/
β”‚   β”œβ”€β”€ docker-compose.yml
β”‚   └── prometheus.yml
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ setup.sh
β”‚   β”œβ”€β”€ health-check.sh
β”‚   β”œβ”€β”€ rollback.sh
β”‚   β”œβ”€β”€ cleanup.sh
β”‚   └── init-db.sql
β”œβ”€β”€ docker-compose.yml
└── README.md

This structure follows a microservices-based architecture with clear separation of services, infrastructure, CI/CD, and monitoring.


πŸš€ Quick Start

git clone https://github.com/tanikush/MediWatch
cd MediWatch
docker-compose up -d
cat scripts/init-db.sql | docker exec -i mediwatch-postgres-1 psql -U postgres
docker ps

πŸ” Health Check
curl http://localhost:5001/health
curl http://localhost:5002/health
curl http://localhost:5003/health

🌐 Deployment (AWS + Kubernetes)

ansible-playbook ansible/provision.yml -i ansible/inventory.ini
ssh -i ~/.ssh/mediwatch-key.pem ubuntu@YOUR_EC2_IP

git clone https://github.com/tanikush/MediWatch.git
cd MediWatch

docker-compose build

kubectl apply -f kubernetes/
kubectl apply -f kubernetes/monitoring/

πŸ“Š Monitoring

Prometheus

http://localhost:9090
http://localhost:30090

Grafana

http://localhost:3000
http://localhost:30300

Login: admin / admin

πŸ§ͺ Testing

pytest services/*/tests/ -v
docker exec -it mediwatch-patient-service-1 pytest tests/ -v

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

Tanisha Kushwah
DevOps Engineer | Cloud Enthusiast

GitHub: https://github.com/tanikush
LinkedIn: https://www.linkedin.com/in/tanisha-kushwah-280944284/

πŸ“„ License

This project is licensed under the MIT License.

---

## βœ… Project Complete - April 2026

- 3 Hospital Microservices βœ…
- Docker & Docker Compose βœ…
- Jenkins CI/CD Pipeline βœ…
- Prometheus + Grafana Monitoring βœ…
- GitHub Integration βœ…

Built by Tanisha Kushwah


---

About

Hospital Infrastructure Reliability Platform

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors