Deploying Mere Medical
Introduction
Mere Medical is a self-hosted personal health record (PHR) application that allows you to aggregate and manage your medical records from multiple healthcare providers in one secure, private location. By connecting to healthcare systems through standard APIs (FHIR), Mere Medical gives you complete ownership and control over your health data.
Built with modern web technologies, Mere Medical provides a clean interface for viewing your medical history, lab results, medications, immunizations, and more. The application is designed with privacy as a core principle, keeping all your sensitive health data on your own infrastructure.
Key highlights of Mere Medical:
- Data Aggregation: Connect to multiple healthcare providers and aggregate records
- FHIR Compatible: Uses standard healthcare data exchange protocols
- Comprehensive Records: View lab results, medications, conditions, immunizations, and more
- Timeline View: See your medical history in chronological order
- Document Storage: Upload and store medical documents
- Privacy-First: All data stays on your server, not in the cloud
- Secure by Design: Encrypted storage and secure authentication
- Export Options: Export your data in standard formats
- Self-Hosted: Complete control over your health information
- Open Source: Transparent, community-driven development
This guide walks through deploying Mere Medical on Klutch.sh using Docker, configuring secure storage for your health records, and connecting to healthcare providers.
Why Deploy Mere Medical on Klutch.sh
Deploying Mere Medical on Klutch.sh provides several advantages for personal health record management:
Simplified Deployment: Klutch.sh automatically detects your Dockerfile and builds Mere Medical without complex orchestration. Push to GitHub, and your health portal deploys automatically.
Persistent Storage: Attach persistent volumes for your health records database. Your medical history survives container restarts and redeployments.
HTTPS by Default: Klutch.sh provides automatic SSL certificates, ensuring secure access to your sensitive health data.
GitHub Integration: Connect your configuration repository directly from GitHub. Updates trigger automatic redeployments.
Scalable Resources: Allocate CPU and memory based on your data storage and processing needs.
Custom Domains: Assign a custom domain for secure, private access to your health records.
Always-On Availability: Your health records remain accessible 24/7 when you need them.
Prerequisites
Before deploying Mere Medical on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your configuration
- Basic familiarity with Docker and containerization concepts
- Access to healthcare provider patient portals that support FHIR
- (Optional) A custom domain for your health records portal
Important Security Considerations
Health data is extremely sensitive. Before deploying:
- Use strong, unique passwords
- Enable two-factor authentication when available
- Regularly backup your data
- Keep your deployment updated
- Consider additional network security measures
- Understand the privacy implications of self-hosting health data
Preparing Your Repository
To deploy Mere Medical on Klutch.sh, create a GitHub repository containing your Dockerfile and configuration.
Repository Structure
mere-medical-deploy/├── Dockerfile├── README.md└── .dockerignoreCreating the Dockerfile
Create a Dockerfile in the root of your repository:
FROM node:18-alpine
# Install dependenciesRUN apk add --no-cache python3 make g++
# Set working directoryWORKDIR /app
# Clone Mere MedicalRUN apk add --no-cache git \ && git clone https://github.com/cfu288/mere-medical.git . \ && rm -rf .git
# Install dependenciesRUN npm install
# Build the applicationRUN npm run build
# Create data directoryRUN mkdir -p /data
# Set environment variablesENV NODE_ENV=productionENV DATABASE_PATH=/data/mere-medical.db
# Expose portEXPOSE 3000
# Health checkHEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \ CMD wget --no-verbose --tries=1 --spider http://localhost:3000/ || exit 1
# Start the applicationCMD ["npm", "start"]Environment Variables Reference
| Variable | Required | Default | Description |
|---|---|---|---|
DATABASE_PATH | No | ./mere-medical.db | Path to SQLite database |
SECRET_KEY | Yes | - | Encryption key for sensitive data |
NODE_ENV | No | production | Environment mode |
Deploying on Klutch.sh
- Select HTTP as the traffic type
- Set the internal port to 3000
- Detect your Dockerfile automatically
- Build the container image
- Attach the persistent volumes
- Start the Mere Medical container
- Provision an HTTPS certificate
Generate a Secret Key
Generate a secure encryption key for your health data:
openssl rand -hex 32Push Your Repository to GitHub
Initialize your repository and push to GitHub:
git initgit add Dockerfile .dockerignore README.mdgit commit -m "Initial Mere Medical deployment configuration"git remote add origin https://github.com/yourusername/mere-medical-deploy.gitgit push -u origin mainCreate a New Project on Klutch.sh
Navigate to the Klutch.sh dashboard and create a new project. Give it a descriptive name like “mere-medical” or “health-records”.
Create a New App
Within your project, create a new app. Connect your GitHub account if you haven’t already, then select the repository containing your Mere Medical Dockerfile.
Configure HTTP Traffic
Mere Medical serves its web interface over HTTP. In the deployment settings:
Set Environment Variables
Add the following environment variables:
| Variable | Value |
|---|---|
SECRET_KEY | Your generated secret key |
DATABASE_PATH | /data/mere-medical.db |
NODE_ENV | production |
Attach Persistent Volumes
Add the following volumes:
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/data | 10 GB | Health records database and documents |
Deploy Your Application
Click Deploy to start the build process. Klutch.sh will:
Access Mere Medical
Once deployment completes, access your Mere Medical instance at https://example-app.klutch.sh.
Initial Setup
Creating Your Account
- Navigate to your Mere Medical instance
- Create your personal account
- Set a strong password
- Enable any available security features
Connecting Healthcare Providers
Add your healthcare providers:
- Go to Settings > Connections
- Search for your healthcare provider
- Authorize Mere Medical to access your records
- Records will sync automatically
Supported Providers
Mere Medical supports healthcare systems that implement FHIR APIs, including:
- Epic MyChart
- Cerner
- Many hospital systems
- Some insurance providers
Managing Your Records
Viewing Medical History
Browse your health data:
- Timeline: Chronological view of all records
- Lab Results: Blood work and diagnostic tests
- Medications: Current and past prescriptions
- Conditions: Diagnosed health conditions
- Immunizations: Vaccination records
- Allergies: Known allergies and reactions
Document Management
Upload additional documents:
- Go to Documents
- Upload PDFs, images, or other files
- Add descriptions and tags
- Organize by category
Data Export
Export your health records:
- Export to PDF for sharing with providers
- Download in FHIR format for portability
- Create backups of all data
Health Data Categories
Clinical Data
- Encounters and visits
- Vital signs
- Clinical notes
- Procedure records
Diagnostic Data
- Laboratory results
- Imaging reports
- Pathology reports
Treatment Data
- Medication lists
- Care plans
- Referrals
Privacy and Security
Data Protection
Your health data is protected by:
- Encryption at rest
- Secure HTTPS transmission
- Authentication requirements
- No third-party data sharing
Access Control
Manage who can access your records:
- Single-user by default
- Optional family sharing
- Audit logs of access
Backup Recommendations
Protect your data:
- Regular database backups
- Store backups securely
- Test restoration procedures
- Consider encrypted offsite backups
Troubleshooting
Provider Connection Failed
- Verify your patient portal credentials
- Check if the provider supports FHIR access
- Try reconnecting the account
- Contact the provider’s support if needed
Missing Records
- Sync may take time for large record sets
- Some historical data may not be available via API
- Check provider portal for record availability
Application Errors
- Review container logs
- Verify database permissions
- Check available storage space
- Ensure environment variables are set correctly
Additional Resources
- Mere Medical GitHub Repository
- FHIR Standard Documentation
- Klutch.sh Persistent Volumes
- Klutch.sh Deployments
Conclusion
Deploying Mere Medical on Klutch.sh gives you complete ownership of your personal health records. By aggregating data from multiple healthcare providers into one secure, self-hosted application, you can maintain a comprehensive view of your medical history without relying on third-party cloud services.
The combination of Mere Medical’s FHIR integration and Klutch.sh’s reliable infrastructure provides a robust foundation for personal health data management. With proper security practices and regular backups, you can confidently maintain your health records in a way that prioritizes your privacy and control.