WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

ZarishSphere-Platform/zarish-fhir-infra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Zarish FHIR Infrastructure

Part of the ZarishSphere Platform - A No-Code FHIR Healthcare Data Management System

This repository contains the infrastructure configuration for deploying the ZarishSphere Platform, including Docker Compose files and Kubernetes manifests for orchestrating all services.

πŸš€ Technology Stack

  • Containerization: Docker & Docker Compose
  • Orchestration: Kubernetes
  • Services Included:
    • Zarish FHIR Server
    • Zarish Terminology Server
    • PostgreSQL Database
    • Keycloak Authentication
    • Elasticsearch (optional)

πŸ“‹ Prerequisites

  • Docker: Version 20+ (Download Docker)
  • Docker Compose: Version 2+ (included with Docker Desktop)
  • Kubernetes (optional): For production deployment
    • kubectl CLI tool
    • Minikube (for local testing) or cloud provider (AWS EKS, GKE, AKS)
  • Git: For version control

Checking Your Installation

docker --version          # Should show 20.x or higher
docker-compose --version  # Should show 2.x or higher
kubectl version          # Should show client and server versions

πŸ› οΈ Step-by-Step Development Setup

Step 1: Clone the Repository

cd ~/Desktop
git clone https://github.com/ZarishSphere-Platform/zarish-fhir-infra.git
cd zarish-fhir-infra

Step 2: Clone Related Repositories

The infrastructure expects the following repositories to be cloned in the parent directory:

cd ~/Desktop
git clone https://github.com/ZarishSphere-Platform/zarish-fhir-server.git
git clone https://github.com/ZarishSphere-Platform/zarish-terminology-server.git
git clone https://github.com/ZarishSphere-Platform/zarish-frontend-shell.git

Your directory structure should look like:

~/Desktop/
β”œβ”€β”€ zarish-fhir-infra/
β”œβ”€β”€ zarish-fhir-server/
β”œβ”€β”€ zarish-terminology-server/
└── zarish-frontend-shell/

Step 3: Configure Environment Variables

Create a .env file in the docker directory:

cd docker
touch .env

Add the following configuration:

# PostgreSQL
POSTGRES_DB=zarish_fhir
POSTGRES_USER=zarish
POSTGRES_PASSWORD=your_secure_password

# Keycloak
KEYCLOAK_ADMIN=admin
KEYCLOAK_ADMIN_PASSWORD=admin_password

# Application
FHIR_SERVER_PORT=8081
TERMINOLOGY_SERVER_PORT=8082
FRONTEND_PORT=3000

Step 4: Start Services with Docker Compose

# Navigate to docker directory
cd docker

# Start all services
docker-compose up -d

# Check service status
docker-compose ps

# View logs
docker-compose logs -f

Step 5: Access the Services

Once all services are running:

Step 6: Initialize Keycloak

  1. Open http://localhost:8080
  2. Login with admin credentials
  3. Create realm: zarish
  4. Create clients for each service
  5. Configure client settings

πŸ“ Project Structure

zarish-fhir-infra/
β”œβ”€β”€ docker/
β”‚   β”œβ”€β”€ docker-compose.yml        # Docker Compose configuration
β”‚   β”œβ”€β”€ zarish-fhir-server/      # FHIR server Docker config
β”‚   β”œβ”€β”€ zarish-terminology-server/ # Terminology server config
β”‚   └── .env                      # Environment variables
β”œβ”€β”€ k8s/
β”‚   β”œβ”€β”€ namespace.yaml            # Kubernetes namespace
β”‚   β”œβ”€β”€ postgres-deployment.yaml  # PostgreSQL deployment
β”‚   β”œβ”€β”€ keycloak-deployment.yaml  # Keycloak deployment
β”‚   β”œβ”€β”€ fhir-server-deployment.yaml
β”‚   β”œβ”€β”€ terminology-server-deployment.yaml
β”‚   β”œβ”€β”€ frontend-deployment.yaml
β”‚   └── ingress.yaml              # Ingress configuration
└── README.md

πŸ”§ Docker Compose Commands

Command Description
docker-compose up -d Start all services in background
docker-compose down Stop all services
docker-compose ps List running services
docker-compose logs -f [service] View service logs
docker-compose restart [service] Restart a service
docker-compose build Rebuild images

☸️ Kubernetes Deployment

Local Deployment (Minikube)

# Start Minikube
minikube start

# Create namespace
kubectl apply -f k8s/namespace.yaml

# Deploy PostgreSQL
kubectl apply -f k8s/postgres-deployment.yaml

# Deploy Keycloak
kubectl apply -f k8s/keycloak-deployment.yaml

# Deploy FHIR Server
kubectl apply -f k8s/fhir-server-deployment.yaml

# Deploy Terminology Server
kubectl apply -f k8s/terminology-server-deployment.yaml

# Deploy Frontend
kubectl apply -f k8s/frontend-deployment.yaml

# Setup Ingress
kubectl apply -f k8s/ingress.yaml

# Check deployments
kubectl get pods -n zarish-platform
kubectl get services -n zarish-platform

Production Deployment

For production deployment on cloud providers:

  1. Update image references in deployment files
  2. Configure secrets for sensitive data
  3. Setup persistent volumes for databases
  4. Configure ingress with TLS certificates
  5. Setup monitoring and logging

πŸ” Service Health Checks

# Check FHIR Server
curl http://localhost:8081/health

# Check Terminology Server
curl http://localhost:8082/health

# Check PostgreSQL
docker-compose exec postgres pg_isready

# Check Keycloak
curl http://localhost:8080/health

πŸ› Troubleshooting

Services Won't Start

# Check Docker daemon
docker info

# Check logs
docker-compose logs [service-name]

# Remove containers and restart
docker-compose down
docker-compose up -d

Port Conflicts

# Check what's using a port
lsof -i :8081

# Kill the process
kill -9 <PID>

# Or change ports in .env file

Database Connection Issues

# Access PostgreSQL container
docker-compose exec postgres psql -U zarish -d zarish_fhir

# Check database exists
\l

# Check tables
\dt

Kubernetes Pod Issues

# Describe pod
kubectl describe pod <pod-name> -n zarish-platform

# View logs
kubectl logs <pod-name> -n zarish-platform

# Get events
kubectl get events -n zarish-platform

πŸ”„ Updating Services

Update Docker Images

# Pull latest images
docker-compose pull

# Rebuild and restart
docker-compose up -d --build

Update Kubernetes Deployments

# Apply updated manifests
kubectl apply -f k8s/

# Rollout restart
kubectl rollout restart deployment/fhir-server -n zarish-platform

πŸ“š Learning Resources

🀝 Contributing

  1. Test changes locally with Docker Compose
  2. Validate Kubernetes manifests
  3. Update documentation
  4. Submit pull request

πŸ”— Related Repositories

πŸ†˜ Getting Help

  • Check Issues
  • Create new issue with:
    • Service logs
    • Configuration files
    • Steps to reproduce

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published