A complete healthcare management monorepo featuring AI-powered medical assistance, patient records, appointment scheduling, and telemedicine. Includes backend API, AI agent with LLM models, web dashboard, and mobile app.
🎯 New to the project? Jump to our platform-specific setup guides:
- Windows Setup Guide - Complete guide for Windows users
- macOS Setup Guide - Complete guide for macOS users
- Linux Setup Guide - Complete guide for Linux users
- Troubleshooting Guide - Common issues and solutions
📖 Platform-Specific Guides Available:
- Windows Users: See SETUP-WINDOWS.md for detailed Windows setup
- macOS Users: See SETUP-MACOS.md for detailed macOS setup
- Linux Users: See SETUP-LINUX.md for detailed Linux setup
# 1. Clone repository
git clone https://github.com/NoelKhan/medibot-backend.git Medibot-MBSE
cd Medibot-MBSE
# 2. Start all services automatically
chmod +x scripts/development/*.sh
./scripts/development/start-all-services.sh
# 3. Verify services
./scripts/utilities/check-services.sh# 1. Clone repository
git clone https://github.com/NoelKhan/medibot-backend.git Medibot-MBSE
cd Medibot-MBSE/infrastructure/docker
# 2. Start all services with Docker
docker-compose up -d
# 3. Check status
docker-compose ps🎉 Done! Access your services:
- 🌐 Web Dashboard: http://localhost:5173 (or http://localhost:3000 for Docker)
- 🔌 Backend API: http://localhost:3001/api/health
- 🤖 AI Agent: http://localhost:8000/health
- What's Included
- Prerequisites
- Installation Guide
- Testing
- Deployment
- CI/CD Pipeline
- Troubleshooting
- Quick Reference
📖 Additional Guides:
- Windows Setup - Detailed Windows installation guide
- macOS Setup - Detailed macOS installation guide
- Linux Setup - Detailed Linux installation guide
- Troubleshooting - Common issues and solutions
| Component | Technology | Port | Purpose |
|---|---|---|---|
| Backend API | NestJS + TypeORM + PostgreSQL + Redis | 3001 | Patient records, appointments, authentication |
| AI Agent | Python FastAPI + Ollama + LangChain | 8000 | Medical symptom analysis, triage, AI chat |
| Web Dashboard | React 18 + Vite + Material-UI v7 | 5173 | Healthcare provider interface |
| Mobile App | React Native + Expo | - | Patient mobile application |
Key Features:
- 💬 AI medical chatbot with symptom analysis
- 📅 Appointment scheduling and management
- 📊 Patient health records and history
- 🎯 Emergency triage assessment
- 📱 Cross-platform mobile support
- 🔐 Secure authentication
| Component | Minimum | Recommended |
|---|---|---|
| RAM | 8GB | 16GB+ |
| Disk Space | 10GB | 20GB+ |
| OS | macOS 11+, Windows 10+, Ubuntu 20.04+ | Latest versions |
📦 Node.js 18.x or 20.x
macOS:
brew install node@20Windows:
- Download installer from nodejs.org
- Run installer and follow prompts
- Restart terminal after installation
Linux (Ubuntu/Debian):
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejsVerify:
node --version # Should show v20.x.x
npm --version # Should show 10.x.x🐍 Python 3.11+
macOS:
brew install python@3.11Windows:
- Download installer from python.org
- ✅ IMPORTANT: Check "Add Python to PATH" during installation
- Restart terminal after installation
Linux (Ubuntu/Debian):
sudo apt update
sudo apt install python3.11 python3.11-venv python3-pipVerify:
python3 --version # Should show 3.11.x or higher
pip3 --version # Should show pip version🐘 PostgreSQL 14+
macOS:
brew install postgresql@14
brew services start postgresql@14Windows:
- Download installer from postgresql.org
- Run installer (remember the password you set!)
- Add PostgreSQL bin to PATH:
C:\Program Files\PostgreSQL\14\bin
Linux (Ubuntu/Debian):
sudo apt update
sudo apt install postgresql postgresql-contrib
sudo systemctl start postgresql
sudo systemctl enable postgresqlVerify:
psql --version # Should show 14.x or higher
# macOS/Linux: Test connection
psql postgres
# Windows (PowerShell): Test connection
& "C:\Program Files\PostgreSQL\14\bin\psql.exe" -U postgres🔴 Redis 7+
macOS:
brew install redis
brew services start redisWindows:
- Download from redis.io/download or use WSL2
- Easiest: Use Docker:
docker run -d -p 6379:6379 redis:7-alpine
Linux (Ubuntu/Debian):
sudo apt update
sudo apt install redis-server
sudo systemctl start redis-server
sudo systemctl enable redis-serverVerify:
redis-cli ping # Should return "PONG"🤖 Ollama (for AI)
macOS:
brew install ollama
ollama serveWindows:
- Download installer from ollama.ai/download
- Run installer
- Ollama will start automatically
Linux:
curl -fsSL https://ollama.ai/install.sh | sh
ollama serveVerify:
# Check if Ollama is running
curl http://localhost:11434/api/tags
# Should return JSON with model list🐳 Docker & Docker Compose (Recommended for Windows users)
All Platforms:
- Download Docker Desktop
- Install and start Docker Desktop
- Docker Compose is included
Verify:
docker --version
docker-compose --version📱 Expo CLI (for mobile development)
All Platforms:
npm install -g expo-cli
expo --versionRun this to verify all installations:
macOS/Linux:
echo "Node: $(node --version)"
echo "Python: $(python3 --version)"
echo "PostgreSQL: $(psql --version)"
echo "Redis: $(redis-cli --version)"
echo "Ollama: $(curl -s http://localhost:11434/api/tags | grep -o 'models' || echo 'Not running')"Windows (PowerShell):
Write-Host "Node: $(node --version)"
Write-Host "Python: $(python --version)"
Write-Host "PostgreSQL: $(psql --version)"
Write-Host "Redis: $(redis-cli --version)"
Write-Host "Ollama: $(try { (Invoke-WebRequest -Uri http://localhost:11434/api/tags).StatusCode } catch { 'Not running' })"macOS
# Start services
brew services start postgresql@14
brew services start redis
# Create database
createdb medibot_dbWindows
# PostgreSQL starts automatically after installation
# Check if running:
Get-Service -Name postgresql*
# Create database (PowerShell)
& "C:\Program Files\PostgreSQL\14\bin\createdb.exe" -U postgres medibot_db
# Or use pgAdmin (GUI) to create database named 'medibot_db'
# Start Redis (if using Docker)
docker run -d -p 6379:6379 --name redis redis:7-alpine
# Or if installed via WSL
wsl redis-serverLinux
# Start services
sudo systemctl start postgresql
sudo systemctl start redis-server
# Create database
sudo -u postgres createdb medibot_db# Navigate to backend folder
cd medibot-backend
# Install dependencies
npm installmacOS/Linux:
cp .env.example .env
nano .env # or use your preferred editorWindows:
copy .env.example .env
notepad .env # or use VS Code: code .envRequired .env settings:
# Database Configuration
DATABASE_HOST=localhost
DATABASE_PORT=5432
DATABASE_USER=postgres
DATABASE_PASSWORD=your_password # Use the password you set during PostgreSQL installation
DATABASE_NAME=medibot_db
# Redis Configuration
REDIS_HOST=localhost
REDIS_PORT=6379
# AI Agent
AI_AGENT_URL=http://localhost:8000
# Security
JWT_SECRET=your-super-secret-key-change-this
# Server
PORT=3001
NODE_ENV=development# Run migrations to create tables
npm run migration:runmacOS/Linux:
npm run start:devWindows (PowerShell):
npm run start:devmacOS/Linux:
curl http://localhost:3001/api/healthWindows (PowerShell):
Invoke-WebRequest -Uri http://localhost:3001/api/health | Select-Object -Expand ContentExpected Response:
{"status":"ok","info":{"database":{"status":"up"},...}}macOS
# Install Ollama
brew install ollama
# Start Ollama service
ollama serveWindows
- Download installer from ollama.ai/download
- Run the installer
- Ollama starts automatically as a service
- Verify it's running by opening http://localhost:11434 in your browser
Linux
# Install Ollama
curl -fsSL https://ollama.ai/install.sh | sh
# Start Ollama
ollama servePick based on your computer's RAM:
| Model | Size | RAM Needed | Best For | Install Command |
|---|---|---|---|---|
| BioMistral ⭐ | 4.1GB | 8GB | Medical-specific, best accuracy | ollama pull biomistral |
| Llama 3.2 | 2GB | 8GB | Fast, general purpose | ollama pull llama3.2 |
| MedLlama2 | 3.8GB | 8GB | Medical-specific (alternative) | ollama pull medllama2 |
| Llama 2 (7B) | 3.8GB | 8GB | Medical fine-tuning | ollama pull llama2:7b |
| Llama 3.1 | 4.7GB | 16GB | Advanced | ollama pull llama3.1 |
| Mistral | 4.1GB | 8GB | Fast & efficient | ollama pull mistral |
Recommended (All Platforms):
ollama pull biomistralVerify:
ollama list
ollama run biomistral "What causes headaches?"macOS/Linux:
cd medibot-backend/python/aiagent
# Create virtual environment
python3 -m venv venv
# Activate virtual environment
source venv/bin/activate
# Install dependencies
pip install -r requirements.txtWindows (PowerShell):
cd medibot-backend\python\aiagent
# Create virtual environment
python -m venv venv
# Activate virtual environment
.\venv\Scripts\Activate.ps1
# If you get execution policy error, run:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
# Install dependencies
pip install -r requirements.txtmacOS/Linux:
cp .env.example .env
nano .envWindows:
copy .env.example .env
notepad .envRequired .env for AI Agent:
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_MODEL=biomistral
API_HOST=0.0.0.0
API_PORT=8000
BACKEND_URL=http://localhost:3001
MAX_TOKENS=2000
TEMPERATURE=0.7macOS/Linux:
# Make sure venv is activated
source venv/bin/activate
# Start AI Agent
python3 -m uvicorn app:app --host 0.0.0.0 --port 8000 --reloadWindows:
# Make sure venv is activated
.\venv\Scripts\Activate.ps1
# Start AI Agent
python -m uvicorn app:app --host 0.0.0.0 --port 8000 --reloadmacOS/Linux:
curl http://localhost:8000/healthWindows (PowerShell):
Invoke-WebRequest -Uri http://localhost:8000/health | Select-Object -Expand ContentExpected Response:
{"status":"healthy","services":{"ollama":"connected",...}}cd medibot-web
npm installmacOS/Linux:
cp .env.example .envWindows:
copy .env.example .envRequired .env:
VITE_API_URL=http://localhost:3001/api
VITE_AI_AGENT_URL=http://localhost:8000npm run devAccess: http://localhost:5173
Default credentials:
- Email:
admin@medibot.com - Password:
admin123
📱 Note: Mobile app requires React 19.1.0 for Expo SDK 54 compatibility
cd medibot-mobile
npm install
# Ensure React 19.1.0 is installed (required for Expo SDK 54)
npm list react # Should show react@19.1.0
# If React version is incorrect, install the correct version:
npm install react@19.1.0 react-dom@19.1.0 --save-exact
# Install Expo CLI globally (if not already installed)
npm install -g expo-climacOS/Linux:
cp .env.example .envWindows:
copy .env.example .envlocalhost
macOS
# Method 1: Using ifconfig
ifconfig | grep "inet " | grep -v 127.0.0.1
# Method 2: Using System Preferences
# Go to System Preferences → Network → Your connection
# Look for "IP Address"Windows
# Method 1: Using ipconfig
ipconfig | findstr IPv4
# Method 2: Using Settings
# Settings → Network & Internet → Properties
# Look for "IPv4 address"Linux
# Method 1: Using ip command
ip addr show | grep "inet " | grep -v 127.0.0.1
# Method 2: Using hostname
hostname -IEdit .env with your IP address:
# Replace YOUR_COMPUTER_IP with the IP address you found
API_URL=http://192.168.1.100:3001/api # Example IP
AI_AGENT_URL=http://192.168.1.100:8000 # Example IPExample:
- If your IP is
192.168.1.100, use:API_URL=http://192.168.1.100:3001/apiAI_AGENT_URL=http://192.168.1.100:8000
npm startThis will:
- Start the Metro bundler
- Display a QR code
- Provide options to run on emulator/simulator
-
Install Expo Go on your phone:
- iOS: Download from App Store
- Android: Download from Play Store
-
Scan QR Code:
- iOS: Use Camera app to scan QR code from terminal
- Android: Use Expo Go app to scan QR code
-
Troubleshooting Connection:
- Make sure phone and computer are on the same WiFi network
- Check firewall isn't blocking ports 3001, 8000, 8081
- Try running with tunnel:
npm start -- --tunnel
Android Emulator (All Platforms):
# Start Android emulator first (Android Studio)
# Then run:
npm run androidiOS Simulator (macOS only):
# Requires Xcode to be installed
npm run iosWindows Subsystem for Android (Windows 11):
# If you have WSA installed
npm run androidmacOS/Linux
# Automated health check (if scripts work)
./scripts/utilities/check-services.sh
# Or manually check ports
lsof -i:3001 # Backend
lsof -i:8000 # AI Agent
lsof -i:5173 # Web
# Check service health
curl http://localhost:3001/api/health
curl http://localhost:8000/healthWindows (PowerShell)
# Check if ports are in use
netstat -ano | findstr :3001 # Backend
netstat -ano | findstr :8000 # AI Agent
netstat -ano | findstr :5173 # Web
# Check service health
Invoke-WebRequest -Uri http://localhost:3001/api/health
Invoke-WebRequest -Uri http://localhost:8000/health
# Or open in browser
Start-Process "http://localhost:3001/api/health"
Start-Process "http://localhost:8000/health"
Start-Process "http://localhost:5173"macOS/Linux
curl -X POST http://localhost:3001/api/chat/message \
-H "Content-Type: application/json" \
-d '{"content": "I have a fever and cough"}'Windows (PowerShell)
$body = @{
content = "I have a fever and cough"
} | ConvertTo-Json
Invoke-WebRequest -Uri http://localhost:3001/api/chat/message `
-Method POST `
-ContentType "application/json" `
-Body $bodyShould return AI analysis with symptoms and recommendations.
All Platforms:
# Test all services (macOS/Linux only)
./scripts/testing/test-all.sh
# Test individual services
cd medibot-backend && npm test
cd medibot-web && npm test
cd medibot-mobile && npm testPerfect for: Testing, demos, simple deployments, Windows users
Prerequisites:
- Docker Desktop installed and running
Step 1: Navigate to Docker folder
cd infrastructure/dockerStep 2: Start all services
docker-compose up -dStep 3: View logs (optional)
# All services
docker-compose logs -f
# Specific service
docker-compose logs -f backend
docker-compose logs -f aiagentStep 4: Check status
docker-compose psAccess services:
- Backend: http://localhost:3001
- AI Agent: http://localhost:8000
- Web: http://localhost:3000
- PostgreSQL: localhost:5432
- Redis: localhost:6379
Stop services:
docker-compose down
# Stop and remove volumes (clean slate)
docker-compose down -vUpdate after code changes:
docker-compose down
docker-compose build
docker-compose up -dPerfect for: Production, auto-scaling, high availability, cloud deployments
Prerequisites:
- kubectl installed
- Access to a Kubernetes cluster (AWS EKS, GKE, AKS, or local with Minikube)
kubectl create namespace medibot-prodPostgreSQL Secret
kubectl create secret generic postgres-secret \
--from-literal=username=postgres \
--from-literal=password=your-secure-password \
-n medibot-prodJWT Secret
kubectl create secret generic jwt-secret \
--from-literal=secret=your-jwt-secret-key \
-n medibot-prodAPI Keys (if needed)
kubectl create secret generic api-keys \
--from-literal=openai-key=your-key \
-n medibot-prodcd infrastructure/k8s
# Deploy in order
kubectl apply -f backend/postgres-statefulset.yaml -n medibot-prod
kubectl apply -f backend/redis-deployment.yaml -n medibot-prod
kubectl apply -f backend/ollama-statefulset.yaml -n medibot-prod
kubectl apply -f backend/backend-deployment.yaml -n medibot-prod
kubectl apply -f backend/ai-agent-deployment.yaml -n medibot-prod
kubectl apply -f web/web-deployment.yaml -n medibot-prod
kubectl apply -f ingress.yaml -n medibot-prod
kubectl apply -f hpa.yaml -n medibot-prod# Check all resources
kubectl get all -n medibot-prod
# Check pods status
kubectl get pods -n medibot-prod
# Check services
kubectl get svc -n medibot-prod
# Check logs if needed
kubectl logs -f deployment/backend -n medibot-prodWith LoadBalancer:
kubectl get svc -n medibot-prod
# Look for EXTERNAL-IPWith Port Forwarding (for testing):
# Backend
kubectl port-forward svc/backend 3001:3001 -n medibot-prod
# AI Agent
kubectl port-forward svc/ai-agent 8000:8000 -n medibot-prod
# Web
kubectl port-forward svc/web 3000:80 -n medibot-prodUse the deploy script:
macOS/Linux:
cd infrastructure/k8s
chmod +x deploy.sh
./deploy.shWindows (PowerShell):
cd infrastructure\k8s
# Run commands from deploy.sh manually
# Or use WSL: wsl ./deploy.shQuick Deploy to AWS ECS
-
Setup AWS CLI:
aws configure
-
Deploy Backend:
cd medibot-backend aws ecs register-task-definition --cli-input-json file://ecs-task-definition.json -
Use GitHub Actions:
- Push to
mainbranch - Workflow automatically deploys to ECS
- Check
.github/workflows/backend-cicd.yml
- Push to
Quick Deploy to GKE
-
Create GKE cluster:
gcloud container clusters create medibot-cluster \ --num-nodes=3 \ --zone=us-central1-a
-
Get credentials:
gcloud container clusters get-credentials medibot-cluster
-
Deploy with kubectl:
kubectl apply -f infrastructure/k8s/
Quick Deploy to AKS
-
Create AKS cluster:
az aks create \ --resource-group medibot-rg \ --name medibot-cluster \ --node-count 3 \ --enable-addons monitoring
-
Get credentials:
az aks get-credentials \ --resource-group medibot-rg \ --name medibot-cluster
-
Deploy with kubectl:
kubectl apply -f infrastructure/k8s/
Deploy Backend to Heroku
# Install Heroku CLI
# macOS: brew install heroku
# Windows: Download from heroku.com
# Login
heroku login
# Create apps
heroku create medibot-backend
heroku create medibot-web
# Add PostgreSQL
heroku addons:create heroku-postgresql:hobby-dev --app medibot-backend
# Add Redis
heroku addons:create heroku-redis:hobby-dev --app medibot-backend
# Deploy backend
cd medibot-backend
git push heroku main
# Deploy web
cd medibot-web
git push heroku mainOur GitHub Actions workflows automatically build, test, and deploy all components.
- ✅ Automated builds on every push to
mainordevelop - ✅ Docker images published to GitHub Container Registry (ghcr.io)
- ✅ Parallel execution for faster builds
- ✅ Security scanning with npm audit and Snyk
- ✅ Self-hosted runner support for cost savings and performance
Backend Pipeline (.github/workflows/backend-cicd.yml):
- Lint & Type Check
- Unit & Integration Tests
- Security Audit
- Build Docker Image →
ghcr.io/noelkhan/medibot-backend - Deploy to Production/Staging
AI Agent Pipeline (.github/workflows/ai-agent-cicd.yml):
- Lint & Type Check
- Unit Tests
- Build Docker Image →
ghcr.io/noelkhan/medibot-ai-agent - Deploy to Kubernetes
Web Pipeline (.github/workflows/web-cicd.yml):
- Lint & Build
- Build Docker Image →
ghcr.io/noelkhan/medibot-web - Deploy to Vercel (dev) or Kubernetes (prod)
Mobile Pipeline (.github/workflows/mobile-cicd.yml):
- Lint & Type Check
- Run Tests
- Build APK with Expo
- Upload artifacts
All workflows support self-hosted runners! Switch between GitHub-hosted and self-hosted runners for:
- 💰 Cost savings - Unlimited build minutes
- ⚡ Better performance - Custom hardware
- 🔒 Enhanced security - Private network
- 🎛️ Custom configuration - Pre-installed tools
Quick Setup:
# Switch to self-hosted runners
gh variable set RUNNER_TYPE --body "self-hosted"
# Switch back to GitHub-hosted (default)
gh variable set RUNNER_TYPE --body "ubuntu-latest"📖 Full Documentation: .github/SELF-HOSTED-RUNNERS.md
- Setup guides for Linux, macOS, Windows, and Docker
- Security best practices
- Monitoring and troubleshooting
- Custom labels for specialized runners (GPU, high-memory, etc.)
Add these in Settings → Secrets and variables → Actions:
| Secret | Description |
|---|---|
EXPO_TOKEN |
Expo authentication token |
KUBE_CONFIG |
Base64 encoded kubeconfig |
VITE_API_URL |
Web app API URL (e.g., https://api.medibot.com) |
VITE_AI_AGENT_URL |
AI agent URL (e.g., https://ai.medibot.com) |
BACKEND_URL |
Backend health check URL |
AI_AGENT_URL |
AI health check URL |
Trigger workflow:
git push origin main # Auto-triggers
# Or manually via GitHub Actions tabmacOS/Linux
# Find and kill process using port 3001
lsof -ti:3001 | xargs kill -9
# For other ports
lsof -ti:8000 | xargs kill -9 # AI Agent
lsof -ti:5173 | xargs kill -9 # WebWindows (PowerShell)
# Find process ID using port 3001
netstat -ano | findstr :3001
# Kill process (replace PID with actual process ID)
taskkill /PID <PID> /F
# Example:
taskkill /PID 12345 /FmacOS
# Check if PostgreSQL is running
brew services list | grep postgresql
# Start PostgreSQL if not running
brew services start postgresql@14
# Verify database exists
psql -l | grep medibot_db
# Create if missing
createdb medibot_dbWindows
# Check if PostgreSQL service is running
Get-Service -Name postgresql*
# Start service if stopped
Start-Service postgresql-x64-14 # Adjust version number
# Create database using pgAdmin or:
& "C:\Program Files\PostgreSQL\14\bin\createdb.exe" -U postgres medibot_dbLinux
# Check if PostgreSQL is running
sudo systemctl status postgresql
# Start if not running
sudo systemctl start postgresql
# Create database
sudo -u postgres createdb medibot_dbmacOS
# Check if Redis is running
brew services list | grep redis
# Start Redis
brew services start redis
# Test connection
redis-cli ping # Should return PONGWindows
# If using Docker
docker ps | findstr redis
docker start redis # If stopped
# Or start Redis container
docker run -d -p 6379:6379 --name redis redis:7-alpine
# Test connection
redis-cli pingLinux
# Check if Redis is running
sudo systemctl status redis-server
# Start Redis
sudo systemctl start redis-server
# Test connection
redis-cli pingAll Platforms:
# Clear node_modules and reinstall
rm -rf node_modules package-lock.json # macOS/Linux
# Or
Remove-Item -Recurse -Force node_modules, package-lock.json # Windows PowerShell
npm installmacOS
# Start Ollama
ollama serve
# Or run in background
nohup ollama serve > /dev/null 2>&1 &Windows
- Check if Ollama is running in system tray
- If not, search for "Ollama" in Start Menu and launch it
- Or restart the Ollama service:
- Open Task Manager
- Go to Services tab
- Find "Ollama" and restart it
Linux
# Start Ollama
ollama serve
# Or run as systemd service
sudo systemctl start ollamaAll Platforms:
# List installed models
ollama list
# Pull required model
ollama pull llama3.2
# Verify model works
ollama run llama3.2 "Hello"All Platforms:
# Check if Ollama is listening
curl http://localhost:11434/api/tags
# Or in browser: http://localhost:11434Windows alternative:
Invoke-WebRequest -Uri http://localhost:11434/api/tagsmacOS/Linux
cd medibot-backend/python/aiagent
# Remove old venv
rm -rf venv
# Create new venv
python3 -m venv venv
# Activate
source venv/bin/activate
# Reinstall dependencies
pip install -r requirements.txtWindows (PowerShell)
cd medibot-backend\python\aiagent
# Remove old venv
Remove-Item -Recurse -Force venv
# Create new venv
python -m venv venv
# Activate (if execution policy error, see below)
.\venv\Scripts\Activate.ps1
# If you get execution policy error:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
# Reinstall dependencies
pip install -r requirements.txtAll Platforms:
cd medibot-web
# Clear cache and reinstall
rm -rf node_modules package-lock.json .vite # macOS/Linux
# Or
Remove-Item -Recurse -Force node_modules, package-lock.json, .vite # Windows
npm install
npm run dev-
Check Backend is Running:
- macOS/Linux:
curl http://localhost:3001/api/health - Windows:
Invoke-WebRequest http://localhost:3001/api/health
- macOS/Linux:
-
Verify
.envfile:VITE_API_URL=http://localhost:3001/api VITE_AI_AGENT_URL=http://localhost:8000
-
Restart Dev Server:
# Stop with Ctrl+C, then: npm run dev
Common Causes:
-
Using
localhostinstead of IP address- ❌ Wrong:
http://localhost:3001 - ✅ Correct:
http://192.168.1.100:3001(your computer's IP)
- ❌ Wrong:
-
Phone and computer on different WiFi networks
- Make sure both devices are on the same network
-
Firewall blocking connections
- macOS: System Preferences → Security & Privacy → Firewall → Allow Node.js
- Windows: Windows Defender Firewall → Allow an app → Add Node.js
- Linux:
sudo ufw allow 3001andsudo ufw allow 8000
All Platforms:
# Clear Metro bundler cache
npm start -- --clear
# Or with Expo
expo start -c
# If that doesn't work, clear watchman (macOS/Linux)
watchman watch-del-all-
Try Tunnel Mode:
npm start -- --tunnel
-
Check Expo CLI is up to date:
npm install -g expo-cli@latest
-
Restart Everything:
- Close Expo Go app
- Stop Metro bundler (Ctrl+C)
- Run
npm startagain - Reopen Expo Go
All Platforms:
# Stop all Docker containers
docker-compose down
# Check for processes using ports
# macOS/Linux:
lsof -i:3001
lsof -i:8000
# Windows:
netstat -ano | findstr :3001
netstat -ano | findstr :8000All Platforms:
# Clean build
docker-compose down -v # Remove volumes
docker-compose build --no-cache
docker-compose up# View logs
docker-compose logs backend
docker-compose logs aiagent
docker-compose logs web
# Restart specific service
docker-compose restart backend-
Check Prerequisites Again:
- Verify all required software is installed and running
- Check versions match requirements
-
Review Logs:
- Backend: Check terminal output
- AI Agent: Check terminal output
- Docker:
docker-compose logs -f
-
Try Docker Method:
- If local setup is problematic, use Docker Compose
- It handles all dependencies automatically
-
Get Help:
- Create an issue: https://github.com/NoelKhan/medibot-backend/issues
- Include:
- Your OS and version
- Error messages
- Steps you've already tried
Medibot-MBSE/
├── medibot-backend/ # NestJS Backend
│ ├── src/ # API source code
│ ├── migrations/ # Database migrations
│ └── python/aiagent/ # AI Agent (FastAPI)
├── medibot-web/ # React Web Dashboard
│ └── src/
│ ├── pages/ # Page components
│ ├── components/ # Reusable components
│ └── services/ # API services
├── medibot-mobile/ # React Native Mobile
│ └── src/
│ ├── screens/ # Screen components
│ └── services/ # API services
├── infrastructure/
│ ├── docker/ # Docker Compose
│ └── k8s/ # Kubernetes manifests
├── scripts/ # Automation scripts
│ ├── backend/
│ ├── web/
│ ├── mobile/
│ ├── deployment/
│ ├── development/
│ ├── testing/
│ └── utilities/
└── .github/workflows/ # CI/CD pipelines
-
Explore Features
- Chat with AI assistant
- Create appointments
- Manage patient records
- View analytics
-
Customize
- Modify AI prompts:
medibot-backend/python/aiagent/prompts/ - Update UI themes
- Add custom features
- Modify AI prompts:
-
Deploy to Cloud
- Use Docker Compose for simple deployments
- Use Kubernetes for production scale
- Enable CI/CD for automated deployments
-
Scale
- Kubernetes HPA included
- Add monitoring/logging
- Configure SSL certificates
macOS/Linux (Automated)
cd /path/to/Medibot-MBSE
./scripts/development/start-all-services.shWindows or All Platforms (Docker)
cd infrastructure/docker
docker-compose up -dManual Start (All Platforms)
Terminal 1 - Backend:
cd medibot-backend
npm run start:devTerminal 2 - AI Agent:
cd medibot-backend/python/aiagent
# macOS/Linux
source venv/bin/activate
# Windows
.\venv\Scripts\Activate.ps1
# Then (all platforms)
python -m uvicorn app:app --host 0.0.0.0 --port 8000 --reloadTerminal 3 - Web (Optional):
cd medibot-web
npm run devTerminal 4 - Mobile (Optional):
cd medibot-mobile
npm startmacOS/Linux:
# Check if running
lsof -i:3001 # Backend
lsof -i:8000 # AI Agent
lsof -i:5173 # Web
# Health checks
curl http://localhost:3001/api/health
curl http://localhost:8000/healthWindows (PowerShell):
# Check if running
netstat -ano | findstr :3001 # Backend
netstat -ano | findstr :8000 # AI Agent
netstat -ano | findstr :5173 # Web
# Health checks
Invoke-WebRequest -Uri http://localhost:3001/api/health
Invoke-WebRequest -Uri http://localhost:8000/healthDocker:
docker-compose ps
docker-compose logs -fmacOS/Linux (Automated):
./scripts/development/stop-all.shWindows or All Platforms (Docker):
cd infrastructure/docker
docker-compose downManual (All Platforms):
- Press
Ctrl+Cin each terminal window running a service
macOS/Linux:
# Backend
cd medibot-backend && cp .env.example .env
# AI Agent
cd python/aiagent && cp .env.example .env
# Web
cd ../../medibot-web && cp .env.example .env
# Mobile
cd ../medibot-mobile && cp .env.example .envWindows (PowerShell):
# Backend
cd medibot-backend; copy .env.example .env
# AI Agent
cd python\aiagent; copy .env.example .env
# Web
cd ..\..\medibot-web; copy .env.example .env
# Mobile
cd ..\medibot-mobile; copy .env.example .envmacOS/Linux:
# Backend
cd medibot-backend && npm install
# AI Agent
cd python/aiagent
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Web
cd ../../medibot-web && npm install
# Mobile
cd ../medibot-mobile && npm installWindows (PowerShell):
# Backend
cd medibot-backend; npm install
# AI Agent
cd python\aiagent
python -m venv venv
.\venv\Scripts\Activate.ps1
pip install -r requirements.txt
# Web
cd ..\..\medibot-web; npm install
# Mobile
cd ..\medibot-mobile; npm installmacOS/Linux:
# Stop all services
./scripts/development/stop-all.sh
# Remove node_modules
find . -name "node_modules" -type d -prune -exec rm -rf '{}' +
# Remove Python venv
rm -rf medibot-backend/python/aiagent/venv
# Reinstall
cd medibot-backend && npm install
cd python/aiagent && python3 -m venv venv && source venv/bin/activate && pip install -r requirements.txt
cd ../../medibot-web && npm install
cd ../medibot-mobile && npm installWindows (PowerShell):
# Stop services (Ctrl+C in each terminal)
# Remove dependencies
Get-ChildItem -Path . -Include node_modules -Recurse -Force | Remove-Item -Recurse -Force
Remove-Item -Recurse -Force medibot-backend\python\aiagent\venv
# Reinstall
cd medibot-backend; npm install
cd python\aiagent; python -m venv venv; .\venv\Scripts\Activate.ps1; pip install -r requirements.txt
cd ..\..\medibot-web; npm install
cd ..\medibot-mobile; npm installDocker (All Platforms):
cd infrastructure/docker
docker-compose down -v
docker-compose build --no-cache
docker-compose up -d| Service | URL | Purpose |
|---|---|---|
| Backend API | http://localhost:3001/api | Main API endpoints |
| Backend Health | http://localhost:3001/api/health | Backend status check |
| AI Agent | http://localhost:8000 | AI agent API |
| AI Agent Health | http://localhost:8000/health | AI agent status |
| AI Docs | http://localhost:8000/docs | FastAPI documentation |
| Web App | http://localhost:5173 | Web dashboard (dev) |
| Web App (Docker) | http://localhost:3000 | Web dashboard (production) |
| Ollama API | http://localhost:11434 | Ollama API |
Web Dashboard:
- Email:
admin@medibot.com - Password:
admin123
PostgreSQL (local):
- Username:
postgres - Password: (set during installation)
- Database:
medibot_db - Port:
5432
Redis (local):
- Host:
localhost - Port:
6379 - Password: (none for local)
- Check Troubleshooting Section above first
- Search existing issues: https://github.com/NoelKhan/medibot-backend/issues
- Create new issue if problem persists
- Join discussions: https://github.com/NoelKhan/medibot-backend/discussions
Please include:
- OS and version (e.g., Windows 11, macOS 14, Ubuntu 22.04)
- Node.js version:
node --version - Python version:
python --versionorpython3 --version - Error messages (full error text)
- Steps to reproduce
- What you've already tried from troubleshooting
We welcome contributions! Please:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
MIT License - see LICENSE file for details
-
Explore the Code:
- Backend:
medibot-backend/src/ - AI Agent:
medibot-backend/python/aiagent/ - Web:
medibot-web/src/ - Mobile:
medibot-mobile/src/
- Backend:
-
Customize Features:
- Modify AI prompts:
medibot-backend/python/aiagent/prompts/ - Update themes:
medibot-web/src/theme/ormedibot-mobile/src/theme/ - Add new API endpoints:
medibot-backend/src/modules/
- Modify AI prompts:
-
Run Tests:
npm test # In any component folder
- Development: Use Docker Compose
- Staging/Production: Use Kubernetes
- CI/CD: GitHub Actions configured (see
.github/workflows/)
- Horizontal Pod Autoscaling: Already configured in
infrastructure/k8s/hpa.yaml - Database Replication: Configure PostgreSQL primary-replica
- Caching: Redis configured for session and data caching
- Load Balancing: Kubernetes ingress with multiple replicas
Built with ❤️ for better healthcare access